Skip to content

Commit 078e67d

Browse files
committed
optional result visualization
1 parent ccf10a2 commit 078e67d

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Roboreg
1+
# roboreg
22
[![Unit tests](https://github.com/lbr-stack/roboreg/actions/workflows/tests.yaml/badge.svg)](https://github.com/lbr-stack/roboreg/actions/workflows/tests.yaml)
33
[![PyPI version](https://img.shields.io/pypi/v/roboreg.svg)](https://pypi.org/project/roboreg/)
44
[![License: Apache License 2.0](https://img.shields.io/github/license/lbr-stack/roboreg)](https://github.com/lbr-stack/roboreg?tab=Apache-2.0-1-ov-file)
@@ -160,6 +160,7 @@ rr-hydra \
160160
--root-link-name lbr_link_0 \
161161
--end-link-name lbr_link_7 \
162162
--number-of-points 5000 \
163+
--display-results \
163164
--output-file HT_hydra_robust.npy
164165
```
165166

@@ -295,6 +296,7 @@ rr-hydra \
295296
--root-link-name link_base \
296297
--end-link-name link7 \
297298
--number-of-points 5000 \
299+
--display-results \
298300
--output-file HT_hydra_robust.npy
299301
```
300302

cli/rr_hydra.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
parse_hydra_data,
1515
)
1616
from roboreg.util import (
17-
RegistrationVisualizer,
1817
clean_xyz,
1918
compute_vertex_normals,
2019
depth_to_xyz,
@@ -159,6 +158,11 @@ def args_factory() -> argparse.Namespace:
159158
default=10,
160159
help="Erosion kernel size for mask boundary. Larger value will result in larger boundary. The closer the robot, the larger the recommended kernel size.",
161160
)
161+
parser.add_argument(
162+
"--display-results",
163+
action="store_true",
164+
help="Display point cloud registration results.",
165+
)
162166
validate_urdf_source(parser, parser.parse_args())
163167
return parser.parse_args()
164168

@@ -293,13 +297,16 @@ def main():
293297
)
294298

295299
# visualize
296-
visualizer = RegistrationVisualizer()
297-
visualizer(mesh_vertices=mesh_vertices, observed_vertices=observed_vertices)
298-
visualizer(
299-
mesh_vertices=mesh_vertices,
300-
observed_vertices=observed_vertices,
301-
HT=torch.linalg.inv(HT),
302-
)
300+
if args.display_results:
301+
from roboreg.util import RegistrationVisualizer
302+
303+
visualizer = RegistrationVisualizer()
304+
visualizer(mesh_vertices=mesh_vertices, observed_vertices=observed_vertices)
305+
visualizer(
306+
mesh_vertices=mesh_vertices,
307+
observed_vertices=observed_vertices,
308+
HT=torch.linalg.inv(HT),
309+
)
303310

304311
# to numpy
305312
HT = HT.cpu().numpy()

0 commit comments

Comments
 (0)