Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bongbui321 committed May 22, 2024
1 parent 5ba473e commit dfc14ec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/sim/bridge/metadrive/metadrive_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def read_sensors(self, state: SimulatorState):
is_engaged = state.is_engaged
if is_engaged and self.first_engage is None:
self.first_engage = time.monotonic()
not_moving_after_engaged = is_engaged and time.monotonic() - self.first_engage >= 5 and self.test_run # check moving 5 seconds after engaged
not_moving_after_engaged = is_engaged and time.monotonic() - self.first_engage >= 5 and self.test_run # check moving 5 seconds after engaged, doesn't move right away

x_dist = abs(curr_pos[0] - self.vehicle_last_pos[0])
y_dist = abs(curr_pos[1] - self.vehicle_last_pos[1])
Expand All @@ -109,7 +109,6 @@ def read_sensors(self, state: SimulatorState):
self.status_q.put(QueueMessage(QueueMessageType.TERMINATION_INFO, {"vehicle_not_moving" : True}))
self.exit_event.set()

# update every <time_check_threshold> seconds
if since_last_check >= time_check_threshold:
self.last_check_timestamp = current_time
self.distance_moved = 0
Expand Down

0 comments on commit dfc14ec

Please sign in to comment.