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:
Clone ArduPilot’s official repository.
Checkout branch Copter-3.5.
Open this file.
Change this line from
if (!ahrs.get_relative_position_NED_home(local_position) ||
if (!ahrs.get_relative_position_NED_origin(local_position) ||
Build the code following their build guidelines.
- 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.