Skip to content

Commit

Permalink
WIP-ADD: auto-tables for toolhead and mounts + mount images
Browse files Browse the repository at this point in the history
  • Loading branch information
9and3 committed Dec 21, 2024
1 parent 968d1ca commit 2cf53f9
Show file tree
Hide file tree
Showing 25 changed files with 242 additions and 23 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
andre
LAPTOP-RR341PAC
Saturday, December 21, 2024
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.
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.
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.
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.
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.
7 changes: 7 additions & 0 deletions docs/developer-guide/AR-engine/AR-rendering.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
tags:
- AREngine
- render
---


# AR rendering

## Main Rendering Pipeline
Expand Down
30 changes: 29 additions & 1 deletion docs/developer-guide/AR-engine/feedback-system.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
tags:
- AREngine
- feedback-system
---

# Feedback system

![Dataflow for the functioning of the Augmented Carpentry's feedback system. ><](../../assets/images/AR_engine/fig_feedback-sys.svg){align=center width=100% style='fill-color: #000000; filter: invert(100%);'}
Expand Down Expand Up @@ -31,7 +37,29 @@ Each feedback category inherits from an interface class ([`AIAC/Feedback/FabFeed


``` cpp title="src/AIAC/Feedback/FabFeedback.h" linenums="1" hl_lines="5-6 16-18"
--8<-- "src/AIAC/Feedback/FabFeedback.h"
#pragma once

#include "AIAC/Config.h"

#define AC_FF_COMP AIAC_APP.GetLayer<LayerModel>()->GetACInfoModel().GetTimberInfo().GetCurrentComponent()
#define AC_FF_TOOL AIAC_APP.GetLayer<LayerToolhead>()->ACInfoToolheadManager->GetActiveToolhead()

namespace AIAC {
class FabFeedback {
public:
FabFeedback() {
this->m_ScaleFactor = AIAC::Config::Get<float>(AIAC::Config::SEC_AIAC, AIAC::Config::SCALE_FACTOR, 1.0f);
};
~FabFeedback() = default;

virtual void Update() {};
virtual void Activate() {};
virtual void Deactivate() {};

protected:
float m_ScaleFactor = 0.0f;
};
}
```
!!! Tip
Expand Down
6 changes: 6 additions & 0 deletions docs/developer-guide/AR-engine/geometry-framework.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
tags:
- AREngine
- go
---

# Geometry framework

The geometry framework provides a unified infrastructure for handling all 3D objects in the scene, including CAD models, scanned models, and fabrication instructions. This framework enables easy interaction between application layers and 3D objects while being tightly integrated with the rendering system, which implicitly manages OpenGL resources, simplifying the workload for application layers.
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/AR-engine/layer-stack.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
tags:
- AREngine
- layer-stack
- backend
---

# Layer stack
Expand Down
8 changes: 8 additions & 0 deletions docs/developer-guide/toolheads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
tags:
- toolheads
---

# Toolheads

Here we give more information about how toolheads are itnegrated in the AC system.
46 changes: 33 additions & 13 deletions docs/hardware/woodworking-tools.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

# Tools

<!-- AC is designed to be *machine independent*, it is only dependent on the toolheads (e.g.: drill bits, circular saw blades and chainsaw boards). You can find a list of the available toolheads [here](https://zenodo.org/records/12578820). If you want to add your own, open a Pull Request to the repo [TTool](https://github.com/ibois-epfl/TTool) and follow the [Wiki](https://github.com/ibois-epfl/TTool/wiki). -->
# Woodworking tools

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

Expand All @@ -11,8 +9,6 @@

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

<!-- TODO: rearrange better this intro -->

AC is designed to seamlessly integrate with virtually any woodworking tool, new or old, provided you can:

- [x] securely mount the AC camera and display unit onto the tool itself
Expand All @@ -30,25 +26,49 @@ If you want to add your own 3d-printable mount or tool head model and share it w
///


## Available Toolheads

<!-- TODO: add rotating svg of the toolhead -->

## Tool mounts
The following is a list of the available toolheads that are already integrated into the AC system. You will need to use or acquire the corresponding physical toolhead to use the AC system.

<!-- TODO: make a split tab: existing dataset VS add new -->
The Zenodo repository containing the dataset is [here](https://zenodo.org/records/12578820).

The camera and the display needs to be mounted on the tool itself and follow its movement. To do so we share here the system we designed for our current prototype. You can download
<!-- TODO: add icons for the type of tool -->

{{ run_python_script('docs/scripts/get_zenodo_toolheads.py') }}

!!! tip "Want to add a new toolhead?"
If you want to add your own toolhead to the AC system, follow the instructions in the section [contributing](../contributing/index.md).

!!! note "Toolhead integration"
If you want to know more about the details of the integration and how toolhead are managed in the AC system, you can read the [developer guide](../developer-guide/toolheads.md).


## Available 3D mounts

<div class="grid" markdown>
![](../assets/images/getting_started/hardware_mounts/mount_ex_1.png){width="200"} ![](../assets/images/getting_started/hardware_mounts/mount_ex_2.png){width="200"} ![](../assets/images/getting_started/hardware_mounts/mount_ex_3.png){width="200"} ![](../assets/images/getting_started/hardware_mounts/mount_ex_4.png){width="200"} ![](../assets/images/getting_started/hardware_mounts/mount_ex_9.png){width="200"} ![](../assets/images/getting_started/hardware_mounts/mount_ex_5.png){width="200"} ![](../assets/images/getting_started/hardware_mounts/mount_ex_6.png){width="200"} ![](../assets/images/getting_started/hardware_mounts/mount_ex_7.png){width="200"} ![](../assets/images/getting_started/hardware_mounts/mount_ex_8.png){width="200"} ![](../assets/images/getting_started/hardware_mounts/mount_ex_10.png){width="200"}
</div>

Each mount is designed with a flexible integration mechanism, allowing for the attachment of various clipping solutions. Our reference implementation utilizes magnetic clips and a loc-line arm to ensure secure, tool-safe mounting of the sensors and interfaces and easy removal. However, the design files allow users to incorporate their preferred fastening methods—ranging from simple clips to more complex spring-loaded solutions—enabling adaptation to a broad range of tool geometries.

- Identify the corresponding mount file that matches your tool brand and model.
- Download and 3D print the STL file(s).
- Integrate your desired clipping mechanism.
- Attach the completed mount to your woodworking tool.

The Zenodo repository containing the dataset is [here](https://zenodo.org/records/14531724).

## Tool heads dataset
For convinience, here is a list of the available mounts regrouped by brands:

<!-- TODO: make a split tab: existing dataset VS add new -->
<!-- TODO: try to add a macros mkdocs to autogenerate the table -->
{{ run_python_script('docs/scripts/get_zenodo_mounts.py') }}

!!! tip "Want to add a new mount?"
If you want to add your own toolhead to the AC system, follow the instructions in the section [contributing](../contributing/index.md).

AC is designed to be *machine independent*, meaning that it is only dependent on the toolheads (e.g.: drill bits, circular saw blades and chainsaw boards). This means that you can attach any toolhead to the machine and the system will adapt to it if the toolhead is in the list of those integrated in AC.
<!-- TODO: add example and images on how to integrate our prototype with the loc line and the magnet -->

You can find a list of the available toolheads already available here [here](https://zenodo.org/records/12578820). If you want to add your own and share it with the community, follow the

<!-- TODO: update -->
## Components list
Expand Down
81 changes: 81 additions & 0 deletions docs/scripts/get_zenodo_mounts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import requests
import re

def list_zenodo_entries(zenodo_record_id):
url = f'https://zenodo.org/api/records/{zenodo_record_id}'
response = requests.get(url)
if response.status_code == 200:
data = response.json()

mount_kits = {}

for file in data.get('files', []):
filename = file['key']
filename = filename.split('.')[0]
download_link = file['links']['self']
file_size = file['size'] / (1024 * 1024)

filename_lower = filename.lower()
name_pool = re.split('[_]', filename_lower)

mount_type = name_pool[0]
mount_brand = name_pool[1]
mount_model = name_pool[2]
try:
mount_part = name_pool[3]
except:
mount_part = "a"

for key in name_pool:
if 'drill' in name_pool:
mount_type = ":material-screw-machine-flat-top:`drill`"
elif 'chainsaw' in name_pool:
mount_type = ":material-hand-saw:`chain saw`"
elif 'circularsaw' in name_pool:
mount_type = ":material-saw-blade:`circular saw`"
elif 'sabersaw' in name_pool:
mount_type = ":material-hand-saw:`saber saw`"
elif 'mitersaw' in name_pool:
mount_type = ":material-circular-saw:`miter saw`"

# Group parts by model name
if mount_model not in mount_kits:
mount_kits[mount_model] = []
mount_kits[mount_model].append({
'filename': filename,
'type': mount_type,
'brand': mount_brand,
'part': mount_part,
'size': file_size,
'download_link': download_link
})
else:
print('!!! bug \n\tError fetching data from Zenodo')

for mount_model, parts in mount_kits.items():
mount_kits[mount_model] = sorted(parts, key=lambda x: x['part'])

brands = []
for mount_model, parts in mount_kits.items():
for part in parts:
if part['brand'] not in brands:
brands.append(part['brand'])
brands.sort()

print('| Model name | Mount parts | Brand | type | size (MB) | Download |')
print('|------------|-------------|-------|------|-----------|----------|')
for brand in brands:
for mount_model, parts in mount_kits.items():
for part in parts:
if part['brand'] == brand:
filename = part['filename']
mount_type = part['type']
mount_brand = part['brand']
mount_part = part['part']
file_size = part['size']
download_link = part['download_link']
print(f'| {mount_model} | {mount_part} | {mount_brand} | {mount_type} | {file_size:.2f} | [:octicons-download-24:]({download_link}) |')

if __name__ == '__main__':
zenodo_record_id = '14531724'
list_zenodo_entries(zenodo_record_id)
16 changes: 8 additions & 8 deletions docs/scripts/get_zenodo_toolheads.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def list_zenodo_entries(zenodo_record_id):
if response.status_code == 200:
data = response.json()

print('| Filename | type | size (MB) | Download |')
print('| Toolhead | type | size (MB) | Download |')
print('|----------|------|-----------|----------|')

for file in data.get('files', []):
Expand All @@ -17,7 +17,7 @@ def list_zenodo_entries(zenodo_record_id):
file_size = file['size'] / (1024 * 1024) # Convert size to MB

# Detect type of object
obj_type = "test"
obj_type = "none"
type_pool = re.split('[-_]', filename)
type_drill_keys = ['drill', 'mesh', 'bit']
type_saw_keys = ['saw', 'blade']
Expand All @@ -27,21 +27,21 @@ def list_zenodo_entries(zenodo_record_id):

for key in type_drill_keys:
if key in type_pool:
obj_type = 'drill'
obj_type = ":material-screw-machine-flat-top:`drill`"
break
for key in type_saw_keys:
if key in type_pool:
if 'chain' in type_pool:
obj_type = 'chain saw'
obj_type = ":material-hand-saw:`chain saw`"
elif 'circular' in type_pool:
obj_type = 'circular saw'
obj_type = ":material-saw-blade:`circular saw`"
elif 'saber' in type_pool:
obj_type = 'saber saw'
obj_type = ":material-hand-saw:`saber saw`"
else:
obj_type = 'saw'
obj_type = 'None'
break

print(f"| {filename} | `{obj_type}` | {file_size:.2f} | [:octicons-download-24:]({download_link}) |")
print(f"| {filename} | {obj_type} | {file_size:.2f} | [:octicons-download-24:]({download_link}) |")
else:
print('!!! bug \n\tError fetching data from Zenodo')

Expand Down
2 changes: 2 additions & 0 deletions material/overrides/.icons/tools/chainsaw.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions material/overrides/.icons/tools/circularsaw.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2cf53f9

Please sign in to comment.