This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
doc:crazyflie:crtp:generic_setpoint [2017-02-18 12:33] arnaud created |
doc:crazyflie:crtp:generic_setpoint [2020-05-12 14:19] kimberly |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <WRAP center round important 60%> | ||
+ | This page has deprecated and moved to the new documentation framework of the main Bitcraze website. Please go to [[https:// | ||
+ | </ | ||
+ | |||
+ | |||
====== Generic Setpoint CRTP Port ====== | ====== Generic Setpoint CRTP Port ====== | ||
Line 4: | Line 9: | ||
^ Port ^ Channel | ^ Port ^ Channel | ||
- | | 7 | + | | 7 |
===== Generic setpoint ===== | ===== Generic setpoint ===== | ||
Generic setpoint packet format: | Generic setpoint packet format: | ||
- | ^ Byte ^ Value ^ Note ^ | + | ^ Byte ^ Value ^ Note ^ |
| | | | ||
- | | | + | | |
Defined IDs: | Defined IDs: | ||
^ ID ^ Type ^ | ^ ID ^ Type ^ | ||
- | | 0 | stop | | + | | 0 |
- | | 1 | Velocity World | | + | | 1 | [[doc: |
+ | | 2 | [[doc: | ||
+ | | 3 | [[doc: | ||
+ | | 4 | [[doc: | ||
+ | | 5 | [[doc: | ||
+ | | 6 | [[doc: | ||
+ | | 7 | [[doc: | ||
==== Stop ==== | ==== Stop ==== | ||
Line 26: | Line 38: | ||
Velocity setpoint in the world coordinate together with a YAW rotation speed. Useful for a teleop mode in a local positioning system. | Velocity setpoint in the world coordinate together with a YAW rotation speed. Useful for a teleop mode in a local positioning system. | ||
- | Format: | + | Payload format: |
<code c> | <code c> | ||
struct velocityPacket_s { | struct velocityPacket_s { | ||
Line 32: | Line 44: | ||
float vy; // ... | float vy; // ... | ||
float vz; // ... | float vz; // ... | ||
- | float yawrate; | + | float yawrate; |
} __attribute__((packed)); | } __attribute__((packed)); | ||
</ | </ | ||
+ | ==== Z Distance ==== | ||
+ | Set the Crazyflie absolute height and roll/pitch angles. Used for Z-ranger. | ||
+ | |||
+ | Payload format: | ||
+ | <code c> | ||
+ | struct zDistancePacket_s { | ||
+ | float roll; // deg | ||
+ | float pitch; | ||
+ | float yawrate; | ||
+ | float zDistance; | ||
+ | } __attribute__((packed)); | ||
+ | </ | ||
+ | |||
+ | ==== CPPM Emulation ==== | ||
+ | |||
+ | CRTP packet containing an emulation of CPPM channels | ||
+ | Channels have a range of 1000-2000 with a midpoint of 1500 | ||
+ | Supports the ordinary RPYT channels plus up to MAX_AUX_RC_CHANNELS auxiliary channels. | ||
+ | Auxiliary channels are optional and transmitters do not have to transmit all the data | ||
+ | unless a given channel is actually in use (numAuxChannels must be set accordingly) | ||
+ | |||
+ | Current aux channel assignments: | ||
+ | * AuxChannel0: | ||
+ | |||
+ | Payload format: | ||
+ | <code c> | ||
+ | #define MAX_AUX_RC_CHANNELS 10 | ||
+ | |||
+ | static float s_CppmEmuRollMaxRateDps = 720.0f; // For rate mode | ||
+ | static float s_CppmEmuPitchMaxRateDps = 720.0f; // For rate mode | ||
+ | static float s_CppmEmuRollMaxAngleDeg = 50.0f; // For level mode | ||
+ | static float s_CppmEmuPitchMaxAngleDeg = 50.0f; // For level mode | ||
+ | static float s_CppmEmuYawMaxRateDps = 400.0f; // Used regardless of flight mode | ||
+ | |||
+ | struct cppmEmuPacket_s { | ||
+ | struct { | ||
+ | uint8_t numAuxChannels : 4; // Set to 0 through MAX_AUX_RC_CHANNELS | ||
+ | uint8_t reserved : 4; | ||
+ | } hdr; | ||
+ | uint16_t channelRoll; | ||
+ | uint16_t channelPitch; | ||
+ | uint16_t channelYaw; | ||
+ | uint16_t channelThrust; | ||
+ | uint16_t channelAux[MAX_AUX_RC_CHANNELS]; | ||
+ | } __attribute__((packed)); | ||
+ | </ | ||
+ | |||
+ | ==== Altitude Hold ==== | ||
+ | |||
+ | Set the Crazyflie vertical velocity and roll/pitch angle. | ||
+ | |||
+ | Payload format: | ||
+ | <code c> | ||
+ | struct altHoldPacket_s { | ||
+ | float roll; // rad | ||
+ | float pitch; | ||
+ | float yawrate; | ||
+ | float zVelocity; | ||
+ | } __attribute__((packed)); | ||
+ | </ | ||
+ | |||
+ | ==== Hover ==== | ||
+ | |||
+ | Set the Crazyflie absolute height and velocity in the body coordinate system. | ||
+ | |||
+ | Payload format: | ||
+ | <code c> | ||
+ | struct hoverPacket_s { | ||
+ | float vx; // m/s in the body frame of reference | ||
+ | float vy; // ... | ||
+ | float yawrate; | ||
+ | float zDistance; | ||
+ | } __attribute__((packed)); | ||
+ | </ | ||
+ | |||
+ | ==== Full State ==== | ||
+ | |||
+ | Set the full state. | ||
+ | |||
+ | Payload format: | ||
+ | <code c> | ||
+ | struct fullStatePacket_s { | ||
+ | int16_t x; // position - mm | ||
+ | int16_t y; | ||
+ | int16_t z; | ||
+ | int16_t vx; // velocity - mm / sec | ||
+ | int16_t vy; | ||
+ | int16_t vz; | ||
+ | int16_t ax; // acceleration - mm / sec^2 | ||
+ | int16_t ay; | ||
+ | int16_t az; | ||
+ | int32_t quat; // compressed quaternion, see quatcompress.h | ||
+ | int16_t rateRoll; | ||
+ | int16_t ratePitch; // (NOTE: limits to about 5 full circles per sec. | ||
+ | int16_t rateYaw; | ||
+ | } __attribute__((packed)); | ||
+ | </ | ||
+ | |||
+ | === Position === | ||
+ | |||
+ | Set the absolute postition and orientation. | ||
+ | |||
+ | <code c> | ||
+ | | ||
+ | float x; // Position in m | ||
+ | float y; | ||
+ | float z; | ||
+ | float yaw; // Orientation in degree | ||
+ | } __attribute__((packed)); | ||
+ | </ | ||