주요 콘텐츠

move

R2026b

Move Parrot drone in all six directions

Description

Add-On Required: This feature requires the MATLAB Support Package for Parrot Drones add-on.

move(parrotObj,Name=Value) moves the Parrot® drone, represented by parrotObj, in all six directions based on attitude angles, rotation speed, and vertical speed specified as name-value arguments.

The following schematic shows the quadcopter axis characteristics :

The quadcopter body axis is centered in the center of gravity.

  • The x-axis starts at the center of gravity and points in the direction along the nose of the quadcopter.

  • The y-axis starts at the center of gravity and points to the right of the quadcopter.

  • The z-axis starts at the center of gravity and points downward from the quadcopter, following the right-hand rule.

example

move(parrotObj,duration,Name=Value) moves the Parrot drone, represented by parrotObj, in all six directions based on attitude angles, rotation speed, and vertical speed specified as name-value arguments for the duration specified as duration.

example

Examples

collapse all

Connect to a Parrot drone.

parrotObj = parrot('Mambo')
parrotObj = 
          parrot with properties:

                    Name: "Mambo"
                      ID: "Mambo_564853"
                   State: "landed"
            BatteryLevel: 50%
        AvailableCameras: ["FPV"]

Use the parrot object to initiate takeoff of the Parrot drone.

takeoff(parrotObj)

While the Parrot drone is in flight, move the drone diagonally forward with a Pitch and Roll of -10 degrees and +10 degrees respectively for the default duration of 0.5 seconds.

move(parrotObj,Pitch=deg2rad(-10),Roll=deg2rad(10));

Connect to a Parrot drone.

parrotObj = parrot('Mambo')
parrotObj = 
          parrot with properties:

                    Name: "Mambo"
                      ID: "Mambo_564853"
                   State: "landed"
            BatteryLevel: 50%
        AvailableCameras: ["FPV"]

Use the parrot object to initiate takeoff of the Parrot drone.

takeoff(parrotObj)

While the Parrot drone is in flight, move the drone diagonally backward for 2 seconds with a Pitch and Roll of +10 degrees and +10 degrees respectively.

move(parrotObj,2,Pitch=deg2rad(10),Roll=deg2rad(10));

Input Arguments

collapse all

Parrot drone connection object, specified as a parrot object.

The time for which the Parrot drone moves in the specified direction for the specified time. The default value is 0.5 seconds.

Data Types: double

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: move(parrotObj,3,VerticalSpeed=-2);

The pitch angle in which the Parrot drone moves along the x-axis, specified in radians. The drone moves forward, if the Pitch is negative. If the Pitch is positive, the drone moves backward.

The following Pitch values are valid for the Parrot drones

Parrot DronePitch value
Parrot Mambo-0.436 rad (-25degrees) to 0.436 rad (25 degrees)
Parrot Bebop 2-0.6109 rad (-35degrees) to 0.6109 rad (35 degrees)

Example: move(parrotObj,3,Pitch=deg2rad(2));

Data Types: double

The roll angle in which the Parrot drone, moves along the y-axis, specified in radians. The drone moves to the left if the Roll is negative. If the Roll is positive, the drone moves right.

The following Roll values are valid for the Parrot drones

Parrot DroneRoll value
Parrot Mambo-0.436 rad (-25degrees) to 0.436 rad (25 degrees)
Parrot Bebop 2-0.6109 rad (-35degrees) to 0.6109 rad (35 degrees)

Example: move(parrotObj,3,Roll=deg2rad(2));

Data Types: double

The speed at which the Parrot drone moves around the z-axis, specified in radians/s. The drone moves in the counterclockwise direction if the RotationSpeed is negative. If the RotationSpeed is positive, the drone moves in the clockwise direction.

The following RotationSpeed values are valid for the Parrot drones

Parrot DroneRotationSpeed value
Parrot Mambo-pi rad/s (-180 deg/s) to +pi rad/s (180 deg/s)
Parrot Bebop 2-3.4907 rad/s (-200 deg/s) to 3.4907 rad/s (200 deg/s)

Example: move(parrotObj,3,RotationSpeed=deg2rad(2));

Data Types: double

The speed at which the Parrot drone moves along z-axis, specified in m/s. The drone ascends, if the VerticalSpeed is negative. If the VerticalSpeed is positive, the drone descends.

The following VerticalSpeed values are valid for the Parrot drones

Parrot DroneVerticalSpeed value
Parrot Mambo-2 m/s to +2 m/s.
Parrot Bebop 2-6 m/s to +6 m/s.

For Parrot Mambo drones, the valid values for VerticalSpeed is between -2 m/s to +2 m/s.

Example: move(parrotObj,3,VerticalSpeed=-2);

Data Types: double

Version History

Introduced in R2019a