PX4 / flight_review

web application for flight log analysis & review
https://logs.px4.io/
BSD 3-Clause "New" or "Revised" License
202 stars 195 forks source link

Altitude setpoint plot is wrong in OFFBOARD mode #104

Open anassinator opened 6 years ago

anassinator commented 6 years ago

To preface, I'm not sure if this should be a Firmware or flight_review issue or both.

Problem

As it stands, in OFFBOARD mode, sending a SET_POSITION_TARGET_LOCAL_NED with a valid altitude (i.e. z coordinate), only the setpoint_triplet.current.z is set, and setpoint_triplet.current.alt remains 0 (relevant lines). This means that the altitude plot in OFFBOARD mode shows all setpoints to be at 0 altitude despite in reality possibly being something else.

Example Log

Log

Problematic plot

Problematic plot

Expected plot

Expected plot

Possible fixes

I see 2 potential fixes, but not sure either are good.

  1. Change the Firmware to set setpoint_triplet.current.alt when setting setpoint_triplet.current.z in OFFBOARD mode. This means logs taken with older firmware will still show the wrong plot though.
  2. Fallback to setpoint_triplet.current.z when setpoint_triplet.current.alt = 0 (and maybe only while in OFFBOARD mode) in flight_review.
MaEtUgR commented 6 years ago

@anassinator I think offboard should produce log data compatible to other modes from the Firmware side. Offboard mode is currently under improvement. For better modularization of the different setpoint sources there's now a flight task architecture: https://github.com/PX4/Firmware/pull/8933 and @Stifael is currently working on the task for offboard mode. Chances are he's already aware of that inconsistency (or else he'll read this).

anassinator commented 6 years ago

Perfect thanks!