Simulator: fix controlsd mismatch (#29976)

fix controls mismatch
This commit is contained in:
Justin Newberry 2023-09-19 12:51:54 -07:00 committed by GitHub
parent d0a31515a0
commit bee40de703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -14,7 +14,7 @@ class SimulatedCar:
def __init__(self):
self.pm = messaging.PubMaster(['can', 'pandaStates'])
self.sm = messaging.SubMaster(['carControl', 'controlsState'])
self.sm = messaging.SubMaster(['carControl', 'controlsState', 'carParams'])
self.cp = self.get_car_can_parser()
self.idx = 0
@ -93,6 +93,7 @@ class SimulatedCar:
self.pm.send('can', can_list_to_can_capnp(msg))
def send_panda_state(self, simulator_state):
self.sm.update(0)
dat = messaging.new_message('pandaStates', 1)
dat.valid = True
dat.pandaStates[0] = {
@ -100,6 +101,7 @@ class SimulatedCar:
'pandaType': "blackPanda",
'controlsAllowed': True,
'safetyModel': 'hondaNidec',
'alternativeExperience': self.sm["carParams"].alternativeExperience
}
self.pm.send('pandaStates', dat)