Deprecate controlsState state fields (#33437)

* Deprecate controlsState state fields

* sim works

* update refs

* one more

* these too

* update sim
old-commit-hash: 3924ac587b735d1e735af4cb77faf6ccf053f656
This commit is contained in:
Adeeb Shihadeh
2024-09-03 14:40:23 -07:00
committed by GitHub
parent 53288d4dbf
commit bd2b09c7b6
18 changed files with 60 additions and 74 deletions
+2 -3
View File
@@ -167,8 +167,7 @@ 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)
controlsState = self.simulated_car.sm['controlsState']
self.simulator_state.is_engaged = controlsState.active
self.simulator_state.is_engaged = self.simulated_car.sm['selfdriveState'].active
if self.simulator_state.is_engaged:
throttle_op = clip(self.simulated_car.sm['carControl'].actuators.accel / 1.6, 0.0, 1.0)
@@ -176,7 +175,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 and controlsState.engageable:
elif not self.past_startup_engaged and self.simulated_car.sm['selfdriveState'].engageable:
self.simulator_state.cruise_button = CruiseButtons.DECEL_SET if self.startup_button_prev else CruiseButtons.MAIN # force engagement on startup
self.startup_button_prev = not self.startup_button_prev