You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vehicle.waypoint_home was in the original documentation, but is not present in the implementation (MPVehicle). So if you try the following you will get an exception.
print "waypoint_home: %s" % v.waypoint_home
Remove the variable from the documentation as it is "not implemented". #105 has been created to add the attribute back again
Research indicates that implementing this API this probably isn't possible currently. It is possible to set the home position in a mission but it is not 100% clear whether this is the same "variable" as is used in other modes. It is also not obvious that there is any way to get the home position. There was a brief discussion on this in the discussion group some years ago.
definitely possible, it was probably inadvertently lost when full command access was added.. vehicle.commands[0] is guaranteed to be home. It would be easy to add it back.
@mrpollo - do you want to add it back or should we just document vehicle.commands[0] gets the right value? My preference is to add it back to make it more visible.
While we're at it, can/should we make this have a setter as well? That makes sense to me because then you could easily change the home position outside of missions.
What should be the type of waypoint_home? A Location instance? An array with lat, lon, alt?
Let's say that I set a waypoint_home and then I create a mission: should my home overwrite vehicle.commands[0] or vice versa? Or should be they always kept separate from each other? Should my waypoint_home be None unless I set a mission?
What should be the type of waypoint_home? A Location instance? An array with lat, lon, alt?
Yes, a Location instance.
Let's say that I set a waypoint_home and then I create a mission: should my home overwrite vehicle.commands[0] or vice versa? Or should be they always kept separate from each other? Should my waypoint_home be None unless I set a mission?
The home position is (currently) stored in the 0th waypoint, and is automatically set by the autopilot, usually when it first gets GPS lock (though sometimes it is set at takeoff or when arming occurs - not sure). I THINK that you can't upload your own value for this, but that is worth checking.
So I recommend doing some testing. If you can't set the value, then just make it a read-only attribute. If you can set it, then do (but we'll need to make it clear that the value may be over-written at any time by the autopilot).
Activity
hamishwillee commentedon May 12, 2015
Research indicates that implementing this API this probably isn't possible currently. It is possible to set the home position in a mission but it is not 100% clear whether this is the same "variable" as is used in other modes. It is also not obvious that there is any way to get the home position. There was a brief discussion on this in the discussion group some years ago.
geeksville commentedon May 12, 2015
definitely possible, it was probably inadvertently lost when full command access was added.. vehicle.commands[0] is guaranteed to be home. It would be easy to add it back.
hamishwillee commentedon May 12, 2015
@geeksville Thanks very much.
@mrpollo - do you want to add it back or should we just document vehicle.commands[0] gets the right value? My preference is to add it back to make it more visible.
While we're at it, can/should we make this have a setter as well? That makes sense to me because then you could easily change the home position outside of missions.
[-]Vehicle.waypoint_home not implemented[/-][+]Remove Vehicle.waypoint_home documentation[/+]Fixes to parameters docs, removal of docs for non-implemented fuction…
hamishwillee commentedon May 13, 2015
Closed by #108
maruina commentedon Jun 4, 2015
I have a couple of doubts:
hamishwillee commentedon Jun 5, 2015
@maruina All good questions. I would say
Yes, a Location instance.
The home position is (currently) stored in the 0th waypoint, and is automatically set by the autopilot, usually when it first gets GPS lock (though sometimes it is set at takeoff or when arming occurs - not sure). I THINK that you can't upload your own value for this, but that is worth checking.
So I recommend doing some testing. If you can't set the value, then just make it a read-only attribute. If you can set it, then do (but we'll need to make it clear that the value may be over-written at any time by the autopilot).
Does that make sense?