Skip to content

Commit

Permalink
Sensor events splitup (commaai#357)
Browse files Browse the repository at this point in the history
* change from sensorEvents to separated events

* fix numbering

* remove sensorEvent

* update after rebase

* .

* move bmx gyro and accel to its own channels

* address PR comments

* .

* inc frequency in tests

* .

* rename sensorEventsDEPRECATED sensorEvents

* readd sensorEvents in services.py

* .

Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>
  • Loading branch information
gast04 and Kurt Nistelberger authored Sep 27, 2022
1 parent a0c6f28 commit e310f48
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions log.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,13 @@ struct Event {
can @5 :List(CanData);
controlsState @7 :ControlsState;
sensorEvents @11 :List(SensorEventData);
gyroscope @99 :SensorEventData;
gyroscope2 @100 :SensorEventData;
accelerometer @98 :SensorEventData;
accelerometer2 @101 :SensorEventData;
magnetometer @95 :SensorEventData;
lightSensor @96 :SensorEventData;
temperatureSensor @97 :SensorEventData;
pandaStates @81 :List(PandaState);
peripheralState @80 :PeripheralState;
radarState @13 :RadarState;
Expand Down
2 changes: 1 addition & 1 deletion messaging/tests/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_services(self, s):
service = service_list[s]
self.assertTrue(service.port != RESERVED_PORT)
self.assertTrue(service.port >= STARTING_PORT)
self.assertTrue(service.frequency <= 100)
self.assertTrue(service.frequency <= 104)

def test_no_duplicate_port(self):
ports = {}
Expand Down
7 changes: 7 additions & 0 deletions services.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ def __init__(self, port: int, should_log: bool, frequency: float, decimation: Op
# service: (should_log, frequency, qlog decimation (optional))
# note: the "EncodeIdx" packets will still be in the log
"sensorEvents": (True, 100., 100),
"gyroscope": (True, 104., 104),
"gyroscope2": (True, 100., 100),
"accelerometer": (True, 104., 104),
"accelerometer2": (True, 100., 100),
"magnetometer": (True, 100., 100),
"lightSensor": (True, 100., 100),
"temperatureSensor": (True, 100., 100),
"gpsNMEA": (True, 9.),
"deviceState": (True, 2., 1),
"can": (True, 100.),
Expand Down

0 comments on commit e310f48

Please sign in to comment.