Main Content

moveforward

Move Ryze drone forward

Since R2020a

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

Description

moveforward(droneObj) moves the Ryze drone forward.

example

moveforward(droneObj,Name,Value) moves the Ryze drone forward using the specified options.

example

moveforward(droneObj,duration) moves the Ryze drone forward for the specified time.

example

moveforward(droneObj,duration,Name,Value) moves the Ryze drone forward for the specified time and specified additional options.

example

Examples

collapse all

Connect to a Ryze drone.

droneObj = drone("Tello")
droneObj = 
          ryze with properties:

                    Name: "Tello"
                      ID: "TELLO-D2B07B"
               IPAddress: "192.168.10.1"
                   State: "landed"
            BatteryLevel: 50%
             StationMode: 0
        AvailableCameras: ["FPV"]

Use takeoff to initiate takeoff of the drone.

takeoff(droneObj)

While the Ryze Tello drone is hovering, move the drone forward for the default duration of 0.5 seconds.

moveforward(droneObj)

Connect to a Ryze drone.

droneObj = drone("Tello")
droneObj = 
          ryze with properties:

                    Name: "Tello"
                      ID: "TELLO-D2B07B"
                   State: "landed"
            BatteryLevel: 50%
        AvailableCameras: ["FPV"]
 

Use takeoff to initiate takeoff of the drone.

takeoff(droneObj)

While the Ryze Tello drone is hovering, move the drone forward by 2m while unblocking MATLAB® Command Line.

moveforward(droneObj,'Distance',2,'WaitUntilDone',false)

Connect to a Ryze drone.

droneObj = drone("Tello")
droneObj = 
          ryze with properties:

                    Name: "Tello"
                      ID: "TELLO-D2B07B"
                   State: "landed"
            BatteryLevel: 50%
        AvailableCameras: ["FPV"]
 

Use takeoff to initiate takeoff of the drone.

takeoff(droneObj)

While the Ryze Tello drone is hovering, move the drone forward for 5 seconds.

moveforward(droneObj,5)

Connect to a Ryze drone.

droneObj = drone("Tello")
droneObj = 
          ryze with properties:

                    Name: "Tello"
                      ID: "TELLO-D2B07B"
                   State: "landed"
            BatteryLevel: 50%
        AvailableCameras: ["FPV"]
 

Use takeoff to initiate takeoff of the drone.

takeoff(droneObj)

While the Ryze Tello drone is hovering, move the drone forward for 5 seconds at a speed of 1 m/s.

moveup(droneObj,5,'Speed',1)

Input Arguments

collapse all

Ryze drone connection object, specified as a droneObj.

The time for which the Ryze drone moves forward, specified in seconds.

Data Types: double

Name-Value Arguments

Example: moveforward(obj,‘Distance’,0.5,‘Speed’,0.4,‘WaitUntilDone’,true);

Specify optional comma-separated pair of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Note

Specify either duration or Distance to control the drone.

The relative distance (in meters) at which drone must move, specified as a double.

Data Types: double

The speed (in m/s) which the drone must move, specified as a double.

Data Types: double

Mode of operation for the moveforward command, specified as logical value of true or false.

WaitUntilDone is true by default and blocks MATLAB command line execution until the current move command runs to completion. If WaitUntilDone is set to false, the MATLAB command line is unblocked, while the previous move command is still in progress.

Note

The Ryze drone ignores any subsequent move commands that is executed before completion of the previous move command.

Data Types: logical

Version History

Introduced in R2020a