def plan_mission(mission): # this is an example illustrating the different motion commands, # replace them with your own commands and activate all beacons commands = [ #cmd.down(0.5), #cmd.right(1), #cmd.turn_left(45), #cmd.forward(sqrt(2)), #cmd.turn_right(45), #cmd.right(1), #cmd.turn_left(45), #cmd.forward(sqrt(0.5)), #cmd.turn_left(90), #cmd.forward(sqrt(0.5)), #cmd.turn_left(45), #cmd.forward(1), #cmd.turn_right(45), #cmd.backward(sqrt(2)), #cmd.turn_left(45), #cmd.forward(1), cmd.up(1.5), cmd.forward(5), cmd.turn_left(90), cmd.forward(2), cmd.turn_left(90), cmd.down(0.5), cmd.forward(5), cmd.turn_left(90), cmd.forward(4), cmd.turn_left(90), cmd.forward(5), ] mission.add_commands(commands)
def plan_mission(mission): # this is an example illustrating the different motion commands, # replace them with your own commands and activate all beacons commands = [ # suppose that the beacons are placed on a set of grid points, # labelled as follows: # (0,0), (0,1), (0,2) # (1,0), (1,1), (1,2) # (2,0), (2,1), (2,2) # increase altitude to meet beacons cmd.up(1.0), # align with first grid point at grid point (2,2) cmd.turn_right(90.0), cmd.forward(2.0), cmd.turn_left(90.0), # move through the beacon at (2,2) to the beacon at (0,2) cmd.forward(5.0), # align with beacon at grid point (0,1) cmd.turn_left(90.0), # move from beacon at (0,2) through the beacon at (0,1) to the beacon at (0,0) cmd.forward(4.0), # align with beacon at grid point (1,0) cmd.turn_left(90.0), # move from beacon at (0,0) through the beacon at (1,0) to the beacon at (2,0) cmd.forward(4.0), # align with beacon at grid point (2,1) cmd.turn_left(90.0), # move beacon at grid point (2,1) cmd.forward(2.0), # align with beacon at grid point (1,1) cmd.turn_left(90.0), # move beacon at grid point (2,1) cmd.forward(2.0), ] mission.add_commands(commands)
def plan_mission(mission): # this is an example illustrating the different motion commands, # replace them with your own commands and activate all beacons commands = [ cmd.up(1), cmd.turn_left(90 - 26.57), cmd.forward(sqrt((2 * 0.5)**2 + (4 * 0.5)**2)), cmd.turn_right(90 - 26.57), cmd.forward(4), cmd.right(2), cmd.backward(4), cmd.right(2), cmd.forward(4), cmd.turn_left(45), ] mission.add_commands(commands)
def plan_mission(mission): # this is an example illustrating the different motion commands, # replace them with your own commands and activate all beacons commands = [ cmd.up(1), cmd.forward(6), cmd.turn_left(90), cmd.forward(2), cmd.turn_left(90), cmd.forward(6), cmd.turn_left(90), cmd.forward(4), cmd.turn_left(90), cmd.forward(6), ] mission.add_commands(commands)
def plan_mission(mission): mission.add_commands([ cmd.up(1.0), cmd.forward(1), cmd.left(2), cmd.forward(4), cmd.turn_left(45), cmd.backward(sqrt(32)), cmd.turn_right(45), cmd.forward(4), cmd.left(2), ])
def plan_mission(mission): mission.add_commands( [ cmd.up(1.0), cmd.forward(1), cmd.left(2), cmd.forward(4), cmd.turn_left(45), cmd.backward(sqrt(32)), cmd.turn_right(45), cmd.forward(4), cmd.left(2), ] )
def mission_setup(self, planner): import quadrotor.command as cmd # guess what this flightplan will do :) commands = [ cmd.down(0.5), cmd.right(1), cmd.turn_left(45), cmd.forward(math.sqrt(2)), cmd.turn_right(45), cmd.right(1), cmd.turn_left(45), cmd.forward(math.sqrt(0.5)), cmd.turn_left(90), cmd.forward(math.sqrt(0.5)), cmd.turn_left(45), cmd.forward(1), cmd.turn_right(45), cmd.backward(math.sqrt(2)), cmd.turn_left(45), cmd.forward(1), ] planner.add_commands(commands)
def plan_mission(mission): # this is an example illustrating the different motion commands, # replace them with your own commands and activate all beacons commands = [ cmd.up(1), cmd.turn_right(degrees(atan(2))), cmd.forward(sqrt(1 + 2**2)), cmd.turn_right(degrees(atan(0.5)) + 45), cmd.backward(sqrt(4**2 + 4**2)), cmd.turn_left(45), cmd.forward(4), cmd.turn_left(degrees(atan(0.5))), cmd.backward(sqrt(2**2 + 4**2)), cmd.turn_left(degrees(atan(2))), cmd.backward(2), cmd.turn_right(90), cmd.forward(2), cmd.turn_left(45), cmd.forward(sqrt(2**2 + 2**2)), cmd.down(1) ] mission.add_commands(commands)
def plan_mission(mission): commands = [ cmd.down(0.5), cmd.right(1), cmd.turn_left(45), cmd.forward(sqrt(2)), cmd.turn_right(45), cmd.right(1), cmd.turn_left(45), cmd.forward(sqrt(0.5)), cmd.turn_left(90), cmd.forward(sqrt(0.5)), cmd.turn_left(45), cmd.forward(1), cmd.turn_right(45), cmd.backward(sqrt(2)), cmd.turn_left(45), cmd.forward(1), ] #mission.add_commands(commands) myCommand = [ cmd.up(1), cmd.right(2), cmd.forward(5), cmd.left(2), cmd.backward(5), cmd.left(2), cmd.forward(5), cmd.right(2), cmd.turn_right(360), cmd.backward(5), cmd.turn_left(360), cmd.down(1), ] mission.add_commands(myCommand)