User Tools

Site Tools


doc:crazyflie:crtp:generic_setpoint

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
doc:crazyflie:crtp:generic_setpoint [2018-02-15 08:59]
arnaud
doc:crazyflie:crtp:generic_setpoint [2019-09-05 15:09]
kimberly
Line 1: Line 1:
 +<WRAP center round important 60%>
 +This page is deprecated and is moved to the main Bitcraze website. Please go to:
 +
 + [[
 +https://www.bitcraze.io/docs/crazyflie-firmware/master/ctrp_generic_setpoint/
 +]]
 +
 +</WRAP>
 +
 +
 ====== Generic Setpoint CRTP Port ====== ====== Generic Setpoint CRTP Port ======
  
Line 18: Line 28:
 |  1   | [[doc:crazyflie:crtp:generic_setpoint#velocity_world|Velocity World]] | |  1   | [[doc:crazyflie:crtp:generic_setpoint#velocity_world|Velocity World]] |
 |  2   | [[doc:crazyflie:crtp:generic_setpoint#z_distance|Z Distance]] | |  2   | [[doc:crazyflie:crtp:generic_setpoint#z_distance|Z Distance]] |
 +|  3   | [[doc:crazyflie:crtp:generic_setpoint#cppm_emulation|CPPM Emulation]] |
 +|  4   | [[doc:crazyflie:crtp:generic_setpoint#altitude_hold|Altitude Hold]] |
 +|  5   | [[doc:crazyflie:crtp:generic_setpoint#hover|Hover]] |
 +|  6   | [[doc:crazyflie:crtp:generic_setpoint#full_state|Full State]] |
 +|  7   | [[doc:crazyflie:crtp:generic_setpoint#position|Position]] |
 +
  
 ==== Stop ==== ==== Stop ====
Line 51: Line 67:
 </code> </code>
  
 +==== 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: set high to enable self-leveling, low to disable
 +
 +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));
 +</code>
 +
 +==== 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;         // deg/s
 +  float zVelocity;       // m/s in the world frame of reference
 +} __attribute__((packed));
 +</code>
 +
 +==== 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;      // deg/s
 +  float zDistance;    // m in the world frame of reference
 +} __attribute__((packed));
 +</code>
 +
 +==== 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;  // angular velocity - milliradians / sec
 +  int16_t ratePitch; //  (NOTE: limits to about 5 full circles per sec.
 +  int16_t rateYaw;   //   may not be enough for extremely aggressive flight.)
 +} __attribute__((packed));
 +</code>
 +
 +=== Position ===
 +
 +Set the absolute postition and orientation.
 +
 +<code c>
 + struct positionPacket_s {
 +   float x;     // Position in m
 +   float y;
 +   float z;
 +   float yaw;   // Orientation in degree
 + } __attribute__((packed));
 +</code>
  
doc/crazyflie/crtp/generic_setpoint.txt · Last modified: 2020-05-12 14:19 by kimberly