I've been looking for a way to set my home location after the APM2 is powered up. So I can get everything working on the edge of a field, then walk in to the middle and set home before I launch.

If I create a simple mission:


Would that update the home location when I switched the plane to Auto?

If not, is there anything I could add to make it work?

If I added



Would that continually loop, updating the home location until I turned Auto off? Would the mission remain incomplete so I could run it again later without resetting the APM2?

Views: 4560

Reply to This

Replies to This Discussion

Ok, I've played around a bit more and I think this mission will work.

LOITER_UNLIM (lat, lot, alt)


DO_SET_SERVO 2 1000 (move the elevator as a confirmation the script has run)

DO_JUMP 1 -1

Does that look right to someone?

Hi Eddie, Wondering have you succeded? I was trying to send PWM signal to an output channel "on table" trying to fool APM2, but it didn't work.

On the bench switching to Auto did make the elevator go down. We set up in the middle of the field today anyway, so I didn't test the set_home part of the script. Maybe next week. :)

On another note, all the flight modes checked out ok so I made a new personal best distance of 1365m today. :)

Congratulations! I wasn't so lucky with the script. Which version of APM, firmware do you use?

ArduPilot 2.5.
The only 'trick' I found us that you have to have a navigation command at te start, then the other commands after it.


there appears to be a MAVLINK message type (mavlink_msg_set_gps_global_origin) that is inteded for that purpose (note that I am just guessing this by its name). However, it does not seem to be implemented in neither ArduPlane or ArduCopter based on a quick grep of the sources.

So I guess you could just make a feature requires on the issue tracker and hope you get one of the devs interested. Or, which may be a lot faster, just implement it yourself :)

I may be interested in that, too but guess I won't have time for that in the near future at least. I have the same problem of standing at the boundary of the flying field and when I do RTL the other guys doing their own RC things (understandingly) get a bit annoyed :-)

Cheers, Andre

Hmmm.  I thought that home was set when you armed your FC.  If not, that explains a few problems I've had....

I'm not sure about ArduCopter, but in ArduPlane it's set as soon as you get a 3D lock. Often the position is still not that accurate at that stage so I want to set it once I have 9+ satellites. I put in a feature request for a parameter to specify the number of satellites acquired before it is set, but a scripted switch seems the best solution at the moment. The only problem being that I can't load any actual autopilot missions.

I personally love the idea of the feature request for a parameter to specify the number of satellites acquired before home is set.

Can anyone from the development team please give us a definitive answer as to how/when HOME can be set?

The issue request is here http://code.google.com/p/ardupilot-mega/issues/detail?id=704

Please vote for it if you'd like to see this feature.

Hi again,

won't help your APM2 I'm afraid but I may have found another solution that may be interesting for APM1 users so I mention it here due to the lack of a better place. So it turns out there is an unused pushbutton on APM1's oilpan on pin 41 (active low) which can be used for that purpose. It has been disabled in the next version of ArduPlane but if there is sufficient interest maybe one could bring it back. I haven't tested it yet on the field but on my bench it seems to work. So for ArduPlane (maybe works for ArduCopter, too but haven't checked) basically add something like this which will flash LED A twice and set home to the current location whenever you push the button (on your own risk of course:-)

if (digitalRead(PUSHBUTTON_PIN) == 0) {
delay(250); digitalWrite(A_LED_PIN,LED_OFF); init_home();

Reply to Discussion


© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service