Skip to main content

__init__

MultirotorClient.__init__(ip="", port=41451, timeout_value=3600)
No description provided!
All multirotor methods accept an optional robot_name. When not supplied, AirGen targets the first configured robot (alphabetical order).

takeoffAsync

MultirotorClient.takeoffAsync(timeout_sec=20, robot_name="")
Takeoff robot to 3m above ground. Robot should not be moving when this API is used. It also clears any prior collision information by calling simGetCollisionInfo()
Arguments
timeout_sec
int, optional
Timeout for the robot to reach desired altitude
robot_name
str, optional
Name of the robot to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

landAsync

MultirotorClient.landAsync(timeout_sec=60, robot_name="")
Land the robot
Arguments
timeout_sec
int, optional
Timeout for the robot to land
robot_name
str, optional
Name of the robot to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

goHomeAsync

MultirotorClient.goHomeAsync(timeout_sec=3e38, robot_name="")
Return robot to Home i.e. Launch location
Arguments
timeout_sec
int, optional
Timeout for the robot to reach desired altitude
robot_name
str, optional
Name of the robot to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

cancelLastTask

MultirotorClient.cancelLastTask(robot_name="")
Cancel previous Async task
Arguments
robot_name
str, optional
Name of the robot

moveByVelocityBodyFrameAsync

MultirotorClient.moveByVelocityBodyFrameAsync( vx, vy, vz, duration, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), robot_name="", )
No description provided!
Arguments
vx
float
desired velocity in the X axis of the robot’s local NED frame.
vy
float
desired velocity in the Y axis of the robot’s local NED frame.
vz
float
desired velocity in the Z axis of the robot’s local NED frame.
duration
float
Desired amount of time (seconds), to send this command for
drivetrain
DrivetrainType, optional
drivetrain
yaw_mode
YawMode, optional
yaw_mode
robot_name
str, optional
Name of the multirotor to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

moveByVelocityZBodyFrameAsync

MultirotorClient.moveByVelocityZBodyFrameAsync( vx, vy, z, duration, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), robot_name="", )
No description provided!
Arguments
vx
float
desired velocity in the X axis of the robot’s local NED frame
vy
float
desired velocity in the Y axis of the robot’s local NED frame
z
float
desired Z value (in local NED frame of the robot)
duration
float
Desired amount of time (seconds), to send this command for
drivetrain
DrivetrainType, optional
drivetrain
yaw_mode
YawMode, optional
yaw_mode
robot_name
str, optional
Name of the multirotor to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

moveByAngleZAsync

MultirotorClient.moveByAngleZAsync(pitch, roll, z, yaw, duration, robot_name="")
No description provided!

moveByAngleThrottleAsync

MultirotorClient.moveByAngleThrottleAsync( pitch, roll, throttle, yaw_rate, duration, robot_name="" )
No description provided!

moveByVelocityAsync

MultirotorClient.moveByVelocityAsync( vx, vy, vz, duration, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), robot_name="", )
No description provided!
Arguments
vx
float
desired velocity in world (NED) X axis
vy
float
desired velocity in world (NED) Y axis
vz
float
desired velocity in world (NED) Z axis
duration
float
Desired amount of time (seconds), to send this command for
drivetrain
DrivetrainType, optional
drivetrain
yaw_mode
YawMode, optional
yaw_mode
robot_name
str, optional
Name of the multirotor to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

moveByVelocityZAsync

MultirotorClient.moveByVelocityZAsync( vx, vy, z, duration, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), robot_name="", )
#todo: add description
Arguments
vx
_type_
description
vy
_type_
description
z
_type_
description
duration
_type_
description
drivetrain
_type_, optional
description. Defaults to DrivetrainType.MaxDegreeOfFreedom.
yaw_mode
_type_, optional
description. Defaults to YawMode().
robot_name
str, optional
description. Defaults to "".
Returns
_type_
_type_
description

moveOnPathAsync

MultirotorClient.moveOnPathAsync( path, velocity, timeout_sec=3e38, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), lookahead=-1, adaptive_lookahead=1, orientations=[], robot_name="", )
Give a list of 3D points, and the drone will move along that path at the specified velocity
Arguments
path
_type_
description
velocity
_type_
description
timeout_sec
_type_, optional
description. Defaults to 3e38.
drivetrain
_type_, optional
description. Defaults to DrivetrainType.MaxDegreeOfFreedom.
yaw_mode
_type_, optional
description. Defaults to YawMode().
lookahead
int, optional
description. Defaults to -1.
adaptive_lookahead
int, optional
description. Defaults to 1.
robot_name
str, optional
description. Defaults to "".
Returns
_type_
_type_
description

moveOnGPSPathAsync

