Make sure that ICM20948 is only updated once per loop when needed
This commit is contained in:
@@ -138,13 +138,17 @@ class IMU : public SensorBase<IMUAnglesMsg> {
|
||||
return false;
|
||||
#endif
|
||||
#if FT_ENABLED(USE_ICM20948)
|
||||
|
||||
#ifndef ICM20948_GET_AGMT_UPDATED_ONCE_PER_LOOP
|
||||
#define ICM20948_GET_AGMT_UPDATED_ONCE_PER_LOOP
|
||||
if (_imu->dataReady())
|
||||
{
|
||||
{
|
||||
_imu->getAGMT();
|
||||
_msg.rpy[0] = _imu->gyrX();
|
||||
_msg.rpy[1] = _imu->gyrY();
|
||||
_msg.rpy[2] = _imu->gyrZ();
|
||||
}
|
||||
#endif
|
||||
_msg.rpy[0] = _imu->accX();
|
||||
_msg.rpy[1] = _imu->accY();
|
||||
_msg.rpy[2] = _imu->accZ();
|
||||
#endif
|
||||
#if FT_ENABLED(USE_BNO055)
|
||||
sensors_event_t event;
|
||||
|
||||
Reference in New Issue
Block a user