Copter: Follow-me Mode
Implement a follow me mode to use with mobile GCS like DroidPlanner and Andropilot.
It should work basically as Guided mode. But when the drone reaches min radius around the GCS it works as loiter.
This will improve aerial footage taken from copters using this mode, and will add light safety layer. To see a demo of the way it works now using guided mode take a look on this video.
As I discussed with @rmackay9 there should be some kind of hysteresis.
One way it could be implemented is using two states (see picture bellow also):
State - Behavior - Switch state if
State 1 - Works as guided mode - GCS_distance < r1
State 2 - Loiter, with yaw change - GCS_distance > r2
OBS:The "yaw change" means it keeps in loiter but always updating the yaw angle to face the user.

Please note that I drew the radius on the drone centered view, since normally the drone will be chasing the user. This can be interesting since the drone would hold the position when the user is near.
I briefly spoke about this on the dev discussion groups, but unfortunately I had a load of issues with my kit. The good news is I am almost up and running now and would like to take this concept on.
This idea could be very powerful, and we need to think of its applications. It is not just a gimmick and could be used some very serious filming. I want to use it for mountain biking and skiing, however other uses have been mentioned like the climbing guy which adds some interesting issues that need to be thought about. Ill try and outline clearly below my rough design/improvements over the current implementation.
-
- You should be able to specify an offset in 3D space, not just height. This will allow the copter to follow you from the side or even in front of you. NB. This could use the direction of the "follow me" device, eg phone, however I have been working with this at work, and its not full proof. I would suggest using the motion vector of the target, and if the magnitude of that vector is below a certain threshold simply loiter.
-
- There should be an option to allow the copter to either rotate the camera mount to face the target or the copter its self should yaw to face the target.
-
- There should be another option to allow the APM to set the pitch of the camera mount to point at the target, we have the 3D position of the copter and target so this should be relatively easy!
-
- There should be an option to define a corridor of movement like geo-fencing, this should help for situations like the climber on a cliff face, and could also aid in some epic moving panning shots. (Cant explain them, but I can see them!!!)
NB For points 2 & 3 I am assuming an external gimbal controller, although there is no reason the in built one cant be used on top of it.
Further to all this, maybe on the PX4, we should add some crude object avoidance for safety, infact we should really consider the safety implications for this and try and build in as many fail safes as we can.
I am fairly new to the APM, but I am more than happy to tackle this issue, however any guidance on setting up a new mode would be much appreciated.
Cheers
Gus
Please note I have forked the repo I will be working on this issue. Please see my fork; https://github.com/al2950/ardupilot
I think we should start with a simple mode like the one I described earlier, and then develop it further implementing all the features that you listed.
About the GPS height on an android device, my tablet just logs 0 as the height (probably because I was inside the house). Do you have the same problem?
I agree with starting simple. As for altitude mine certainly seems to work (Galaxy S3), but i dont know how accurate it is. We could try using the barometers on newer phones as well as gps. To be honest we dont need accurate height we just need to know the relative altitude from target to copter, so maybe barometer would be better
Hi Gus,
I've been working a bit with tracking (aka FollowMe) and can give some comments in addition to Arthur's, inline...
I briefly spoke about this on the dev discussion groups, but unfortunately I had a load of issues with my kit. The good news is I am almost up and running now and would like to take this concept on.
This idea could be very powerful, and we need to think of its applications. It is not just a gimmick and could be used some very serious filming. I want to use it for mountain biking and skiing, however other uses have been mentioned like the climbing guy which adds some interesting issues that need to be thought about. Ill try and outline clearly below my rough design/improvements over the current implementation.
-
- You should be able to specify an offset in 3D space, not just height. This will allow the copter to follow you from the side or even in front of you. NB. This could use the direction of the "follow me" device, eg phone, however I have been working with this at work, and its not full proof. I would suggest using the motion vector of the target, and if the magnitude of that vector is below a certain threshold simply loiter.
Agree--to the degree that you want this to be accurate, we will need accurate (non-GPS, ie. barometric) altitude. Relative altitude between two GPS's can be twice as bad as one absolute GPS measurement, since their error does not co-vary. So in any altitude measurement scenario--relative or absolute--you're going to want a baro. We talked about this in the context of tracking a rock climber on another thread.
-
- There should be an option to allow the copter to either rotate the camera mount to face the target or the copter its self should yaw to face the target.
In the ideal scenario, I think the user should not be controlling the copter--they should be controlling the thing they want, which is an image. The usability of a FollowMeCamera feature will be very tied to the interplay between the gimbal controller and the aircraft controller. Also, practically speaking, if you're a rock climber or a skier, controlling just the image is a big enough task, controlling the aircraft and the camera would be a deal breaker I think.
As an example, check out the prototype DJI implementation--it's not tracking anything but it's controlling the camera in a fairly intuitive way
http://www.youtube.com/watch?v=Rht-QarvEM4 http://www.youtube.com/watch?v=kRqqDkHX7iA
-
- There should be another option to allow the APM to set the pitch of the camera mount to point at the target, we have the 3D position of the copter and target so this should be relatively easy!
Same comment as above--basically the gimbal controller and the aircraft controller will definitely need to work together, bi-directionally.
-
- There should be an option to define a corridor of movement like geo-fencing, this should help for situations like the climber on a cliff face, and could also aid in some epic moving panning shots. (Cant explain them, but I can see them!!!)
Totally agree, this would look great. Geofence should be a good starting point.
NB For points 2 & 3 I am assuming an external gimbal controller, although there is no reason the in built one cant be used on top of it.
Further to all this, maybe on the PX4, we should add some crude object avoidance for safety, infact we should really consider the safety implications for this and try and build in as many fail safes as we can.
I am fairly new to the APM, but I am more than happy to tackle this issue, however any guidance on setting up a new mode would be much appreciated.
Kevin Hester mentioned in a previous thread that adding baro altitude to the FollowMe feature on Andropilothttps://play.google.com/store/apps/details?id=com.geeksville.andropilot&hl=en should not be too hard. So to start with a simple problem first, I'd add the feature to FollowMe to follow a 3D point using the baro altimeter on a tablet or phone. That would certainly be a step in the direction of accurate camera tracking in 3D.
Cheers,
Brandon
Cheers
Gus
On Mon, Jun 10, 2013 at 4:40 PM, al2950 [email protected] wrote:
I agree with starting simple. As for altitude mine certainly seems to work (Galaxy S3), but i dont know how accurate it is. We could try using the barometers on newer phones as well as gps. To be honest we dont need accurate height we just need to know the relative altitude from target to copter.
— Reply to this email directly or view it on GitHubhttps://github.com/diydrones/ardupilot/issues/299#issuecomment-19233234 .
hmm - I'm not sure this is necessary to do in ardupilot. Why not have the GCS do this behavior? (Like andropilot does)
I think it is important that this is based in the Ardupilot, with the ground based device just sending GPS and baro data, that would make the ground end very simple, ie, a GPS, barro, and a small micro to send this minimal data to the APM. There are SO many very useful reasons to have this feature in both copter and plane.
As proficnc said there are quite a few reasons to have it on the copter instead of the GCS. The two main reason for this;
- To do it properly you need to work out the height based on the relative readings from the two barometers (copter & GCS). Using absolute GPS height is far too inaccurate, and will most likely result in a haircut from the your flying lawnmover!
- To implement the more advanced ideas I have really requires there to be a proper Follow Me mode on the copter with separate logic to run, ie not Guided mode.
Having said that, implementing on the GCS would be far simpler! I am open to ideas so if anyone has anything they think I have not thought of please let me know!
Gus
The ground based code (even with the great idea of switching to loiter and just change yaw once inside radius X) is already super simple. The code that does this in andropilot is less than 15 lines. It would be easy to have mavstation or any other low end MCU do this if desired.
I tend to think just from a robustness (and size of code for the poor 2650 based autopilots) standpoint we should be trying to move as much as possible out of the APM code (eventually running more of that code in a non real time thread inside the PX4 or the GCS). Validating correctness is hard and if we keep the number of validated (but trusted primitives) small we increase the likelyhood of a rock solid vehicle.
DroidPlanner's follow-me is built on top of guided mode, and it's actually getting pretty good. There are always improvements that can be made (e.g. #1180 ) but I don't think we need a special mode any more.
Yup, totally agree, thanks.
Hey guys, I'm about to buy a drone, I already have an APM 2.6 flightboard and telemetry, I would just like to know if a gps module on the drone is needed or if the gps on the phone is enough I'll be using it to for mountain skiing
you need a full system for follow-me, including a gimbal
2014-09-25 9:25 GMT-07:00 bacotremi [email protected]:
Hey guys, I'm about to buy a drone, I already have an APM 2.6 flightboard and telemetry, I would just like to know if a gps module on the drone is needed or if the gps on the phone is enough I'll be using it to for mountain skiing
— Reply to this email directly or view it on GitHub https://github.com/diydrones/ardupilot/issues/299#issuecomment-56844686.
Arthur Benemann
Ok so it requires a gps module ? I will also buy a tarot gimbal, which seems very good
You don't need a gimbal, but it definitely improves the experience of follow-me.
Okay, but what about the gps, is it necessary ?
Yes
Yeah absolutely
baco, This github board is a place for people to work on development of new features and improvement of existing features. It is for the putpose of software development. Most of the people here are also found in places like the forums at diydrones, where discussions and requests for instructions are more often found. That said, I'm sorry it took you three requests to get an answer to your question! Ha. I'm sure nobody minds terribly, but you might have more luck finding instructions and advice over there.
For Follow Me, the device being followed needs to know its GPS position. That device needs a telemetry connection, such as that provided by 3DR radios, RFD900's/RFD433's (more powerful, but use more battery power, too), or HopeRF radios. These allow the device to communicate with the drone to tell the drone its position, among other communication. If the drone gets longitude and lattitude of something it wants to follow, it can only do that if the drone knows its own position, so the drone must have GPS to know its own position.
Learning about this stuff is just about overwhelming at first, but keeping doing research and you will get flying.