41 std::vector<float> offset(3, 0.0);
47 if (getProperty<bool>(
"EnableSimpleCalibration").getValue())
49 ARMARX_WARNING <<
"Estimation of the offset for the IMU, please do not move the IMU";
51 !sensorTask->isStopped())
54 while (HasPendingEvents())
56 ProcessPendingEvent();
58 offset[0] += m_GyroscopeRotation[0];
59 offset[1] += m_GyroscopeRotation[1];
60 offset[2] += m_GyroscopeRotation[2];
72 while (!sensorTask->isStopped())
75 while (HasPendingEvents())
78 ProcessPendingEvent();
83 data.acceleration.push_back(m_Accelaration[0]);
84 data.acceleration.push_back(m_Accelaration[1]);
85 data.acceleration.push_back(m_Accelaration[2]);
87 data.gyroscopeRotation.push_back(m_GyroscopeRotation[0] - offset[0]);
88 data.gyroscopeRotation.push_back(m_GyroscopeRotation[1] - offset[1]);
89 data.gyroscopeRotation.push_back(m_GyroscopeRotation[2] - offset[2]);
92 data.magneticRotation.push_back(m_MagneticRotation[0]);
93 data.magneticRotation.push_back(m_MagneticRotation[1]);
94 data.magneticRotation.push_back(m_MagneticRotation[2]);
97 data.orientationQuaternion.push_back(m_OrientationQuaternion[0]);
98 data.orientationQuaternion.push_back(m_OrientationQuaternion[1]);
99 data.orientationQuaternion.push_back(m_OrientationQuaternion[2]);
100 data.orientationQuaternion.push_back(m_OrientationQuaternion[3]);
102 IMUTopicPrx->reportSensorValues(
"XsensIMU",
"XsensIMU",
data, now);
146 SetMaximalPendingEvents(5);
149 IMUDevice.RegisterEventDispatcher(
this);
158 IMUDevice.Start(
false);