Skip to content

Commit

Permalink
fix some tools and tmp numpy version
Browse files Browse the repository at this point in the history
  • Loading branch information
digiamm committed Nov 15, 2024
1 parent e20dcb3 commit dc5f1ae
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Our runner directly saves the odometry estimate file in KITTI format (homogenous

Our pipeline is `anytime realtime`! You can play with parameters `num_keyframes` and `num_cores` and, if you have enough _computation capacity_, we suggest increasing these (we run demo/experiments with `num_keyframes=16` and `num_cores=16`).

## Data associtation and registration tools
If you want to use our MAD-tree to perform nearest neighbor or use MAD-ICP to perform registration between two point clouds, <b>[here few easy examples](https://github.com/rvp-group/mad-icp/tree/main/mad_icp/apps/utils/tools/README.md)</b>.


____________________________________________________________________

# Building from source
Expand Down
17 changes: 9 additions & 8 deletions mad_icp/apps/utils/tools/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
<div align="center">
<h1>Data association and registration tools</h1>
<br />
</div>

# Usage
# Data association and registration tools
### Data association
`nn_search.py` allows computing the data association between either:
- a query point and a reference cloud;
- a query cloud and a reference cloud.

For each query point, the nearest-neighbor search returns the corresponding reference point with the estimated normal.
Notice that the pybind of the tree build method has `b_max` parameter set to `1e-5` by default (check `src/pybind/tools/pymadtree.cpp`). A MAD tree built with such a parameter has exactly one leaf for each point of the original cloud, thus providing the most dense possible reference.
Indeed, the total matching error printed by running `nn_search.py` as it is is zero. Highering `b_max` in the tree building leads to a shallower tree with fewer leaves, thus making the reference less dense than the query cloud, consequently increasing the total matching error.
Notice that the pybind of the tree build method has `b_max` parameter set to `1e-5` by default (check `src/pybind/tools/pymadtree.cpp`). A MAD-tree built with such a parameter has exactly one leaf for each point of the original cloud, thus providing the most dense possible reference.
Indeed, the total matching error printed by running `nn_search.py` as it is is zero (because query and reference cloud are the same). Highering `b_max` in the tree building leads to a shallower tree with fewer leaves, thus making the reference less dense than the query cloud, consequently increasing the total matching error.
To run this module:
```bash
python3 nn_search.py
```

### Registration
`mad_registration.py` registers a query cloud on a reference cloud, providing the estimated transformation between them. This module also allows us to visualize the cloud alignment at the end of each iteration, and the data reassociations between the two.
You can run this module with the option `--viz` for toggling visualization.
```bash
python3 mad_registration.py --viz
```

<div align="center">
<a href=""><img src="mad-registration.gif?raw=true"/></a>
</div>
Binary file added mad_icp/apps/utils/tools/mad-registration.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion mad_icp/apps/utils/tools/mad_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def main(viz: Annotated[bool, typer.Option(help="if true visualizer on", show_de
query_pcd.paint_uniform_color([1, 0, 0]) # red

vis = o3d.visualization.Visualizer()
vis.create_window()
vis.create_window(window_name="MAD-registration", width=1280, height=720, visible=True)
vis.add_geometry(ref_pcd)
vis.add_geometry(query_pcd)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ classifiers = [
]
dependencies = [
"PyYAML",
"numpy",
"numpy==1.26.4",
"rosbags",
"open3d",
"matplotlib",
Expand Down

0 comments on commit dc5f1ae

Please sign in to comment.