I am trying to use CurrentState.wp_dist (or cs.wp_dist from a Python script) to estimate the distance to the next WP. The trouble is, if the WP is a dynamically created, Guided waypoint, wp_dist always reports 0.0. Is that by design?
def newWP(lat, lng, alt):
wp = MissionPlanner.Utilities.Locationwp()
MissionPlanner.Utilities.Locationwp.lat.SetValue(wp, lat)
MissionPlanner.Utilities.Locationwp.lng.SetValue(wp, lng)
MissionPlanner.Utilities.Locationwp.alt.SetValue(wp, alt)
return wp
MAV.setGuidedModeWP(newWP(lat, lng, alt))
print 'Distance to WP is ' + str(cs.wp_dist)
The above always prints 0.0 instead of the estimated distance… what’s up with that? Is that by design? Is there a different estimator that can be used for these WPs?
Thank you in advance.