mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-15 11:11:36 +08:00
mavlink odometry: properly set the frame id fields
This commit is contained in:
@@ -2548,13 +2548,23 @@ protected:
|
||||
|
||||
if (_mavlink->odometry_loopback_enabled()) {
|
||||
odom_updated = _vodom_sub.update(&odom);
|
||||
msg.frame_id = MAV_FRAME_LOCAL_NED;
|
||||
|
||||
// set the frame_id according to the local frame of the data
|
||||
if (odom.local_frame == vehicle_odometry_s::LOCAL_FRAME_NED) {
|
||||
msg.frame_id = MAV_FRAME_LOCAL_NED;
|
||||
|
||||
} else {
|
||||
msg.frame_id = MAV_FRAME_LOCAL_FRD;
|
||||
}
|
||||
|
||||
// source: external vision system
|
||||
msg.estimator_type = MAV_ESTIMATOR_TYPE_VISION;
|
||||
|
||||
} else {
|
||||
odom_updated = _odom_sub.update(&odom);
|
||||
|
||||
msg.frame_id = MAV_FRAME_LOCAL_NED;
|
||||
|
||||
// source: PX4 estimator
|
||||
msg.estimator_type = MAV_ESTIMATOR_TYPE_AUTOPILOT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user