40 std::vector<float> offset(3, 0.0);
46 if (getProperty<bool>(
"EnableSimpleCalibration").getValue())
48 ARMARX_WARNING <<
"Estimation of the offset for the IMU, please do not move the IMU";
52 while (HasPendingEvents())
54 ProcessPendingEvent();
56 offset[0] += m_GyroscopeRotation[0];
57 offset[1] += m_GyroscopeRotation[1];
58 offset[2] += m_GyroscopeRotation[2];
71 while (!sensorTask->isStopped())
74 while (HasPendingEvents())
77 ProcessPendingEvent();
82 data.acceleration.push_back(m_Accelaration[0]);
83 data.acceleration.push_back(m_Accelaration[1]);
84 data.acceleration.push_back(m_Accelaration[2]);
86 data.gyroscopeRotation.push_back(m_GyroscopeRotation[0] - offset[0]);
87 data.gyroscopeRotation.push_back(m_GyroscopeRotation[1] - offset[1]);
88 data.gyroscopeRotation.push_back(m_GyroscopeRotation[2] - offset[2]);
91 data.magneticRotation.push_back(m_MagneticRotation[0]);
92 data.magneticRotation.push_back(m_MagneticRotation[1]);
93 data.magneticRotation.push_back(m_MagneticRotation[2]);
96 data.orientationQuaternion.push_back(m_OrientationQuaternion[0]);
97 data.orientationQuaternion.push_back(m_OrientationQuaternion[1]);
98 data.orientationQuaternion.push_back(m_OrientationQuaternion[2]);
99 data.orientationQuaternion.push_back(m_OrientationQuaternion[3]);
101 IMUTopicPrx->reportSensorValues(
"XsensIMU",
"XsensIMU",
data, now);
146 SetMaximalPendingEvents(5);
149 IMUDevice.RegisterEventDispatcher(
this);
156 IMUDevice.Start(
false);