I am trying to convert uorb topic “vehicle_odometry” into “nav_msgs/msg/odometry” in order to make transformation of the robot and feed the /odom ros topic to the slam_toolbox.
I found that “vehicle_odometry” is using NED (North, East, Down) for localization and (Forward, Right, Down) for FRD body frame standard.
However, “nav_msgs/msg/odometry” is using ENU (East, North, Up) for localization and (Forward, Left, Up) for body standard.
It makes the convertion complicated, especially for the conversion of
quaternion rotation.
In mavlink, it said the quaternion rotation of “vehicle_odometry” is x, y, z and w.
For “nav_msgs/msg/odometry”, quaternion is “orientation x”, “orientation y”, “orientation z” and w (rotation).
However, the meaning of orientation y and z are difference between 2 messages. Even I can make y and z negative to do the conversion, I think it will still fail because the w (rotation) will change if the definition of “orientation y” and “orientation z” are different. and I have no idea how to make a correct w (rotation) by mysefl according to the orientation x, y and z I have.
Did someone get the “nav_msgs/msg/odometry” message from pixhawk before? How can we publish a correct “nav_msgs/msg/odometry” messages using the data provided by pixhawk?
I am using holybro pixhawk 6c and subscribe to the uorb topic using micrortps and ros2 on the jetson Xavier NX.
All I need is only to publish /tf and /odom for slam_toolbox.