MultirotorClient.moveOnGPSPathAsync( geopoints, orientations, velocity, timeout_sec=3e38, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), lookahead=-1, adaptive_lookahead=1, robot_name="", )
Give a list of LLA geopoints, and the drone will move along that path at the specified velocity
Arguments
path
_type_
description
velocity
_type_
description
timeout_sec
_type_, optional
description. Defaults to 3e38.
drivetrain
_type_, optional
description. Defaults to DrivetrainType.MaxDegreeOfFreedom.
yaw_mode
_type_, optional
description. Defaults to YawMode().
lookahead
int, optional
description. Defaults to -1.
adaptive_lookahead
int, optional
description. Defaults to 1.
robot_name
str, optional
description. Defaults to "".
Returns
_type_
_type_
description

moveToPositionAsync

MultirotorClient.moveToPositionAsync( x, y, z, velocity, timeout_sec=3e38, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), lookahead=-1, adaptive_lookahead=1, robot_name="", )
move the drone directly towards to a desired position in the world if possible
Arguments
x
_type_
description
y
_type_
description
z
_type_
description
velocity
_type_
description
timeout_sec
_type_, optional
description. Defaults to 3e38.
drivetrain
_type_, optional
description. Defaults to DrivetrainType.MaxDegreeOfFreedom.
yaw_mode
_type_, optional
description. Defaults to YawMode().
lookahead
int, optional
description. Defaults to -1.
adaptive_lookahead
int, optional
description. Defaults to 1.
robot_name
str, optional
description. Defaults to "".
Returns
_type_
_type_
description

moveToGPSAsync

MultirotorClient.moveToGPSAsync( lla, velocity, timeout_sec=3e38, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), lookahead=-1, adaptive_lookahead=1, robot_name="", )
No description provided!

moveToZAsync

MultirotorClient.moveToZAsync( z, velocity, timeout_sec=3e38, yaw_mode=YawMode(), lookahead=-1, adaptive_lookahead=1, robot_name="", )
No description provided!

moveByManualAsync

MultirotorClient.moveByManualAsync( vx_max, vy_max, z_min, duration, drivetrain=DrivetrainType.MaxDegreeOfFreedom, yaw_mode=YawMode(), robot_name="", )
  • Read current RC state and use it to control the robots. Parameters sets up the constraints on velocity and minimum altitude while flying. If RC state is detected to violate these constraints then that RC state would be ignored.
Arguments
vx_max
float
max velocity allowed in x direction
vy_max
float
max velocity allowed in y direction
vz_max
float
max velocity allowed in z direction
z_min
float
min z allowed for robot position
duration
float
after this duration robot would switch back to non-manual mode
drivetrain
DrivetrainType
(DrivetrainType): when ForwardOnly, robot rotates itself so that its front is always facing the direction of travel. If MaxDegreeOfFreedom then it doesn’t do that (crab-like movement)
yaw_mode
YawMode
(YawMode): Specifies if robot should face at given angle (is_rate=False) or should be rotating around its axis at given rate (is_rate=True)
robot_name
str, optional
Name of the multirotor to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

rotateToYawAsync

MultirotorClient.rotateToYawAsync(yaw, timeout_sec=3e38, margin=5, robot_name="")
No description provided!

rotateByYawRateAsync

MultirotorClient.rotateByYawRateAsync(yaw_rate, duration, robot_name="")
No description provided!

hoverAsync

MultirotorClient.hoverAsync(robot_name="")
No description provided!

moveByRC

MultirotorClient.moveByRC(rcdata=RCData(), robot_name="")
No description provided!

moveByMotorPWMsAsync

MultirotorClient.moveByMotorPWMsAsync( front_right_pwm, rear_left_pwm, front_left_pwm, rear_right_pwm, duration, robot_name="", )
  • Directly control the motors using PWM values
Arguments
front_right_pwm
float
PWM value for the front right motor (between 0.0 to 1.0)
rear_left_pwm
float
PWM value for the rear left motor (between 0.0 to 1.0)
front_left_pwm
float
PWM value for the front left motor (between 0.0 to 1.0)
rear_right_pwm
float
PWM value for the rear right motor (between 0.0 to 1.0)
duration
float
Desired amount of time (seconds), to send this command for
robot_name
str, optional
Name of the multirotor to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

moveByRollPitchYawZAsync

MultirotorClient.moveByRollPitchYawZAsync(roll, pitch, yaw, z, duration, robot_name="")
  • z is given in local NED frame of the robot.
    • Roll angle, pitch angle, and yaw angle set points are given in radians, in the body frame.
    • The body frame follows the Front Left Up (FLU) convention, and right-handedness.
    • Frame Convention:
      • X axis is along the Front direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive roll angle. | Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.
      • Y axis is along the Left direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive pitch angle. | Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.
      • Z axis is along the Up direction.
      | Clockwise rotation about this axis defines a positive yaw angle. | Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
