Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dronekit/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,11 +698,11 @@ def listener(self, name, m):
self._fix_type = m.fix_type
self._notify_attribute_listeners('gps_0')

self._last_waypoint = 0
self._current_waypoint = 0

@self.message_listener(['WAYPOINT_CURRENT', 'MISSION_CURRENT'])
def listener(self, name, m):
self._last_waypoint = max(m.seq - 1, 0)
self._current_waypoint = m.seq

self._ekf_poshorizabs = False
self._ekf_constposmode = False
Expand Down Expand Up @@ -1520,14 +1520,14 @@ def next(self):
"""
Get the currently active waypoint number.
"""
return self._vehicle._last_waypoint
return self._vehicle._current_waypoint

@next.setter
def next(self, index):
"""
Set a new ``next`` waypoint for the vehicle.
"""
self._vehicle._master.waypoint_set_current_send(index + 1)
self._vehicle._master.waypoint_set_current_send(index)

def __len__(self):
'''
Expand Down
3 changes: 3 additions & 0 deletions examples/mission_basic/mission_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def arm_and_takeoff(aTargetAltitude):
print "Waiting for GPS...:", vehicle.gps_0.fix_type
time.sleep(1)

# Wait for EKF to settle.
time.sleep(5)

print "Arming motors"
# Copter should arm in GUIDED mode
vehicle.mode = VehicleMode("GUIDED")
Expand Down