Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kissualizer: a new KISS-ICP visualizer! #379

Merged
merged 42 commits into from
Aug 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
164eb9f
Merge pull request #2 from PRBonn/main
l00p3 Jul 26, 2024
5d75de3
Visualizer initialized
l00p3 Jul 26, 2024
d071d41
Simple buttons added
l00p3 Jul 26, 2024
caa7f1a
Almost done
l00p3 Jul 26, 2024
ff61af6
Center viewpoint option
l00p3 Jul 26, 2024
502ea17
Better static member management
l00p3 Jul 26, 2024
133e21a
Better palette and global view
l00p3 Jul 26, 2024
0d03ca7
Global View is not switchable standing
l00p3 Jul 26, 2024
a5c63ad
Arrows on trajectory
l00p3 Jul 26, 2024
addcbec
Slight beautification of arrows
l00p3 Jul 26, 2024
18725e2
Global points dimensions
l00p3 Jul 26, 2024
802ae40
Trajectory not invisible but actually not there in local mode
l00p3 Jul 26, 2024
089bd1b
Some TODO todo
l00p3 Jul 26, 2024
bd92e91
Refactor code, palette changed, trajectory swithc in global fixed
l00p3 Jul 29, 2024
8fb9c71
Some separator
l00p3 Jul 29, 2024
d0f9d0b
Points size sliders
l00p3 Jul 29, 2024
f2c270e
Better viewpoint centering
l00p3 Jul 29, 2024
fff0f79
Screenshot demo added
l00p3 Jul 29, 2024
27b4c17
Some button key added
l00p3 Jul 29, 2024
0dae3d0
Fixed DEBUG name window
l00p3 Jul 29, 2024
42c3a16
Parameters visualization and fps added
l00p3 Jul 30, 2024
a189757
Center viewpoint improved
l00p3 Jul 30, 2024
9ed426b
Trajectory un-registration for better bounding box
l00p3 Jul 30, 2024
60236f4
Color palette changed again
l00p3 Jul 30, 2024
62d756d
Some cleaning
l00p3 Jul 30, 2024
fbdef70
Button name with keys and missing keys added
l00p3 Jul 31, 2024
bed3c91
Embrace Benedikt's colors and fix typo
l00p3 Jul 31, 2024
d289e53
Fix Palette and quantity size
tizianoGuadagnino Aug 1, 2024
4ae44c0
Fix license
tizianoGuadagnino Aug 1, 2024
64b1cc0
Color approved by Gupta
tizianoGuadagnino Aug 1, 2024
877f43f
Now everything is member of Kissualizer
l00p3 Aug 2, 2024
34b7e71
Trajectory as points, not anymore a curve
l00p3 Aug 2, 2024
14825d0
Screenshot name with timestamp
l00p3 Aug 2, 2024
07d42e6
Style fix
l00p3 Aug 2, 2024
c676763
Button names constants less ugly
l00p3 Aug 2, 2024
3db2af5
Now we have a dict to visualize parameters and co
l00p3 Aug 2, 2024
5e3688f
FPS computation not anymore in visualizer class
l00p3 Aug 2, 2024
58bf027
isort ti odio
l00p3 Aug 2, 2024
bdeb70e
Odometry info is now open by default
l00p3 Aug 2, 2024
492d296
Quit button on the right, why not
l00p3 Aug 2, 2024
257551d
Pose picking started
l00p3 Aug 2, 2024
285d744
Pose selection and visualization on the trajectory
l00p3 Aug 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Button name with keys and missing keys added
l00p3 committed Jul 31, 2024
commit fbdef7061f65d79f7480143b0d0b185e778af478
37 changes: 28 additions & 9 deletions python/kiss_icp/tools/visualizer.py
Original file line number Diff line number Diff line change
@@ -28,11 +28,24 @@

from kiss_icp.config.parser import KISSConfig

# Button names
START_BUTTON = " START\n[SPACE]"
PAUSE_BUTTON = " PAUSE\n[SPACE]"
NEXT_FRAME_BUTTON = "NEXT FRAME\n [N]"
SCREENSHOT_BUTTON = "SCREENSHOT\n [S]"
LOCAL_VIEW_BUTTON = "LOCAL VIEW\n [G]"
GLOBAL_VIEW_BUTTON = "GLOBAL VIEW\n [G]"
CENTER_VIEWPOINT_BUTTON = "CENTER VIEWPOINT\n [C]"
QUIT_BUTTON = "QUIT\n [Q]"

