File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def test_imu_data(self):
2626 p_manager = subprocess .Popen ("./launch_openpilot.sh" , cwd = SIM_DIR )
2727 self .processes .append (p_manager )
2828
29- sm = messaging .SubMaster (['sensorEvents ' , 'selfdriveState' ])
29+ sm = messaging .SubMaster (['accelerometer' , 'gyroscope ' , 'selfdriveState' ])
3030 q = Queue ()
3131 bridge = self .create_bridge ()
3232 p_bridge = bridge .run (q , retries = 10 )
@@ -57,12 +57,10 @@ def test_imu_data(self):
5757 # run for 10 seconds and collect some imu data
5858 while time .monotonic () < start_time + 10 :
5959 sm .update ()
60- if sm .updated ['sensorEvents' ]:
61- for event in sm ['sensorEvents' ]:
62- if event .which == 'acceleration' :
63- accel_values .append (list (event .acceleration .v ))
64- elif event .which == 'gyro' :
65- gyro_values .append (list (event .gyro .v ))
60+ if sm .updated ['accelerometer' ]:
61+ accel_values .append (list (sm ['accelerometer' ].v ))
62+ if sm .updated ['gyroscope' ]:
63+ gyro_values .append (list (sm ['gyroscope' ].v ))
6664 time .sleep (0.1 )
6765
6866 assert len (accel_values ) > 10
You can’t perform that action at this time.
0 commit comments