__init__
MultirotorClient.__init__(ip="", port=41451, timeout_value=3600)
No description provided!
takeoffAsync
MultirotorClient.takeoffAsync(timeout_sec=20, vehicle_name="")
Takeoff vehicle to 3m above ground. Vehicle should not be moving when this API is used. It also clears any prior collision information by calling simGetCollisionInfo()
Arguments
landAsync
MultirotorClient.landAsync(timeout_sec=60, vehicle_name="")
goHomeAsync
MultirotorClient.goHomeAsync(timeout_sec=3e38, vehicle_name="")
Return vehicle to Home i.e. Launch location
Arguments
cancelLastTask
MultirotorClient.cancelLastTask(vehicle_name="")
moveByVelocityBodyFrameAsync
MultirotorClient.moveByVelocityBodyFrameAsync(
vx,
vy,
vz,
duration,
drivetrain=DrivetrainType.MaxDegreeOfFreedom,
yaw_mode=YawMode(),
vehicle_name="",
)
No description provided!
Arguments
desired velocity in the X axis of the vehicle’s local NED frame.
desired velocity in the Y axis of the vehicle’s local NED frame.
desired velocity in the Z axis of the vehicle’s local NED frame.
Desired amount of time (seconds), to send this command for
drivetrain
yaw_mode
Name of the multirotor to send this command to
moveByVelocityZBodyFrameAsync
MultirotorClient.moveByVelocityZBodyFrameAsync(
vx,
vy,
z,
duration,
drivetrain=DrivetrainType.MaxDegreeOfFreedom,
yaw_mode=YawMode(),
vehicle_name="",
)
No description provided!
Arguments
desired velocity in the X axis of the vehicle’s local NED frame
desired velocity in the Y axis of the vehicle’s local NED frame
desired Z value (in local NED frame of the vehicle)
Desired amount of time (seconds), to send this command for
drivetrain
yaw_mode
Name of the multirotor to send this command to
moveByAngleZAsync
MultirotorClient.moveByAngleZAsync(pitch, roll, z, yaw, duration, vehicle_name="")
No description provided!
moveByAngleThrottleAsync
MultirotorClient.moveByAngleThrottleAsync(
pitch, roll, throttle, yaw_rate, duration, vehicle_name=""
)
No description provided!
moveByVelocityAsync
MultirotorClient.moveByVelocityAsync(
vx,
vy,
vz,
duration,
drivetrain=DrivetrainType.MaxDegreeOfFreedom,
yaw_mode=YawMode(),
vehicle_name="",
)
No description provided!
Arguments
desired velocity in world (NED) X axis
desired velocity in world (NED) Y axis
desired velocity in world (NED) Z axis
Desired amount of time (seconds), to send this command for
drivetrain
yaw_mode
Name of the multirotor to send this command to
moveByVelocityZAsync
MultirotorClient.moveByVelocityZAsync(
vx,
vy,
z,
duration,
drivetrain=DrivetrainType.MaxDegreeOfFreedom,
yaw_mode=YawMode(),
vehicle_name="",
)
#todo: add description
Arguments
moveOnPathAsync
MultirotorClient.moveOnPathAsync(
path,
velocity,
timeout_sec=3e38,
drivetrain=DrivetrainType.MaxDegreeOfFreedom,
yaw_mode=YawMode(),
lookahead=-1,
adaptive_lookahead=1,
orientations=[],
vehicle_name="",
)
Give a list of 3D points, and the drone will move along that path at the specified velocity
Arguments
description
description
description. Defaults to 3e38.
description. Defaults to DrivetrainType.MaxDegreeOfFreedom.
description. Defaults to YawMode().
description. Defaults to -1.
description. Defaults to 1.
description. Defaults to "".
moveOnGPSPathAsync
MultirotorClient.moveOnGPSPathAsync(
geopoints,
orientations,
velocity,
timeout_sec=3e38,
drivetrain=DrivetrainType.MaxDegreeOfFreedom,
yaw_mode=YawMode(),
lookahead=-1,
adaptive_lookahead=1,
vehicle_name="",
)
Give a list of LLA geopoints, and the drone will move along that path at the specified velocity
Arguments
description
description
description. Defaults to 3e38.
description. Defaults to DrivetrainType.MaxDegreeOfFreedom.
description. Defaults to YawMode().
description. Defaults to -1.
description. Defaults to 1.
description. Defaults to "".
moveToPositionAsync
MultirotorClient.moveToPositionAsync(
x,
y,
z,
velocity,
timeout_sec=3e38,
drivetrain=DrivetrainType.MaxDegreeOfFreedom,
yaw_mode=YawMode(),
lookahead=-1,
adaptive_lookahead=1,
vehicle_name="",
)
move the drone directly towards to a desired position in the world if possible
Arguments
description
description
description
description
description. Defaults to 3e38.
description. Defaults to DrivetrainType.MaxDegreeOfFreedom.
description. Defaults to YawMode().
description. Defaults to -1.
description. Defaults to 1.
description. Defaults to "".
moveToGPSAsync
MultirotorClient.moveToGPSAsync(
lla,
velocity,
timeout_sec=3e38,
drivetrain=DrivetrainType.MaxDegreeOfFreedom,
yaw_mode=YawMode(),
lookahead=-1,
adaptive_lookahead=1,
vehicle_name="",
)
No description provided!
moveToZAsync
MultirotorClient.moveToZAsync(
z,
velocity,
timeout_sec=3e38,
yaw_mode=YawMode(),
lookahead=-1,
adaptive_lookahead=1,
vehicle_name="",
)
No description provided!
moveByManualAsync
MultirotorClient.moveByManualAsync(
vx_max,
vy_max,
z_min,
duration,
drivetrain=DrivetrainType.MaxDegreeOfFreedom,
yaw_mode=YawMode(),
vehicle_name="",
)
- Read current RC state and use it to control the vehicles. 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
max velocity allowed in x direction
max velocity allowed in y direction
max velocity allowed in z direction
min z allowed for vehicle position
after this duration vehicle would switch back to non-manual mode
(DrivetrainType): when ForwardOnly, vehicle rotates itself so that its front is always facing the direction of travel. If MaxDegreeOfFreedom then it doesn’t do that (crab-like movement)
(YawMode): Specifies if vehicle should face at given angle (is_rate=False) or should be rotating around its axis at given rate (is_rate=True)
Name of the multirotor to send this command to
rotateToYawAsync
MultirotorClient.rotateToYawAsync(yaw, timeout_sec=3e38, margin=5, vehicle_name="")
No description provided!
rotateByYawRateAsync
MultirotorClient.rotateByYawRateAsync(yaw_rate, duration, vehicle_name="")
No description provided!
hoverAsync
MultirotorClient.hoverAsync(vehicle_name="")
No description provided!
moveByRC
MultirotorClient.moveByRC(rcdata=RCData(), vehicle_name="")
No description provided!
moveByMotorPWMsAsync
MultirotorClient.moveByMotorPWMsAsync(
front_right_pwm,
rear_left_pwm,
front_left_pwm,
rear_right_pwm,
duration,
vehicle_name="",
)
- Directly control the motors using PWM values
Arguments
PWM value for the front right motor (between 0.0 to 1.0)
PWM value for the rear left motor (between 0.0 to 1.0)
PWM value for the front left motor (between 0.0 to 1.0)
PWM value for the rear right motor (between 0.0 to 1.0)
Desired amount of time (seconds), to send this command for
Name of the multirotor to send this command to
moveByRollPitchYawZAsync
MultirotorClient.moveByRollPitchYawZAsync(roll, pitch, yaw, z, duration, vehicle_name="")
- z is given in local NED frame of the vehicle.
- 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.
- Y axis is along the Left direction of the quadrotor.
- Z axis is along the Up direction.
Arguments
Desired roll angle, in radians.
Desired pitch angle, in radians.
Desired yaw angle, in radians.
Desired Z value (in local NED frame of the vehicle)
Desired amount of time (seconds), to send this command for
Name of the multirotor to send this command to
moveByRollPitchYawThrottleAsync
MultirotorClient.moveByRollPitchYawThrottleAsync(
roll, pitch, yaw, throttle, duration, vehicle_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.
- Y axis is along the Left direction of the quadrotor.
- Z axis is along the Up direction.
Arguments
moveByRollPitchYawrateThrottleAsync
MultirotorClient.moveByRollPitchYawrateThrottleAsync(
roll, pitch, yaw_rate, throttle, duration, vehicle_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.
- Y axis is along the Left direction of the quadrotor.
- Z axis is along the Up direction.
Arguments
Desired roll angle, in radians.
Desired pitch angle, in radians.
Desired yaw rate, in radian per second.
Desired throttle (between 0.0 to 1.0)
Desired amount of time (seconds), to send this command for
Name of the multirotor to send this command to
moveByRollPitchYawrateZAsync
MultirotorClient.moveByRollPitchYawrateZAsync(
roll, pitch, yaw_rate, z, duration, vehicle_name=""
)
- z is given in local NED frame of the vehicle.
- 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.
- Y axis is along the Left direction of the quadrotor.
- Z axis is along the Up direction.
Arguments
Desired roll angle, in radians.
Desired pitch angle, in radians.
Desired yaw rate, in radian per second.
Desired Z value (in local NED frame of the vehicle)
Desired amount of time (seconds), to send this command for
Name of the multirotor to send this command to
moveByAngleRatesZAsync
MultirotorClient.moveByAngleRatesZAsync(
roll_rate, pitch_rate, yaw_rate, z, duration, vehicle_name=""
)
- z is given in local NED frame of the vehicle.
- 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.
- Y axis is along the Left direction of the quadrotor.
- Z axis is along the Up direction.
Arguments
Desired roll rate, in radians / second
Desired pitch rate, in radians / second
Desired yaw rate, in radians / second
Desired Z value (in local NED frame of the vehicle)
Desired amount of time (seconds), to send this command for
Name of the multirotor to send this command to
moveByAngleRatesThrottleAsync
MultirotorClient.moveByAngleRatesThrottleAsync(
roll_rate, pitch_rate, yaw_rate, throttle, duration, vehicle_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.
- Y axis is along the Left direction of the quadrotor.
- Z axis is along the Up direction.
Arguments
Desired roll rate, in radians / second
Desired pitch rate, in radians / second
Desired yaw rate, in radians / second
Desired throttle (between 0.0 to 1.0)
Desired amount of time (seconds), to send this command for
Name of the multirotor to send this command to
setNacellesRotation
MultirotorClient.setNacellesRotation(pitch, rate, sweep=False, vehicle_name="")
setAngleRateControllerGains
MultirotorClient.setAngleRateControllerGains(
angle_rate_gains=AngleRateControllerGains(), vehicle_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
(AngleRateControllerGains): angle_rate_gains
Name of the multirotor to send this command to
setAngleLevelControllerGains
MultirotorClient.setAngleLevelControllerGains(
angle_level_gains=AngleLevelControllerGains(), vehicle_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
(AngleLevelControllerGains): angle_level_gains
Name of the multirotor to send this command to
setVelocityControllerGains
MultirotorClient.setVelocityControllerGains(
velocity_gains=VelocityControllerGains(), vehicle_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
(VelocityControllerGains): velocity_gains
Name of the multirotor to send this command to
setPositionControllerGains
MultirotorClient.setPositionControllerGains(
position_gains=PositionControllerGains(), vehicle_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
(PositionControllerGains): position_gains
Name of the multirotor to send this command to
getMultirotorState
MultirotorClient.getMultirotorState(vehicle_name="")
getRotorStates
MultirotorClient.getRotorStates(vehicle_name="")