# Colors
BACKGROUND_COLOR = [0.8470, 0.8588, 0.8863]
l00p3 marked this conversation as resolved.
Show resolved Hide resolved
FRAME_COLOR = [0.2156, 0.2471, 0.3176]
KEYPOINTS_COLOR = [0.8588, 0.3294, 0.3803]
LOCAL_MAP_COLOR = [0.3451, 0.6431, 0.6902]
TRAJECTORY_COLOR = [0.1058, 0.1059, 0.1176]

# Size constants
FRAME_PTS_SIZE = 0.2
KEYPOINTS_PTS_SIZE = 0.3
MAP_PTS_SIZE = 0.1
@@ -47,23 +60,25 @@ def update(self, source, keypoints, target_map, pose, lest_time):


def start_pause_callback():
l00p3 marked this conversation as resolved.
Show resolved Hide resolved
button_name = "PAUSE" if Kissualizer.play_mode else "START"
button_name = PAUSE_BUTTON if Kissualizer.play_mode else START_BUTTON
if Kissualizer.polyscope.imgui.Button(button_name) or Kissualizer.polyscope.imgui.IsKeyPressed(
Kissualizer.polyscope.imgui.ImGuiKey_Space
):
Kissualizer.play_mode = not Kissualizer.play_mode


def next_frame_callback():
if Kissualizer.polyscope.imgui.Button("NEXT FRAME") or Kissualizer.polyscope.imgui.IsKeyPressed(
Kissualizer.polyscope.imgui.ImGuiKey_N
):
if Kissualizer.polyscope.imgui.Button(
NEXT_FRAME_BUTTON
) or Kissualizer.polyscope.imgui.IsKeyPressed(Kissualizer.polyscope.imgui.ImGuiKey_N):
Kissualizer.block_execution = not Kissualizer.block_execution


def screenshot_callback():
# TODO: this is just for demo, set a more valid path
if Kissualizer.polyscope.imgui.Button("SCREENSHOT"):
if Kissualizer.polyscope.imgui.Button(
SCREENSHOT_BUTTON
) or Kissualizer.polyscope.imgui.IsKeyPressed(Kissualizer.polyscope.imgui.ImGuiKey_S):
image_filename = "screenshot.jpg"
l00p3 marked this conversation as resolved.
Show resolved Hide resolved
Kissualizer.polyscope.screenshot(image_filename)
Kissualizer.polyscope.info(f"Screenshot save at: {image_filename}")
@@ -77,7 +92,9 @@ def fps_callback():


def center_viewpoint_callback():
if Kissualizer.polyscope.imgui.Button("CENTER VIEWPOINT"):
if Kissualizer.polyscope.imgui.Button(
CENTER_VIEWPOINT_BUTTON
) or Kissualizer.polyscope.imgui.IsKeyPressed(Kissualizer.polyscope.imgui.ImGuiKey_C):
Kissualizer.polyscope.reset_camera_to_home_view()


@@ -152,8 +169,10 @@ def unregister_trajectory():


def global_view_callback():
button_name = "LOCAL VIEW" if Kissualizer.global_view else "GLOBAL VIEW"
if Kissualizer.polyscope.imgui.Button(button_name):
button_name = LOCAL_VIEW_BUTTON if Kissualizer.global_view else GLOBAL_VIEW_BUTTON
if Kissualizer.polyscope.imgui.Button(button_name) or Kissualizer.polyscope.imgui.IsKeyPressed(
Kissualizer.polyscope.imgui.ImGuiKey_G
):
Kissualizer.global_view = not Kissualizer.global_view
if Kissualizer.global_view:
Kissualizer.polyscope.get_point_cloud("current_frame").set_transform(
@@ -186,7 +205,7 @@ def configuration_callback():

def quit_callback():
if (
Kissualizer.polyscope.imgui.Button("QUIT")
Kissualizer.polyscope.imgui.Button(QUIT_BUTTON)
or Kissualizer.polyscope.imgui.IsKeyPressed(Kissualizer.polyscope.imgui.ImGuiKey_Escape)
or Kissualizer.polyscope.imgui.IsKeyPressed(Kissualizer.polyscope.imgui.ImGuiKey_Q)
):