mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-10-01 03:43:51 +08:00
+8
-2
@@ -212,9 +212,15 @@ static void update_sockets(UIState *s) {
|
|||||||
if (sensor.which() == cereal::SensorEventData::LIGHT) {
|
if (sensor.which() == cereal::SensorEventData::LIGHT) {
|
||||||
scene.light_sensor = sensor.getLight();
|
scene.light_sensor = sensor.getLight();
|
||||||
} else if (!scene.started && sensor.which() == cereal::SensorEventData::ACCELERATION) {
|
} else if (!scene.started && sensor.which() == cereal::SensorEventData::ACCELERATION) {
|
||||||
scene.accel_sensor = sensor.getAcceleration().getV()[2];
|
auto accel = sensor.getAcceleration().getV();
|
||||||
|
if (accel.totalSize().wordCount){ // TODO: sometimes empty lists are received. Figure out why
|
||||||
|
scene.accel_sensor = accel[2];
|
||||||
|
}
|
||||||
} else if (!scene.started && sensor.which() == cereal::SensorEventData::GYRO_UNCALIBRATED) {
|
} else if (!scene.started && sensor.which() == cereal::SensorEventData::GYRO_UNCALIBRATED) {
|
||||||
scene.gyro_sensor = sensor.getGyroUncalibrated().getV()[1];
|
auto gyro = sensor.getGyroUncalibrated().getV();
|
||||||
|
if (gyro.totalSize().wordCount){
|
||||||
|
scene.gyro_sensor = gyro[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user