mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 04:03:35 +08:00
mavlink local_position_ned: always publish on update, not just when xy and v_xy valid
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Daniel Agar
parent
ce609144b0
commit
9159f020cb
@@ -62,21 +62,20 @@ private:
|
||||
vehicle_local_position_s lpos;
|
||||
|
||||
if (_lpos_sub.update(&lpos)) {
|
||||
if (lpos.xy_valid && lpos.v_xy_valid) {
|
||||
mavlink_local_position_ned_t msg{};
|
||||
mavlink_local_position_ned_t msg{};
|
||||
|
||||
msg.time_boot_ms = lpos.timestamp / 1000;
|
||||
msg.x = lpos.x;
|
||||
msg.y = lpos.y;
|
||||
msg.z = lpos.z;
|
||||
msg.vx = lpos.vx;
|
||||
msg.vy = lpos.vy;
|
||||
msg.vz = lpos.vz;
|
||||
msg.time_boot_ms = lpos.timestamp / 1000;
|
||||
msg.x = lpos.x;
|
||||
msg.y = lpos.y;
|
||||
msg.z = lpos.z;
|
||||
msg.vx = lpos.vx;
|
||||
msg.vy = lpos.vy;
|
||||
msg.vz = lpos.vz;
|
||||
|
||||
mavlink_msg_local_position_ned_send_struct(_mavlink->get_channel(), &msg);
|
||||
mavlink_msg_local_position_ned_send_struct(_mavlink->get_channel(), &msg);
|
||||
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user