40 usingTopic(getProperty<std::string>(
"IMUTopicName").getValue());
47 if (getProperty<bool>(
"EnableVisualization").getValue())
49 offeringTopic(getProperty<std::string>(
"DebugDrawerTopic").getValue());
56 if (getProperty<bool>(
"EnableVisualization").getValue())
58 debugDrawerPrx = getTopic<DebugDrawerInterfacePrx>(
59 getProperty<std::string>(
"DebugDrawerTopic").getValue());
66 if (getProperty<bool>(
"EnableVisualization").getValue())
68 debugDrawerPrx->removePoseVisu(
"IMU",
"orientation");
69 debugDrawerPrx->removeLineVisu(
"IMU",
"acceleration");
75 const std::string& name,
77 const TimestampBasePtr& timestamp,
80 std::unique_lock lock(dataMutex);
93 if (
values.acceleration.size() > 0)
98 offerValue(device,
"acceleration", acceleration);
100 if (
values.gyroscopeRotation.size() > 0)
104 values.gyroscopeRotation.at(1),
105 values.gyroscopeRotation.at(2));
106 offerValue(device,
"gyroscopeRotation", gyroscopeRotation);
108 if (
values.magneticRotation.size() > 0)
112 values.magneticRotation.at(1),
113 values.magneticRotation.at(2));
114 offerValue(device,
"magneticRotation", magneticRotation);
116 if (
values.orientationQuaternion.size() > 0)
120 values.orientationQuaternion.at(1),
121 values.orientationQuaternion.at(2),
122 values.orientationQuaternion.at(3));
124 "orientationQuaternion",
125 orientationQuaternion,
126 "orientation quaternion values");
133 if (orientationQuaternion && acceleration &&
134 getProperty<bool>(
"EnableVisualization").getValue())
136 Eigen::Vector3f zero;
145 Eigen::Vector3f ac = acceleration->toEigen();
148 debugDrawerPrx->setLineVisu(
149 "IMU",
"acceleration",
new Vector3(),
new Vector3(ac), 2.0f, color);
151 PosePtr posePtr =
new Pose(orientationQuaternion->toEigen(), zero);
152 debugDrawerPrx->setPoseVisu(
"IMU",
"orientation", posePtr);
158 InertialMeasurementUnitObserver::offerValue(
const std::string& device,
159 const std::string& fieldName,