External Vision & Estimator Velocity Mismatch

Nihao guys,

PX4 version: 1.14.2
EKF2_EV_CTRL: 9 (Horizontal + Yaw)
Log URL: https://review.px4.io/plot_app?log=0162163c-9f74-47aa-bf94-c63f24da29c1

I am currently working on VIO outdoor autonomous flight under mission mode via External Vision. I specifically published nav_msgs/Odometry message to mavros/odometry/out.

I assumed the coordinate system in MAVROS should all be in ENU convention, thus I further confirmed the coordination system of my VIO algorithm is in ENU convention and is also aligned with world frame since I had written a static transform to handle the transformation between {map} frame of MAVROS to {global} frame of visual algorithm. Below is my tf tree.

And here are my uORB topics. You can see the value between visual odometry and estimator are almost aligned but with an exact sign difference. I feel like this issue is not related to ENU to NED transformation. Please feel free to tell me what is the root cause of this problem.

Thanks for reading my question.

Best,
PH Lai

@bresch may you help me take a look? Thanks!

@Jaeyoung-Lim Maybe you can help me on this? I’s be grateful. Thanks in advance.

I assume your xyz and rpy are already aligned since you’re not showing them. Are you aware of the velocity_frame on the UORB topic VehicleOdometry (which I assume this is converted to internally)?

There is both a pose_frame and velocity_frame on VehicleOdometry, while it seems like there is only a child_frame_id on the nav_msgs/Odometry?

I assume there is similar conversion logic in the ROS case like for mavlink: src/modules/mavlink/mavlink_receiver.cpp#L1349 it might be worth looking into:)

I’m not familiar with MAVROS, but it seems to me like you can follow the enums from mavros/mavros_extras/src/plugins/odom.cpp at b85baa6d057cf7092cd26b3bd777d1e01258b08b · mavlink/mavros · GitHub to PX4-Autopilot/src/modules/mavlink/mavlink_receiver.cpp at e3f05f1bbe484d1c96c23dcf6f1a08f2037fbc2e · PX4/PX4-Autopilot · GitHub to figure out how your velocities are being transformed.