There is a problem with follow-me with DroidPlanner (haven't tested with AndroPilot), that the user cannot switch off from follow-me via the RC controller. It's somewhat related to #619.
The Problem
This is what's happening:
- when in follow-me the GCS is constantly sending GUIDED waypoints to the drone, at a high rate (more than 1Hz).
- If the GCS sees a mode change (to something different than GUIDED), it will switch off follow-me
- Mode changes are detected by the heartbeat packet
So when in follow me the guided point's force a mode override at a very fast rate. When the user changes the mode via RC it takes until the next heartbeat for the GCS to detect the change. At which point the drone most certainly has already switched back to GUIDED, which makes the next heartbeat to say it`s on GUIDED. This makes the GCS totally unaware of the mode change.
The only way out of this is if Follow-me is switched off on the GCS, sdo mode changes can be correctly detected.
The solution
A possible solution was proposed on #65, but it was refused (and it's outdated now). But the main idea is to have two kinds of Guided Waypoints:
- One that works as it is now, forcing a change to guided and setting the guided coord.
- And other that only updates the guided coordinate, but just if in GUIDED mode.
Related code
At current master these seam to be the files involved in this problem:
Receives the guided message from the Ground Station:
https://github.com/diydrones/ardupilot/blob/2acddb9696fec77180863f3915080a69245084ec/libraries/GCS_MAVLink/GCS_Common.cpp#L681-L689
Does a little tour here:
https://github.com/diydrones/ardupilot/blob/416e9457ce11ae37200e6380834b1c5f3a4cd2e5/ArduCopter/GCS_Mavlink.pde#L1031-L1034
And finally lands here:
https://github.com/diydrones/ardupilot/blob/d857427444d8e8ffedd18add3075f370a36be41d/ArduCopter/commands_logic.pde#L777-L792I will submit a PR later, hopefully we can get it into AC3.2 so users can have a safer follow-me.
—
Reply to this email directly or view it on GitHub.
--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I agree this is a problem and I think either of the solutions is ok at least as a temporary fix:
Solution #1: GCS sends guided waypoint, then sends mode change to Guided (just the first time)
Solution #2: hack the GCS_MAVLink so if the “current” packet is some other new value (can’t be “3” but maybe probably “4”) then it’s treated as a guided mode target update (i.e. no mode change). By the way, this hacky bit of code has been moved into GCS_MAVLink library’s GCS_Common.cpp around line 681.
https://github.com/diydrones/ardupilot/blob/master/libraries/GCS_MAVLink/GCS_Common.cpp#L681
Solution #3: write a new do-follow-me command and possibly deal with it differently
The good thing about Solution #1 is I think it’s partially backwards compatible. I.e. New GCS + Old ArduPIlot code will work but Old GCS + New ArduPilot code won’t. I’d like to hear Tridge’s opinion because Plane and MavProxy are affected as well.
Regarding reworking guided mode, we generally need it to handle all (or most) of the commands that can appear in missions. To do that I think we need to extend the commands_logic.pde’s do_guided function so that instead of just setting the guided destination it needs to record that command somewhere, then check what the command is and pass it into a big switch statement like Auto does.
https://github.com/diydrones/ardupilot/blob/master/ArduCopter/commands_logic.pde#L778
Then we need to add a “verify_guided” which comes back again and again to ensure the command is progressing.
-Randy
As a starting point at least I’ve merged Arthur’s change into master (the spelling mistake of “acceept” is my contribution J).
https://github.com/diydrones/ardupilot/commit/e1b7e53c046049742ff40a6ddb0308de144fa1f6
So this means that to work with AC3.2 the ground stations will need to first send a command to switch into Guided mode and follow that with a guided mode waypoint. When copter switches to guided mode it initialises the guided mode target to a reasonable stopping point so no need to worry about it heading off into the sunset.
I’m not sure how plane will react though. We should try it in SITL. Just set up a flight mode to be guided mode (“param set FLTMODE1 15”) put a plane into the air and switch it into Guided mode (“switch 1”)…or it maybe you can just type “GUIDED” into the mavproxy command prompt.
-Randy
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of C Wong
Sent: May 16, 2014 9:20 AM
To: drones-...@googlegroups.com
Subject: Re: [drones-discuss] Re: [ardupilot] Copter: Follow-me safety (#1068)
Yes... is this switch to guided/follow me from stabilize/althold?
--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.