Fix calling of IMU/MAG data when no new data available

This commit is contained in:
Niklas Jensen
2025-12-26 22:52:06 +01:00
parent 32966a3430
commit 90f561a62b
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -86,8 +86,10 @@ class IMU : public SensorBase<IMUAnglesMsg> {
#ifndef ICM20948_GET_AGMT_UPDATED_ONCE_PER_LOOP
#define ICM20948_GET_AGMT_UPDATED_ONCE_PER_LOOP
if (_imu->dataReady())
{
{
_imu->getAGMT();
} else {
return false;
}
#endif
_msg.rpy[0] = _imu->accX();
+2
View File
@@ -48,6 +48,8 @@ class Magnetometer : public SensorBase<MagnetometerMsg> {
if (_imu->dataReady())
{
_imu->getAGMT();
} else {
return false;
}
#endif
_msg.rpy[0] = _mag->magX();