Creating a switch to set "home".

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:

DO_SET_HOME

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

DO_SET_HOME

DO_JUMP 0

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?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • I wish arduplane was similar to setting rtl position as arducopter by arming. With arduplane, I am unable to disarm...

    -Chris

  • Moderator

    @Randy & Soren,

    Can we use WP0 as written in the MP flight planner to determine the RTL return position using the following logic?

    1) IF WP0 < MAX_DISTANCE_HOME THEN RTL goes to WP0

    2) IF WP0 > MAX_DISTANCE_HOME THEN RTL goes to stored Home

    This way all the user needs to do is define MAX_DISTANCE_HOME (as Soren suggested) and write the mission to the APM with the home position as defined by WP0. Since WP0 remains even after a power cycle the user wouldn't need to rewrite the mission as long as he didn't need to change the whole flight plan. Also there wouldn't be any risk of a 'fly away' due to the constraint of MAX_DISTANCE_HOME. If the distance between the home location and WP0 were ever greater than the limit stored in MAX_DISTANCE_HOME then WP0 would be ignored.

    Regards,

    Nathaniel ~KD2DEY

  • I have looked into it in detail (user dongfang) here:

    https://github.com/diydrones/ardupilot/issues/416

    If I create a simple mission:

    DO_SET_HOME

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

    The answer is sometimes. The DO_SET_HOME can be parameter'ized to use the current position when executing, or you can attach a position to the command. In the former case the answer is yes and in the latter no. I believe it is either a bug, or somebody was concerned about what would happen of the parameter position was badly wrong maybe (including altitude)? Wither way, in the latter case the command has no effect at all - except that it will move waypoint 0 in EEPROM. This is not used for flight. If you re-read the onboard mission in MP after mission completed, the home will appeear to have moved and you might get confused....

    Regards

    Soren

  • Moderator

    I think I understand how to change the home location in the Mission Planner now. If you drag the home WP after the APM boots to the location where you want to have the plane go on RTL and then load the 'Mission', you will get a message asking if your want to reset home to the location in the Mission file. If you respond yes the home location when read from the APM remains in the new location as long as you don't reset or power off the APM. If you answer no then the home location is set at the current physical location of the APM. In any case once you power cycle the APM the home position will be reset to it's current physical location .I'm going to test this tomorrow and will report back my findings then.

    @Eddie- Unfortunately this wont help you without the availability of the Mission planner, sorry.

    Regards,

    Nathaniel ~KD2DEY

  • Has anyone found a method to set Home or RTL to a point and have it stick? This would be a great thing to have so RTL could be set to a location that would not have the craft circle and invade the airspace behind the pilot stations (the pit area) which most clubs frown upon. If the RTL location could be set at the far side of the field then the craft would "loiter" in front of the pilot stations making the pit area more safe. As has been mentioned a number of stick combinations or even a switch would be great. This an awesome platform and a feature such as this to make it safer would benefit many.

  • I can't seem to move my home postion via MP. I move to the center of the field, I write it to  the APM, I read it back to confirm, but the Plane still RTL's to the position it got gps lock. Why is this?

  • Moderator

    DO_xxx commands currently need a dummy waypoint placed after the DO_xxx command
    eg:

    WAYPOINT_1
    DO_SET_HOME
    WAYPOINT_2

    Home will be set at WAYPOINT_1 but will not work if WAYPOINT_2 is not there.

  • So finally how the Home Location is set???  Since I had bad crash related to lack of this knowledge I looked inside the APM (ArduCopter 2.7) code. Just want to warn that ArduPlane code may have different logic. Here is the logic:

    3692492947?profile=original

    The way "good" lock is obtained is pretty kludgy: it's just reading GPS values 10 times in a row. If all the readings were  successful, it will be declared "good".

    If motors armed when there are no GPS lock still, the home won't be re-set. This means that Home could be set in air. Which means that altitude will not be zero anymore. Since it's ABOVE zero, this shouldn't be too dangerous unless you flying from the well. This also explains why Home can be off from the start point.

  • I just had a brainwave. The telemetry radios connect via the same port as the OSD right? We've got a menu in MinimOSD-extra for changing some settings. Couldn't I add a 'Set Home' section to the menu then have the OSD send the same command to the APM2 that the telemetry radio would?

    I still like Andre's dedicated button solution as anyone would be able to implement that.

  • I was wondering how to set a new home location the other day too. Quite often I will power up my tri, fly a route, land and disarm, but keep it powered so that I don't have to wait several minutes to get a GPS lock again, and then I will walk 200m or so to a new location where I would like to reset my gps home, and fly from there. I like the idea of holding the right stick down and left or something to reset my home location.

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…