Arguments
roll
float
Desired roll angle, in radians.
pitch
float
Desired pitch angle, in radians.
yaw
float
Desired yaw angle, in radians.
z
float
Desired Z value (in local NED frame of the robot)
duration
float
Desired amount of time (seconds), to send this command for
robot_name
str, optional
Name of the multirotor to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

moveByRollPitchYawThrottleAsync

MultirotorClient.moveByRollPitchYawThrottleAsync( roll, pitch, yaw, throttle, duration, robot_name="" )
  • Desired throttle is between 0.0 to 1.0
    • Roll angle, pitch angle, and yaw angle are given in degrees when using PX4 and in radians when using SimpleFlight, in the body frame.
    • The body frame follows the Front Left Up (FLU) convention, and right-handedness.
    • Frame Convention:
      • X axis is along the Front direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive roll angle. | Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.
      • Y axis is along the Left direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive pitch angle. | Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.
      • Z axis is along the Up direction.
      | Clockwise rotation about this axis defines a positive yaw angle. | Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
Arguments
roll
float
Desired roll angle.
pitch
float
Desired pitch angle.
yaw
float
Desired yaw angle.
throttle
float
Desired throttle (between 0.0 to 1.0)
duration
float
Desired amount of time (seconds), to send this command for
robot_name
str, optional
Name of the multirotor to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

moveByRollPitchYawrateThrottleAsync

MultirotorClient.moveByRollPitchYawrateThrottleAsync( roll, pitch, yaw_rate, throttle, duration, robot_name="" )
  • Desired throttle is between 0.0 to 1.0
    • Roll angle, pitch angle, and yaw rate set points are given in radians, in the body frame.
    • The body frame follows the Front Left Up (FLU) convention, and right-handedness.
    • Frame Convention:
      • X axis is along the Front direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive roll angle. | Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.
      • Y axis is along the Left direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive pitch angle. | Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.
      • Z axis is along the Up direction.
      | Clockwise rotation about this axis defines a positive yaw angle. | Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
Arguments
roll
float
Desired roll angle, in radians.
pitch
float
Desired pitch angle, in radians.
yaw_rate
float
Desired yaw rate, in radian per second.
throttle
float
Desired throttle (between 0.0 to 1.0)
duration
float
Desired amount of time (seconds), to send this command for
robot_name
str, optional
Name of the multirotor to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

moveByRollPitchYawrateZAsync

MultirotorClient.moveByRollPitchYawrateZAsync( roll, pitch, yaw_rate, z, duration, robot_name="" )
  • z is given in local NED frame of the robot.
    • Roll angle, pitch angle, and yaw rate set points are given in radians, in the body frame.
    • The body frame follows the Front Left Up (FLU) convention, and right-handedness.
    • Frame Convention:
      • X axis is along the Front direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive roll angle. | Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.
      • Y axis is along the Left direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive pitch angle. | Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.
      • Z axis is along the Up direction.
      | Clockwise rotation about this axis defines a positive yaw angle. | Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
Arguments
roll
float
Desired roll angle, in radians.
pitch
float
Desired pitch angle, in radians.
yaw_rate
float
Desired yaw rate, in radian per second.
z
float
Desired Z value (in local NED frame of the robot)
duration
float
Desired amount of time (seconds), to send this command for
robot_name
str, optional
Name of the multirotor to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

moveByAngleRatesZAsync

MultirotorClient.moveByAngleRatesZAsync( roll_rate, pitch_rate, yaw_rate, z, duration, robot_name="" )
  • z is given in local NED frame of the robot.
    • Roll rate, pitch rate, and yaw rate set points are given in radians, in the body frame.
    • The body frame follows the Front Left Up (FLU) convention, and right-handedness.
    • Frame Convention:
      • X axis is along the Front direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive roll angle. | Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.
      • Y axis is along the Left direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive pitch angle. | Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.
      • Z axis is along the Up direction.
      | Clockwise rotation about this axis defines a positive yaw angle. | Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
Arguments
roll_rate
float
Desired roll rate, in radians / second
pitch_rate
float
Desired pitch rate, in radians / second
yaw_rate
float
Desired yaw rate, in radians / second
z
float
Desired Z value (in local NED frame of the robot)
duration
float
Desired amount of time (seconds), to send this command for
robot_name
str, optional
Name of the multirotor to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

moveByAngleRatesThrottleAsync

