8 #define CHECKSIZE(s) static_assert(sizeof(s) <= CRTP_MAXSIZE, #s " packet is too large"); 9 #define CHECKSIZE_WITH_STATE(s, stateSize) static_assert(sizeof(s) - stateSize <= CRTP_MAXSIZE, #s " packet is too large"); 12 #define CHECKSIZE_RESPONSE(s) static_assert(sizeof(s) <= CRTP_MAXSIZE_RESPONSE, #s " packet is too large"); 56 const uint8_t
cmd = 0xFF;
110 return response.
size > 5 &&
112 response.
data[1] == 0;
135 bool operator==(
const crtpParamTocGetInfoRequest& other)
const {
149 return response.
size == 7 &&
151 response.
data[1] == 1;
160 struct crtpParamValueResponse;
199 struct crtpParamValueResponse
202 return response.
size > 2 &&
211 uint16_t valueUint16;
213 uint32_t valueUint32;
232 bool operator==(
const crtpParamTocGetItemV2Request& other)
const {
247 return response.
size > 5 &&
249 response.
data[1] == 2;
272 bool operator==(
const crtpParamTocGetInfoV2Request& other)
const {
286 return response.
size == 8 &&
288 response.
data[1] == 3;
297 struct crtpParamValueV2Response;
336 struct crtpParamValueV2Response
339 return response.
size > 2 &&
349 uint16_t valueUint16;
351 uint32_t valueUint32;
393 struct crtpParamSetByNameResponse
396 return response.
size > 2 &&
412 struct crtpSetpointRequest
453 response.
data[1] == 1;
487 return response.
size > 2 &&
489 response.
data[1] == 2;
521 return response.
size > 2 &&
553 return response.
size > 2 &&
589 return response.
size == 9 &&
591 response.
data[1] == 1;
631 return response.
size > 5 &&
633 response.
data[1] == 0;
750 return response.
size == 4 &&
764 return response.
size > 4 &&
786 bool operator==(
const crtpLogGetInfoV2Request& other)
const {
800 return response.
size == 10 &&
802 response.
data[1] == 3;
827 bool operator==(
const crtpLogGetItemV2Request& other)
const {
842 return response.
size > 6 &&
844 response.
data[1] == 2;
1042 float x,
float y,
float z,
1043 float vx,
float vy,
float vz,
1044 float ax,
float ay,
float az,
1045 float qx,
float qy,
float qz,
float qw,
1046 float rollRate,
float pitchRate,
float yawRate);
1069 : header(0X07, 0), type(1), x(x), y(y), z(z), yawRate(yawRate)
1084 : header(0x07, 1), type(0), remainValidMillisecs(remainValidMillisecs)
1101 , groupMask(groupMask)
1119 , groupMask(groupMask)
1121 , duration(duration)
1141 , groupMask(groupMask)
1143 , duration(duration)
1161 , groupMask(groupMask)
1183 , groupMask(groupMask)
1184 , relative(relative)
1189 , duration(duration)
1215 , groupMask(groupMask)
1216 , relative(relative)
1217 , reversed(reversed)
1218 , trajectoryId(trajectoryId)
1219 , timescale(timescale)
1263 , trajectoryId(trajectoryId)
crtpParamWriteRequest(uint8_t id, const T &value)
crtpHoverSetpointRequest(float vx, float vy, float yawrate, float zDistance)
crtpParamTocGetItemResponse Response
crtpLogGetInfoResponse Response
static int const CRTP_MAXSIZE_RESPONSE
bool operator==(const crtpParamTocGetItemRequest &other) const
uint8_t responseSize() const
uint32_t remainValidMillisecs
crtpGetFirmwareVersionRequest request
bool operator==(const crtpLogGetItemRequest &other) const
crtpMemoryGetNumberRequest()
crtpLogGetInfoV2Response Response
crtpLogGetItemResponse Response
bool operator==(const crtpParamTocGetInfoRequest &other) const
crtpLogGetItemV2Request(uint16_t id)
static bool match(const Crazyradio::Ack &response)
crtpParamTocGetInfoV2Response Response
bool operator==(const crtpParamReadRequest &other) const
crtpParamTocGetItemV2Request request
bool operator==(const crtpLogGetInfoV2Request &other) const
crtpLogAppendBlockV2Request()
crtpParamTocGetInfoV2Request()
crtpParamTocGetItemRequest request
crtpFullStateSetpointRequest(float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, float qx, float qy, float qz, float qw, float rollRate, float pitchRate, float yawRate)
crtpLogGetItemV2Response Response
#define CHECKSIZE_WITH_STATE(s, stateSize)
static bool match(const Crazyradio::Ack &response)
static bool match(const Crazyradio::Ack &response)
#define CHECKSIZE_RESPONSE(s)
crtpCommanderHighLevelStopRequest(uint8_t groupMask)
static bool match(const Crazyradio::Ack &response)
crtpExternalPositionPacked()
bool operator==(const crtpLogGetItemV2Request &other) const
crtpParamSetByNameRequest(const char *group, const char *name, const T &value)
crtpLogGetItemRequest(uint8_t id)
constexpr crtp(uint8_t port, uint8_t channel)
bool operator==(const crtpParamTocGetItemV2Request &other) const
crtpCommanderHighLevelTakeoffRequest(uint8_t groupMask, float height, float duration)
crtpPositionSetpointRequest(float x, float y, float z, float yaw)
crtpGetDeviceTypeNameRequest()
static bool match(const Crazyradio::Ack &response)
static bool match(const Crazyradio::Ack &response)
crtpLogGetInfoRequest request
bool operator==(const crtpParamTocGetInfoV2Request &other) const
crtpLogStartRequest(uint8_t id, uint8_t period)
crtpParamTocGetItemResponse Response
void quatdecompress(uint32_t comp, float q[4])
uint8_t trajectoryLocation
crtpExternalPositionUpdate(float x, float y, float z)
crtpParamTocGetInfoV2Request request
crtpLogCreateBlockV2Request()
static bool match(const Crazyradio::Ack &response)
crtpCommanderHighLevelGoToRequest(uint8_t groupMask, bool relative, float x, float y, float z, float yaw, float duration)
crtpGetDeviceTypeNameRequest request
crtpLogStopRequest(uint8_t id)
static bool match(const Crazyradio::Ack &response)
static bool match(const Crazyradio::Ack &response)
crtpCommanderHighLevelDefineTrajectoryRequest(uint8_t trajectoryId)
crtpParamTocGetInfoRequest()
crtpParamWriteV2Request(uint16_t id, const T &value)
crtpCommanderHighLevelSetGroupMaskRequest(uint8_t groupMask)
static bool match(const Crazyradio::Ack &response)
crtpGetProtocolVersionRequest()
crtpParamTocGetItemRequest request
union @10 trajectoryIdentifier
crtpVelocityWorldSetpointRequest(float x, float y, float z, float yawRate)
uint8_t responseSize() const
crtpLogGetInfoRequest request
crtpParamValueResponse Response
crtpExternalPoseUpdate(float x, float y, float z, float qx, float qy, float qz, float qw)
crtpMemoryGetInfoRequest request
crtpMemoryGetInfoRequest(uint8_t memId)
crtpLogCreateBlockRequest()
uint32_t remainValidMillisecs
crtpGetFirmwareVersionRequest()
crtpParamValueV2Response Response
crtpCommanderHighLevelLandRequest(uint8_t groupMask, float height, float duration)
crtpEmergencyStopWatchdogRequest()
crtpParamTocGetInfoRequest request
static bool match(const Crazyradio::Ack &response)
crtpParamReadV2Request(uint16_t id)
crtpCommanderHighLevelStartTrajectoryRequest(uint8_t groupMask, bool relative, bool reversed, uint8_t trajectoryId, float timescale)
crtpMemoryWriteRequest(uint8_t memId, uint32_t memAddr)
static bool match(const Crazyradio::Ack &response)
crtpParamTocGetInfoResponse Response
static bool match(const Crazyradio::Ack &response)
crtpLogGetInfoV2Request()
crtpLogGetItemV2Request request
static bool match(const Crazyradio::Ack &response)
crtpGetProtocolVersionRequest request
bool operator==(const crtpParamReadV2Request &other) const
crtpMemoryReadRequest(uint8_t memId, uint32_t memAddr, uint8_t length)
static bool match(const Crazyradio::Ack &response)
static int const CRTP_MAX_DATA_SIZE
bool operator==(const crtp &other) const
crtpParamTocGetItemRequest(uint8_t id)
static int const CRTP_MAXSIZE
crtpParamReadRequest(uint8_t id)
struct trajectoryDescription description
crtpLogGetItemRequest request
crtpEmergencyStopRequest()
crtpParamTocGetItemV2Request(uint16_t id)
bool operator==(const crtpLogGetInfoRequest &other) const
crtpNotifySetpointsStopRequest(uint32_t remainValidMillisecs)