Skip to content

Commit

Permalink
ADD-WIP: interface refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
9and3 committed Nov 26, 2024
1 parent 38e606c commit 130fb6e
Show file tree
Hide file tree
Showing 18 changed files with 146 additions and 81 deletions.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 45 additions & 41 deletions docs/hardware/computing.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,15 @@
# Computer
# Computing unit

AC's prototype is built for x64 machines running on Ubuntu 22.04 LTS. The system does not exploit GPU acceleration and can run on a laptop, a portable computing unit or a desktop.

## test
<!-- md:version v0.4.0 -->


=== ":fontawesome-solid-briefcase:&nbsp;&nbsp; Wearable"

## Deploying on a NUC


In our current prototype we wanted to develop a computing unit that could be easily transported and used in construction sites and shops. For this reason we decided to use a x64 machine of type [NUC](https://en.wikipedia.org/wiki/Next_Unit_of_Computing). We decided such machine for our wearable layout for the following reasons:

`x64 target machine`
: More importantly, it has the same architecture as a laptop or a desktop, which streamlines the development process (e.g. no `.apk` files to generate and deploy on the device). Additionally, being on UNIX x64 machines, we could leverage all the top notch libraries and dependecies available from robotics and computer vision communities.

`Small factor`
: It is a small form factor computer that can be easily transported.

` Low power consumption`
: It is energy efficient and can be powered by a 18v (5.0Ah) battery for power tools.

`Ordinary Sensor Interface`
: It has a USB interface which is common and can be used to connect the camera as well as any other device (e.g. touch screen).
In our current prototype we wanted to develop a computing unit that could be easily transported and used in construction sites and shops. For this reason we decided to use a x64 machine of type [NUC](https://en.wikipedia.org/wiki/Next_Unit_of_Computing).

/// html | div[style='float: left; width: 40%;']

![pc hardware view](../assets/images/getting_started/only_pc.JPG){width="400" class="rounded-corners"}
![pc hardware view](../assets/images/getting_started/only_pc.JPG){width="380" class="rounded-corners"}

///

Expand Down Expand Up @@ -58,36 +40,58 @@ AC's prototype is built for x64 machines running on Ubuntu 22.04 LTS. The system

/// html | div[style='clear: both;']
///

## Additional components

The NUC is contained in a 3D printed protection[^1] case that we designed specifically for extra resistance and to include an attachment for the battery. The battery is a 18v (5.0Ah) battery that can be used for power tools. The battery is connected to the NUC via a 5v regulator (LM785) to ensure a stable power supply. The battery is also connected to a buzzer that will beep when the battery voltage is below a certain threshold (circa 15%). This will inform the user to change the battery.
We decided such machine for our wearable AR system for the following reasons:

<!-- TODO:add block custom with files to donwload -->
`x64 target machine`
: More importantly, it has the same architecture as a laptop or a desktop, which streamlines the development process (e.g. no `.apk` files to generate and deploy on the device). Additionally, being on UNIX x64 machines, we could leverage all the top notch libraries and dependecies available from robotics and computer vision communities.

???+ example "Simple battery monitor"
`Small factor`
: It is a small form factor computer that can be easily transported.

As a bonus, here's the diagram and code snippet shows how to monitor the battery voltage connected to a NUC using a buzzer. The buzzer will inform when needs to be changed.
` Low power consumption`
: It is energy efficient and can be powered by a 18v (5.0Ah) battery for power tools.

To realize this schematic, you will need the following components:
`Ordinary Sensor Interface`
: It has a USB interface which is common and can be used to connect the camera as well as any other device (e.g. touch screen).

- [x] 1x Arduino Nano
- [x] 1x DIY cable sleeve
- [x] 1x 5v regulator (LM785)
- [x] 1x battery attachment
- [x] 1x piezo buzzer
- [x] 6x resistors 200ohm
## Components list

![diagram for battery](../assets/images/getting_started/voltageBuzzer.png){align=left width="500" class="rounded-corners"}
The battery is a 18v (5.0Ah) battery that can be used for power tools. The battery is connected to the NUC via a 5v regulator (LM785) to ensure a stable power supply. The battery is also connected to a buzzer that will beep when the battery voltage is below a certain threshold (circa 15%). This will inform the user to change the battery.

``` c++ title="assets/arduino_scripts/battmonitor.ino"
--8<-- "assets/arduino_scripts/battmonitor.ino.ino"
```
!!! print-parts "Parts"

[^1]: for our prototype we printed on a Pruse MK3d+ on PLA.
Here's the list of the parts you will need to obtain or realize:

=== ":fontawesome-solid-laptop-code:&nbsp;&nbsp; Laptop"
- [x] &nbsp;&nbsp; NUC
- [x] &nbsp;&nbsp; Protective case: the NUC is contained in a 3D printed protection[^1] case that we designed specifically for extra resistance and to include an attachment for the battery.
- x1 [:octicons-file-code-16: `assets/hardware_parts/nuc/nucpoite2.stl`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/nuc/nucpoite2.stl)
- [x] &nbsp;&nbsp; 1x Power tool battery 18v (5.0Ah)
- [x] &nbsp;&nbsp; Battery adapter
- [x] &nbsp;&nbsp; 1x 5v regulator (LM785)
- [x] &nbsp;&nbsp; 1x Battery monitor

pass
???+ example "Battery monitor blueprint"

As a bonus, here's the diagram and code snippet shows how to monitor the battery voltage connected to a NUC using a buzzer. The buzzer will inform when needs to be changed.

To realize this schematic, you will need the following components:

- [x] &nbsp;&nbsp; 1x Arduino Nano
- [x] &nbsp;&nbsp; 1x DIY cable sleeve
- [x] &nbsp;&nbsp; 1x piezo buzzer
- [x] &nbsp;&nbsp; 6x resistors 200ohm

![diagram for battery](../assets/images/getting_started/voltageBuzzer.png){align=left width="500" class="rounded-corners"}

``` c++ title="assets/arduino_scripts/battmonitor.ino"
--8<-- "assets/arduino_scripts/battmonitor.ino.ino"
```

[^1]: printed on a Pruse MK3d+ on PLA.

=== ":fontawesome-solid-laptop-code:&nbsp;&nbsp; Laptop"

If you are using a laptop or a desktop, you just need *at least*[^2] Ubuntu 22.04.3 LTS x86_64 installed on your machine and you are good to go.

[^2]: AC has not been tested on more recent LTS versions other than 22.04.3.
1 change: 0 additions & 1 deletion docs/hardware/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

AC needs just a simple x64 machine running on Ubuntu 22.04 LTS an interface and a monocular camera. It does not exploit GPU acceleration and can run on a laptop, a portable computing unit (e.g. [NUC](https://en.wikipedia.org/wiki/Next_Unit_of_Computing)) or a desktop.

![AC Hardware setup ><](../assets/images/getting_started/setup_AC.png){width="900"}
83 changes: 57 additions & 26 deletions docs/hardware/interface.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,77 @@
# Interface

AC is designed as a console app with a [GUI](https://en.wikipedia.org/wiki/Graphical_user_interface). This means that it can work with a touch screen (via HDMI) or a laptop. The interface is designed to be simple and intuitive. The main goal is to provide a quick and familiar way to interact with the system where every touch operations is in reality a click operation. This way we can develop our AR software without bodering for dedicated development on more complex [HMDs](https://en.wikipedia.org/wiki/Head-mounted_display) or advanced AR interfaces that would offer more ergonomic value to the cost of an increase complexity during the deployement.
AC is designed as a console app with a [GUI](https://en.wikipedia.org/wiki/Graphical_user_interface). This means that it can work with a touch screen (via HDMI) or a laptop. The interface is designed to be simple and intuitive. The main goal is to provide a quick and familiar way to interact with the system where every touch operations is in reality a click operation. This way we can develop our AR software without bodering for dedicated development on more complex [HMDs](https://en.wikipedia.org/wiki/Head-mounted_display) or advanced AR interfaces that would offer more ergonomic value to the cost of an increase complexity during the deployement and a steeper learning curve for the users.



=== ":fontawesome-solid-briefcase:&nbsp;&nbsp; Wearable"
<!-- TODO: add here sub chapters and the hardware necessary -->
If you use a touch screen be sure to set this option when configuring the build:

``` c++
cmake -S . -B build -DDEPLOY_ON_TOUCH=ON
```
/// html | div[style='float: left; width: 58%;']

![AC Hardware setup](../assets/images/getting_started/setup_AC_cut_shortview.png){width="700" class="rounded-corners"}

///

/// html | div[style='float: right;width: 40%;']

You can use the [WaveShare WS170120](https://www.waveshare.com/wiki/7inch_HDMI_LCD_(B)) as in the current AC prototype and follow the instructions below. To config the touch screen on the pc follow [these steps first](https://www.waveshare.com/wiki/7inch_HDMI_LCD). Be sure to switch the display on, plug the mini-USB and finally plug the HDMI cable.

///

You can use the [WaveShare WS170120](https://www.waveshare.com/wiki/7inch_HDMI_LCD_(B)) as in the current prototype and follow the instructions below:
/// html | div[style='clear: both;']
///

To config the touch screen on the pc follow [these steps first](https://www.waveshare.com/wiki/7inch_HDMI_LCD). Be sure to switch the display on, plug the mini-USB and finally plug the HDMI cable.
## Components list

Set the display properties in the `config.ini` properties (to find them run the commands `xinput` for the name and `xrandr` for the connection type).
!!! print-parts "Parts"

The following specs works on the X11 display server also, but you can use any other touch screen, just make sure to set the correct specs in the `config.ini` file:
Here's the list of the parts you will need to obtain or realize:

```c++ title="config.ini"
[MonitorSpecs]
monitor_name = WaveShare WS170120
monitor_link_t = HDMI
monitor_resolution = 1280 x 720
```
- [x] &nbsp;&nbsp; WaveShare WS170120
- [ ] &nbsp;&nbsp; Support and tool-side attach for the screen
* [x] &nbsp;&nbsp; 3D printed parts
- x1 [:octicons-file-code-16: `assets/hardware_parts/touchscreen/nuts_ecran.stl`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/touchscreen/nuts_ecran.stl)
- x1 [:octicons-file-code-16: `assets/hardware_parts/touchscreen/reinforce_attachusb.stl`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/touchscreen/reinforce_attachusb.stl)
- x1 [:octicons-file-code-16: `assets/hardware_parts/touchscreen/screen_board_3.stl`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/touchscreen/screen_board_3.stl)
- x1 [:octicons-file-code-16: `assets/hardware_parts/touchscreen/locline_attach.stl`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/touchscreen/locline_attach.stl)
* [x] &nbsp;&nbsp; Screen rigs to CNC cut
- x1 [:octicons-file-code-16: `assets/hardware_parts/touchscreen/back_screen.pdf`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/touchscreen/back_screen.pdf)
- x1 [:octicons-file-code-16: `assets/hardware_parts/touchscreen/back_screen.dxf`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/touchscreen/back_screen.dxf)
- x1 [:octicons-file-code-16: `assets/hardware_parts/touchscreen/screen_board_1.dxf`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/touchscreen/screen_board_1.dxf)
- x1 [:octicons-file-code-16: `assets/hardware_parts/touchscreen/screen_board_2.dxf`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/touchscreen/screen_board_2.dxf)
* [x] &nbsp;&nbsp; Magnet attachement to the tool
- x1 [:octicons-file-code-16: `assets/hardware_parts/touchscreen/magnet_screenside.pdf`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/touchscreen/magnet_screenside.pdf)
- x1 [:octicons-file-code-16: `assets/hardware_parts/touchscreen/nucpoite2.stl`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/touchscreen/nucpoite2.stl)
* [x] x10 M3x10 threaded inserts
* [x] x10 M3x10 nuts
- [x] &nbsp;&nbsp; USB 2.0 cable (length: 1.5m)
- [x] &nbsp;&nbsp; HDMI (length: cable 1.5m)
- [x] &nbsp;&nbsp; Cable protections and fixations
- [x] &nbsp;&nbsp; [:octicons-file-code-16: `assets/hardware_parts/nucpoite2.stl`](https://github.com/ibois-epfl/augmented-carpentry/blob/main/assets/hardware_parts/nucpoite2.stl)

!!! warning

Wayland display and touchscreen are not compatible yet as the touchscreen register for the main display and not the small display.
Set the display properties in the `config.ini` properties (to find them run the commands `xinput` for the name and `xrandr` for the connection type).

The following specs works on the X11 display server also, but you can use any other touch screen, just make sure to set the correct specs in the `config.ini` file:

```c++ title="config.ini"
[MonitorSpecs]
LinkMode = XWAYLAND1
Name = Virtual core pointer
Resolution = 1280 x 720
monitor_name = WaveShare WS170120
monitor_link_t = HDMI
monitor_resolution = 1280 x 720
```

=== ":fontawesome-solid-laptop-code:&nbsp;&nbsp; Laptop"
??? warning "XWayland"

For a quick test or development you can use a laptop and the webcam. Just adjust later the CMake config option.
Wayland display and touchscreen are not compatible yet as the touchscreen register for the main display and not the small display.

```c++ title="config.ini"
[MonitorSpecs]
LinkMode = XWAYLAND1
Name = Virtual core pointer
Resolution = 1280 x 720
```

=== ":fontawesome-solid-laptop-code:&nbsp;&nbsp; Laptop"

``` c++
cmake -S . -B build -DDEPLOY_ON_TOUCH=OFF
```
In case you use a laptop or a desktop, you can use the touchpad or a mouse to interact with the system as you would do for any other desktop application.
2 changes: 1 addition & 1 deletion docs/hardware/woodworking-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ You can find a list of the available toolheads [here](https://zenodo.org/records

## Tool attachement

This is the second thing which needs to be set up. The tool attachment is the way the camera and the touch display are attached to the machine. This is important for the system to know the position of the tool in the space. The tool attachment is a simple 3D printed part which is attached to the tool and has a specific shape which is recognized by the system. The tool attachment is also used to attach the camera to the tool. The camera is used to track the tool in the space.
This is the second thing which needs to be set up. The tool attachment is the way the camera and the touch display are attached to the machine. This is important for the system to know the position of the tool in the space. The tool attachment is a simple 3D printed part which is attached to the tool and has a specific shape which is recognized by the system. The tool attachment is also used to attach the camera to the tool. The camera is used to track the tool in the space.
32 changes: 22 additions & 10 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,36 @@ libopencv-dev

The rest of the other dependecies will be automatically downloaded and installed by the CMake build system in the next steps.

## Build and Run
## Config and Build

```bash
cd augmented-carpentry
cmake -S . -B build
cmake --build build
```
=== ":fontawesome-solid-briefcase:&nbsp;&nbsp; Wearable"

To run the code be sure that your USB-Camera is connected and run the following command:
```bash
cd augmented-carpentry
cmake -S . -B build -DDEPLOY_ON_TOUCH=ON
cmake --build build
```

```bash
./build/bin/AC
```
=== ":fontawesome-solid-laptop-code:&nbsp;&nbsp; Laptop"

```bash
cd augmented-carpentry
cmake -S . -B build
cmake --build build
```

!!! Tip

:octicons-file-code-16: [`default_config.ini`](assets/default_config.ini)

While running the code, make sure that `config.ini` and `assets/` exists in the current directory. If errors related to config present, please reconfigure the `config.ini` by copy-pasting the content from `/assets/default_config.ini`.

## Run

To run the code be sure that your USB-Camera is connected and run the following command:

```bash
./build/bin/AC
```

That's it your are running Augmented Carpentry🪚!
Loading

0 comments on commit 130fb6e

Please sign in to comment.