File tree 1 file changed +5
-6
lines changed
simulator/carla_autoware/src/carla_autoware
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,7 @@ def __init__(self):
60
60
self .world = None
61
61
self .sensor_wrapper = None
62
62
self .ego_vehicle = None
63
- self .timestamp_last_run = 0.0
64
- self .delta_step = 0.0
63
+ self .prev_tick_wall_time = 0.0
65
64
66
65
# Parameter for Initializing Carla World
67
66
self .local_host = self .param_ ["host" ]
@@ -167,11 +166,11 @@ def run_bridge(self):
167
166
if snapshot :
168
167
timestamp = snapshot .timestamp
169
168
if timestamp :
170
- self . delta_step = timestamp . elapsed_seconds - self .timestamp_last_run
171
- if self . delta_step < self .max_real_delta_seconds :
169
+ delta_step = time . time () - self .prev_tick_wall_time
170
+ if delta_step <= self .max_real_delta_seconds :
172
171
# Add a wait to match the max_real_delta_seconds
173
- time .sleep (self .max_real_delta_seconds - self . delta_step )
174
- self .timestamp_last_run = timestamp . elapsed_seconds
172
+ time .sleep (self .max_real_delta_seconds - delta_step )
173
+ self .prev_tick_wall_time = time . time ()
175
174
self .bridge_loop ._tick_sensor (timestamp )
176
175
177
176
def _stop_loop (self , signum , frame ):
You can’t perform that action at this time.
0 commit comments