Starling 2 Inverted Yaw and Pitch
-
We are running qvio on the Starling 2 Platform (through voxl_map_to_ros.launch) and had a quick question:
When visualizing the qvio/pose topics in rviz, we can see the pitch and yaw is inverted. I decided to look at the raw Unix pipe data for qvio (through voxl-inspect-qvio) and it seems to be identical to the messages being published on that rostopic. My theory is that, because the body frame of the Starling 2 has its Z-axis pointing downward and ROS assumes its Z axis to point upward, we are seeing this behavior.
Our idea is to just modify our state estimation node to transform the pose data from qvio by adjusting the roll by 180 degrees. Before doing so, I wanted to check if there is any existing infrastructure to aid with this?
Inverted Pose Video -
Yes, everything in the aerospace industry including PX4 and ardupilot use the standard NED coordinate frame with Z pointing down. A significant portion of the code in MAVROS seems to be flipping the direction of the Y and Z axis back and forth when converting from mavlink to ros topics.
I suggest using the vvhub_body_wrt_local pipe instead of the qvio pipe as the qvio data is centered around the imu whereas voxl-vision-hub transforms this to be centered around the body (COG) and corrects for gravity alignment.
You can inspect the local pose on VOXL natively with
voxl-inspect-pose vvhub_body_wrt_local
OR
voxl-inspect-pose --localNote this pipe was called vvpx4_body_wrt_local in SDK0.9 and older.
I don't think ROS libraries like TF2 care which way gravity points. A transform is a transform, you can have it oriented however you prefer when you do your math. You should only need to change coordinate frames for the sake of visualization if RVIS doesn't let you define a default orientation or rotate the ground plane around in the UI.