Skip to content

incorrect orientation when tf_ned_to_enu=false #19

@FletcherFT

Description

@FletcherFT

Related to #13 , from what I can tell from main.cpp, the tf_ned_to_enu parameter is meant to output the orientation of the um7 in an ENU configuration for ROS, which I think was fixed by the OP in #13 . This issue is for when tf_ned_to_enu=false, the orientation, angular velocities and accelerations should be referenced to the um7's axes (which is in a NED configuration when the um7 is placed sticker side up).

While visualising the um7 orientation in RVIZ by running a simple tf2_ros broadcaster node between "odom" and "imu_link" frames and a tf2 static_transform_broadcaster node publishing "imu_link"->"imu_link_ned" transform, I found that rotating the um7 about its axes would produce incorrect NED rotations in rviz.

Setup

static_tf_broadcaster (converts from NED to ENU
rosrun tf2_ros static_transform_publisher 0 0 0 0.70710678118 0.70710678118 0 0 imu_link imu_link_ned
tf broadcast node (broadcasts odom->imu_link)
imu_transform_broadcaster.py.zip

rviz visualiation
imu_rviz.rviz.zip

Let me know if I've messed up the tf in static_tf_broadcaster or in the broadcast node, but I'm pretty sure it's the right conversion.

The tf in main.cpp that works for this configuration (line 238 - 241) is:

imu_msg.orientation.w = r.quat.get_scaled(0);
imu_msg.orientation.x = r.quat.get_scaled(2);
imu_msg.orientation.y = r.quat.get_scaled(1);
imu_msg.orientation.z = -r.quat.get_scaled(3);

First time I've really spent playing around with quaternions and tfs, but from my perspective the changes from #13 and this one makes sure that the um7 is conforming to REP145.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions