Say I would like to handle a mavlink command that requires long
computational / IO time, also I only know if the command succeeded after the
long computation / IO.
I’m also interested in answers to such questions; in particular, things
like formatting SD cards or even the arming sequence can require
I suppose the first step is to return MAV_RESULT_IN_PROGRESS and then invoke
my custom handle_msg() from GCS_Mavlink.
We don’t even have that in our common.xml yet
Any idea how that’s all supposed to work? When you attempt the command it
returns an in-progress and if you repeat the command it returns you a new
percentage? How about if a command isn’t idempotent? Do you volunteer a
mav-result-accepted when you’ve completed the task? What happens if
you’ve just finished the task and the user tries to poll the progress - do
you start it again immediately?
Where do I put and invoke the computationally / IO intensive code?
(obviously it can¢t be in handle_msg since it would block the entire message
That depends on what you’re trying to do. It might deserve its own
thread, or it might want to work like several of our libraries with a
::update() which does some of the work and then returns.
How do I follow up with the correct MAV_RESULT (ACCEPTED / FAILED)?
Those are all interesting questions. Maybe there’s some documentation
around somewhere about how in-progress is supposed to work…