Main Content

readOrientation

Read Euler angles of Parrot drone

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

Description

[eulerAngles,time] = readOrientation(parrotObj) returns the Euler angles that is the azimuth, the pitch, and the roll of Parrot® drone, specified as a parrot object, along with the time stamp. For a Parrot Mambo drone, before takeoff, the function returns a zero.

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, read the orientation

[eulerAngles,time]= readOrientation(parrotObj)
eulerAngles = 
0.785  0.301  -0.207
time = 
     datetime
      15-Mar-2019 14:07:19

Input Arguments

collapse all

Parrot drone connection object, specified as a parrot object.

Output Arguments

collapse all

Euler rotation angles in radians , returned as an 1-by-3 array of Euler rotation angles. The axis is along ZYX axes. This represents the rotation of the Parrot drone from the NED frame to the estimated body frame.

Data Types: double

The time at which the drone sends the orientation of the Parrot drone, specified as a datetime.

Data Types: datetime

Version History

Introduced in R2019a