We found out that in a counter-intuitive way, the default orientation obtained from gz-sim IMU sensors and exported from the imu plugin via its yarp::dev::IOrientationSensors YARP interface is not ${}^{W} R _\texttt{Sensor}$ (the orientation of the sensor frame wrt to World frame) but instead is ${}^\texttt{SensorInitialOrientation} R _\texttt{Sensor}$.
This is not the default behavior users expect. We are trying to understand how to change this default behavior, but first of all, we wanted to warn gz-sim-yarp-plugin users.
This issue was also present in gazebo-classic but the orientation streamed by the gazebo-yarp-plugin was fixed in robotology/gazebo-yarp-plugins#639.
One possible way to update the reference frame used by the Imu is using the SDF element orientation_reference_frame http://sdformat.org/spec?ver=1.12&elem=sensor#imu_orientation_reference_frame and set it like this:
<sensor name="chest_imu" type="imu">
<...>
<imu>
<orientation_reference_frame>
<localization>CUSTOM</localization>
<custom_rpy parent_frame="world">0 0 0</custom_rpy>
</orientation_reference_frame>
</imu>
<...>
</sensor>
CC @traversaro @LoreMoretti @isorrentino @PasMarra @Nicogene
We found out that in a counter-intuitive way, the default orientation obtained from${}^{W} R _\texttt{Sensor}$ (the orientation of the sensor frame wrt to World frame) but instead is ${}^\texttt{SensorInitialOrientation} R _\texttt{Sensor}$ .
gz-simIMU sensors and exported from the imu plugin via its yarp::dev::IOrientationSensors YARP interface is notThis is not the default behavior users expect. We are trying to understand how to change this default behavior, but first of all, we wanted to warn
gz-sim-yarp-pluginusers.This issue was also present in
gazebo-classicbut the orientation streamed by thegazebo-yarp-pluginwas fixed in robotology/gazebo-yarp-plugins#639.One possible way to update the reference frame used by the Imu is using the SDF element
orientation_reference_framehttp://sdformat.org/spec?ver=1.12&elem=sensor#imu_orientation_reference_frame and set it like this:CC @traversaro @LoreMoretti @isorrentino @PasMarra @Nicogene