simulator: set valid flags (#30656)

sim set valid
old-commit-hash: bb9dda9764
chrysler-long2
Justin Newberry 1 year ago committed by GitHub
parent 2b98a08180
commit 8c21642780
  1. 2
      tools/sim/lib/camerad.py
  2. 8
      tools/sim/lib/simulated_sensors.py

@ -59,7 +59,7 @@ class Camerad:
eof = int(frame_id * 0.05 * 1e9)
self.vipc_server.send(yuv_type, yuv, frame_id, eof, eof)
dat = messaging.new_message(pub_type)
dat = messaging.new_message(pub_type, valid=True)
msg = {
"frameId": frame_id,
"transform": [1.0, 0.0, 0.0,

@ -23,7 +23,7 @@ class SimulatedSensors:
def send_imu_message(self, simulator_state: 'SimulatorState'):
for _ in range(5):
dat = messaging.new_message('accelerometer')
dat = messaging.new_message('accelerometer', valid=True)
dat.accelerometer.sensor = 4
dat.accelerometer.type = 0x10
dat.accelerometer.timestamp = dat.logMonoTime # TODO: use the IMU timestamp
@ -32,7 +32,7 @@ class SimulatedSensors:
self.pm.send('accelerometer', dat)
# copied these numbers from locationd
dat = messaging.new_message('gyroscope')
dat = messaging.new_message('gyroscope', valid=True)
dat.gyroscope.sensor = 5
dat.gyroscope.type = 0x10
dat.gyroscope.timestamp = dat.logMonoTime # TODO: use the IMU timestamp
@ -53,7 +53,7 @@ class SimulatedSensors:
]
for _ in range(10):
dat = messaging.new_message('gpsLocationExternal')
dat = messaging.new_message('gpsLocationExternal', valid=True)
dat.gpsLocationExternal = {
"unixTimestampMillis": int(time.time() * 1000),
"flags": 1, # valid fix
@ -94,7 +94,7 @@ class SimulatedSensors:
self.pm.send('driverStateV2', dat)
# dmonitoringd output
dat = messaging.new_message('driverMonitoringState')
dat = messaging.new_message('driverMonitoringState', valid=True)
dat.driverMonitoringState = {
"faceDetected": True,
"isDistracted": False,

Loading…
Cancel
Save