Skip to content

Commit

Permalink
Pose picking started
Browse files Browse the repository at this point in the history
  • Loading branch information
l00p3 committed Aug 2, 2024
1 parent 492d296 commit 257551d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions python/kiss_icp/tools/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,19 @@ def _quit_callback(self):
self._ps.unshow()
os._exit(0)

def _trajectory_pick_callback(self):
if self._gui.GetIO().MouseClicked[0]:
name, idx = self._ps.get_selection()
if name == "trajectory" and self._ps.has_point_cloud(name):
pose = self._trajectory[idx]
self._vis_infos["selected_pose"] = (
f"<{pose[0]:7.3f}, {pose[1]:7.3f}, {pose[2]:7.3f}>"
)
elif "selected_pose" in self._vis_infos:
self._vis_infos.pop("selected_pose")

def _main_gui_callback(self):
# GUI callbacks
self._start_pause_callback()
if not self._play_mode:
self._gui.SameLine()
Expand All @@ -283,3 +295,6 @@ def _main_gui_callback(self):
self._center_viewpoint_callback()
self._gui.Separator()
self._quit_callback()

# Mouse callbacks
self._trajectory_pick_callback()

0 comments on commit 257551d

Please sign in to comment.