Skip to content

Commit

Permalink
Make Cosmetics guy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
l00p3 committed Aug 15, 2024
1 parent 7f0bb76 commit faa511b
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/lidar_visualizer/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, dataset, random_accessible_dataset: bool, n_scans: int = -1,
self._frame_size = 0.5 * FRAME_PTS_SIZE_N_STEPS * self._frame_size_step
self._play_mode = False
self._toggle_frame = True
self._speed_level = 5
self._playback_delay = 0.0

# Initialize dataset and fix input based on its nature
self._dataset = dataset
Expand All @@ -83,7 +83,7 @@ def run(self):
def update(self):
self._update_visualized_frame()
while True:
time.sleep(self._compute_speed())
time.sleep(self._playback_delay)
self._ps.frame_tick()
if self._play_mode and not self.end_reached:
break
Expand Down Expand Up @@ -137,9 +137,6 @@ def _register_frame(self, points, colors):
frame_cloud.set_radius(self._frame_size, relative=False)
frame_cloud.set_enabled(self._toggle_frame)

def _compute_speed(self):
return 0.1 - 0.02 * self._speed_level

# GUI Callbacks ---------------------------------------------------------------------------
def _main_gui_callback(self):
self._gui.TextUnformatted("Controls:")
Expand All @@ -153,7 +150,7 @@ def _main_gui_callback(self):
self._previous_frame_callback()
self._gui.Separator()
self._progress_bar_callback()
self._speed_level_callback()
self._playback_delay_callback()
self._gui.Separator()
self._gui.TextUnformatted("Scene Options:")
self._background_color_callback()
Expand Down Expand Up @@ -193,13 +190,13 @@ def _progress_bar_callback(self):
self.idx = idx
self._update_visualized_frame()

def _speed_level_callback(self):
_, self._speed_level = self._gui.SliderInt(
"\tPlayback Speed",
self._speed_level,
v_min=0,
v_max=5,
format="%d",
def _playback_delay_callback(self):
_, self._playback_delay = self._gui.SliderFloat(
"\tPlayback Delay",
self._playback_delay,
v_min=0.0,
v_max=0.1,
format="%.2f s",
)

def _points_controlles_callback(self):
Expand Down

0 comments on commit faa511b

Please sign in to comment.