Example #1
0
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(5),
        cmd.right(2),
        cmd.backward(4),
        cmd.left(4),
        cmd.forward(5),
        
        # 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)
Example #2
0
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),
    ])
Example #3
0
def plan_mission(mission):

    DELTA = 0.125
    VDELTA = 0.45
    commands  = [
        cmd.up(1-VDELTA),
        cmd.forward(5-DELTA),
        cmd.left(2-DELTA),
        cmd.backward(4-2*DELTA),
        cmd.right(4-2*DELTA),
        cmd.forward(6),
    ]

    mission.add_commands(commands)
Example #4
0
def plan_mission(mission):

    commands  = [
        cmd.up(1),
        cmd.forward(1),
        cmd.right(2),
        cmd.forward(4),
        cmd.left(4),
        cmd.backward(4),
        cmd.turn_right(45),
        cmd.forward(3),
    ]

    mission.add_commands(commands)
Example #5
0
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(5),
        cmd.right(2),
        cmd.backward(4),
        cmd.left(4),
        cmd.forward(5),
    ]

    mission.add_commands(commands)
Example #6
0
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),
        ]
    )
Example #7
0
def plan_mission(mission):

    commands = [
        cmd.up(1.0),  # cmd.up: move x meters up
        cmd.left(2.0),  # cmd.left: move x meters to the left
        cmd.forward(6.0),  # cmd.forward: move x meters forward
        cmd.right(2.0),  # cmd.right: move x meters to the right
        cmd.backward(6.0),  # cmd.backward: move x meters backward
        cmd.right(2.0),
        cmd.forward(6.0),
        cmd.left(2.0),
        cmd.backward(6.0)
    ]

    mission.add_commands(commands)
Example #8
0
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)
Example #10
0
def plan_mission(mission):

    # this is an example illustrating the different motion commands,
    # replace them with your own commands and activate all beacons
    commands  = [
        # middle column
        cmd.up(1),
        cmd.forward(5),
        
        # right column
        cmd.right(2),
        cmd.backward(5),
        
        # left column
        cmd.left(4),
        cmd.forward(6),
        
        
    ]

    mission.add_commands(commands)
Example #11
0
    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)
Example #12
0
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):

    # 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)
Example #14
0
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)
Example #15
0
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)