Hi everyone,
I’m working on a companion computer application (Raspberry Pi + pymavlink) that controls an ArduCopter drone via MAVLink. One feature we need is orbiting around a defined GPS coordinate – not around the drone’s current position as CIRCLE mode currently does.
I left a comment on GitHub issue #15098 which has been open since 2020: Missing ArduPilot mavlink support to light up QGC features · Issue #15098 · ArduPilot/ardupilot · GitHub
Before diving into the implementation, I’ve already done some source code analysis and wanted to share what I found and ask for guidance.
What I found in the source:
AC_Circlealready has aninit()that accepts an explicitcentervector as parameter – the infrastructure for a defined center point already existsModeAutoalready hascircle_movetoedge_start()which takes an explicitLocationparameter – this is already used for mission waypoints- The missing piece seems to be purely on the MAVLink command handler side in
GCS_Mavlink.cpp
So my assumption is that MAV_CMD_DO_ORBIT could be implemented without major changes to the CIRCLE mode itself – mainly wiring up the MAVLink command to the existing circle_movetoedge_start() infrastructure, plus periodically sending ORBIT_EXECUTION_STATUS back to the GCS.
My questions:
- Is this analysis correct, or is there a reason the existing
circle_movetoedge_start()path can’t be reused forMAV_CMD_DO_ORBIT? - Is anyone already working on this?
- Would a PR be welcome? We’re willing to implement this properly with SITL tests and documentation.
Thanks in advance for any guidance!
Setup: ArduCopter 4.x, Pixhawk, Raspberry Pi companion computer, SITL on Ubuntu 22.04