commander – Send simple (low level) setpoints to CF Controller

Used for sending control setpoints to the Crazyflie

class commander.Commander(crazyflie=None)[source]

Used for sending control setpoints to the Crazyflie

Initialize the commander object. By default the commander is in +-mode (not x-mode).

send_hover_setpoint(vx, vy, yawrate, zdistance)[source]

Control mode where the height is sent as an absolute setpoint (intended to be the distance to the surface under the Crazflie), while giving x, y velocity commands in body-fixed coordinates.

vx, vy are in m/s yawrate is in degrees/s zdistance is in meters

send_notify_setpoint_stop(remain_valid_milliseconds=0)[source]

Sends a packet so that the priority of the current setpoint is the lowest non-disabled value, so any new setpoint regardless of source will overwrite it.

send_position_setpoint(x, y, z, yaw)[source]

Control mode where the position is sent as absolute (world) x,y,z coordinate in meter and the yaw is the absolute orientation.

x, y, z are in m yaw is in degrees

send_setpoint(roll, pitch, yawrate, thrust)[source]

Send a new control setpoint for roll/pitch/yaw_Rate/thrust to the copter.

The meaning of these values is dependent on the mode of the RPYT commander in the firmware. The roll, pitch and yaw can be set in a rate or absolute mode with parameter group ‘flightmode’ with variables ‘stabModeRoll’, ‘.stabModeRoll’ and ‘.stabModeRoll’. Default settings are roll, pitch, yawrate and thrust.

roll, pitch are in degrees, yawrate is in degrees/s, thrust is an integer value ranging from 10001 (next to no power) to 60000 (full power)

send_stop_setpoint()[source]

Send STOP setpoint, stopping the motors and (potentially) falling.

send_velocity_world_setpoint(vx, vy, vz, yawrate)[source]

Send Velocity in the world frame of reference setpoint with yawrate commands

vx, vy, vz are in m/s yawrate is in degrees/s

send_zdistance_setpoint(roll, pitch, yawrate, zdistance)[source]

Control mode where the height is sent as an absolute setpoint (intended to be the distance to the surface under the Crazflie), while giving roll, pitch and yaw rate commands

roll, pitch are in degrees yawrate is in degrees/s zdistance is in meters

set_client_xmode(enabled)[source]

Enable/disable the client side X-mode. When enabled this recalculates the setpoints before sending them to the Crazyflie.

Download Source