Simulator: wait for engageable (#30105)

wait for engageable
old-commit-hash: 5c2cbec06e
testing-closet
Justin Newberry 2 years ago committed by GitHub
parent 8dcd04e702
commit 3cd9856fcc
  1. 5
      tools/sim/bridge/common.py

@ -147,7 +147,8 @@ Ignition: {self.simulator_state.ignition} Engaged: {self.simulator_state.is_enga
self.simulated_sensors.update(self.simulator_state, self.world)
self.simulated_car.sm.update(0)
self.simulator_state.is_engaged = self.simulated_car.sm['controlsState'].active
controlsState = self.simulated_car.sm['controlsState']
self.simulator_state.is_engaged = controlsState.active
if self.simulator_state.is_engaged:
throttle_op = clip(self.simulated_car.sm['carControl'].actuators.accel / 1.6, 0.0, 1.0)
@ -155,7 +156,7 @@ Ignition: {self.simulator_state.ignition} Engaged: {self.simulator_state.is_enga
steer_op = self.simulated_car.sm['carControl'].actuators.steeringAngleDeg
self.past_startup_engaged = True
elif not self.past_startup_engaged:
elif not self.past_startup_engaged and controlsState.engageable:
self.simulator_state.cruise_button = CruiseButtons.DECEL_SET # force engagement on startup
throttle_out = throttle_op if self.simulator_state.is_engaged else throttle_manual

Loading…
Cancel
Save