Critical issue found in APM codebase


#1

Hello guys,

We have found a critical issue in ArduCopter codebase which might cause your drone to behave erratically if you send position_set API (with relative/body_frame flag enabled) or position_set_global API.

We have already raised an issue in their github repository and proposed a PR for the same.
They have accepted the issue, and will be solving it in due time.

I would update in this thread once that happens.
To solve the issue for now, you would have to build the Copter-3.5 branch with below suggested change:

  1. Clone ArduPilot’s official repository.

  2. Checkout branch Copter-3.5.

  3. Open this file.

  4. Change this line from

    if (!ahrs.get_relative_position_NED_home(local_position) ||

    to

    if (!ahrs.get_relative_position_NED_origin(local_position) ||

  5. Build the code following their build guidelines.

NOTE:

  • We have tested FlytOS with the above fix, and the behaviour of the drone is just fine.
  • The above change only transforms the local position data sent by ArduCopter via MAVLink/Telemetry.
  • This change will NOT change any critical drone functioning, and code flow of drone control via RC is completely untouched.
  • This change is NOT going to break any existing functionality of QGC/MissionPlanner.

#2