MultirotorClient.moveByAngleRatesThrottleAsync( roll_rate, pitch_rate, yaw_rate, throttle, duration, robot_name="" )
  • Desired throttle is between 0.0 to 1.0
    • Roll rate, pitch rate, and yaw rate set points are given in radians, in the body frame.
    • The body frame follows the Front Left Up (FLU) convention, and right-handedness.
    • Frame Convention:
      • X axis is along the Front direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive roll angle. | Hence, rolling with a positive angle is equivalent to translating in the right direction, w.r.t. our FLU body frame.
      • Y axis is along the Left direction of the quadrotor.
      | Clockwise rotation about this axis defines a positive pitch angle. | Hence, pitching with a positive angle is equivalent to translating in the front direction, w.r.t. our FLU body frame.
      • Z axis is along the Up direction.
      | Clockwise rotation about this axis defines a positive yaw angle. | Hence, yawing with a positive angle is equivalent to rotated towards the left direction wrt our FLU body frame. Or in an anticlockwise fashion in the body XY / FL plane.
Arguments
roll_rate
float
Desired roll rate, in radians / second
pitch_rate
float
Desired pitch rate, in radians / second
yaw_rate
float
Desired yaw rate, in radians / second
throttle
float
Desired throttle (between 0.0 to 1.0)
duration
float
Desired amount of time (seconds), to send this command for
robot_name
str, optional
Name of the multirotor to send this command to
Returns
msgpackrpc.future.Future
msgpackrpc.future.Future
future. call .join() to wait for method to finish.

setNacellesRotation

MultirotorClient.setNacellesRotation(pitch, rate, sweep=False, robot_name="")
Set the rotation of all the Nacelles
Arguments
pitch
float
Pitch angle in degrees.
rate
float
Speed at which the angles update.
sweep
bool, optional
Whether we sweep to the target rotation, and stopping short of the target if blocked by something.
robot_name
str, optional
Robot to get the state of.

setAngleRateControllerGains

MultirotorClient.setAngleRateControllerGains( angle_rate_gains=AngleRateControllerGains(), robot_name="" )
  • Modifying these gains will have an affect on ALL move*() APIs. This is because any velocity setpoint is converted to an angle level setpoint which is tracked with an angle level controllers. That angle level setpoint is itself tracked with and angle rate controller.
    • This function should only be called if the default angle rate control PID gains need to be modified.
Arguments
angle_rate_gains
AngleRateControllerGains
(AngleRateControllerGains): angle_rate_gains
robot_name
str, optional
Name of the multirotor to send this command to

setAngleLevelControllerGains

MultirotorClient.setAngleLevelControllerGains( angle_level_gains=AngleLevelControllerGains(), robot_name="" )
  • Sets angle level controller gains (used by any API setting angle references - for ex: moveByRollPitchYawZAsync(), moveByRollPitchYawThrottleAsync(), etc)
    • Modifying these gains will also affect the behaviour of moveByVelocityAsync() API. This is because the airgen flight controller will track velocity setpoints by converting them to angle set points.
    • This function should only be called if the default angle level control PID gains need to be modified.
    • Passing AngleLevelControllerGains() sets gains to default airgen values.
Arguments
angle_level_gains
AngleLevelControllerGains
(AngleLevelControllerGains): angle_level_gains
robot_name
str, optional
Name of the multirotor to send this command to

setVelocityControllerGains

MultirotorClient.setVelocityControllerGains( velocity_gains=VelocityControllerGains(), robot_name="" )
  • Sets velocity controller gains for moveByVelocityAsync().
    • This function should only be called if the default velocity control PID gains need to be modified.
    • Passing VelocityControllerGains() sets gains to default airgen values.
Arguments
velocity_gains
VelocityControllerGains
(VelocityControllerGains): velocity_gains
robot_name
str, optional
Name of the multirotor to send this command to

setPositionControllerGains

MultirotorClient.setPositionControllerGains( position_gains=PositionControllerGains(), robot_name="" )
Sets position controller gains for moveByPositionAsync. This function should only be called if the default position control PID gains need to be modified.
Arguments
position_gains
PositionControllerGains
(PositionControllerGains): position_gains
robot_name
str, optional
Name of the multirotor to send this command to

getMultirotorState

MultirotorClient.getMultirotorState(robot_name="")
The position inside the returned MultirotorState is in the frame of the robot’s starting point
Arguments
robot_name
str, optional
Robot to get the state of
Returns
MultirotorState
MultirotorState
MultirotorState

getRotorStates

MultirotorClient.getRotorStates(robot_name="")
Used to obtain the current state of all a multirotor’s rotors. The state includes the speeds, thrusts and torques for all rotors.
Arguments
robot_name
str, optional
Robot to get the rotor state of
Returns
RotorStates
RotorStates
Containing a timestamp and the speed, thrust and torque of all rotors.