diff --git a/backyard_flyer.py b/backyard_flyer.py index 4a07868..c56796c 100644 --- a/backyard_flyer.py +++ b/backyard_flyer.py @@ -71,15 +71,14 @@ def state_callback(self): def calculate_box(self): print("Setting Home") - local_waypoints = [[10.0, 0.0, 3.0], [10.0, 10.0, 3.0], [0.0, 10.0, 3.0], [0.0, 0.0, 3.0]] + local_waypoints = [[10.0, 0.0, 3.0, 0.0], [10.0, 10.0, 3.0, 0.0], [0.0, 10.0, 3.0, 0.0], [0.0, 0.0, 3.0, 0.0]] return local_waypoints def arming_transition(self): print("arming transition") self.take_control() self.arm() - self.set_home_position(self.global_position[0], self.global_position[1], - self.global_position[2]) # set the current location to be the home position + self.set_home_position(*self.global_position) # set the current location to be the home position self.flight_state = States.ARMING @@ -95,7 +94,7 @@ def waypoint_transition(self): print("waypoint transition") self.target_position = self.all_waypoints.pop(0) print('target position', self.target_position) - self.cmd_position(self.target_position[0], self.target_position[1], self.target_position[2], 0.0) + self.cmd_position(*self.target_position) self.flight_state = States.WAYPOINT def landing_transition(self):