Skip to content

Orientation from IMU plugin not working as expected #272

@xela-95

Description

@xela-95

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions