Before Width: | Height: | Size: 178 KiB |
Before Width: | Height: | Size: 232 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 278 KiB |
Before Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 354 KiB |
After Width: | Height: | Size: 374 KiB |
After Width: | Height: | Size: 380 KiB |
After Width: | Height: | Size: 397 KiB |
After Width: | Height: | Size: 354 KiB |
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 184 KiB |
After Width: | Height: | Size: 217 KiB |
After Width: | Height: | Size: 159 KiB |
After Width: | Height: | Size: 450 KiB |
After Width: | Height: | Size: 451 KiB |
After Width: | Height: | Size: 317 KiB |
After Width: | Height: | Size: 328 KiB |
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 178 KiB |
Before Width: | Height: | Size: 232 KiB After Width: | Height: | Size: 232 KiB |
After Width: | Height: | Size: 168 KiB |
After Width: | Height: | Size: 200 KiB |
After Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 280 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 278 KiB After Width: | Height: | Size: 278 KiB |
After Width: | Height: | Size: 247 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 571 KiB |
After Width: | Height: | Size: 571 KiB |
After Width: | Height: | Size: 487 KiB |
After Width: | Height: | Size: 488 KiB |
After Width: | Height: | Size: 301 KiB |
After Width: | Height: | Size: 301 KiB |
After Width: | Height: | Size: 354 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 164 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 439 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 530 KiB |
After Width: | Height: | Size: 129 KiB |
After Width: | Height: | Size: 129 KiB |
After Width: | Height: | Size: 306 B |
@ -1,56 +0,0 @@
@@ -1,56 +0,0 @@
|
||||
// MESSAGE ATTITUDE PACKING
|
||||
|
||||
#define MESSAGE_ID_ATTITUDE 90 |
||||
|
||||
/**
|
||||
* @brief Send a attitude message |
||||
* |
||||
* @param roll Roll angle (rad) |
||||
* @param pitch Pitch angle (rad) |
||||
* @param yaw Yaw angle (rad) |
||||
* @return length of the message in bytes (excluding serial stream start sign) |
||||
*/ |
||||
static inline uint16_t message_attitude_pack(uint8_t system_id, CommMessage_t* msg, float roll, float pitch, float yaw) |
||||
{ |
||||
msg->msgid = MESSAGE_ID_ATTITUDE; |
||||
uint16_t i = 0; |
||||
|
||||
i += put_float_by_index(roll, i, msg->payload); //Roll angle (rad)
|
||||
i += put_float_by_index(pitch, i, msg->payload); //Pitch angle (rad)
|
||||
i += put_float_by_index(yaw, i, msg->payload); //Yaw angle (rad)
|
||||
|
||||
return finalize_message(msg, system_id, i); |
||||
} |
||||
|
||||
// MESSAGE ATTITUDE UNPACKING
|
||||
|
||||
/**
|
||||
* @brief Get field roll from attitude message |
||||
* |
||||
* @return Roll angle (rad) |
||||
*/ |
||||
static inline float message_attitude_get_roll(CommMessage_t* msg) |
||||
{ |
||||
return *((float*) (void*)msg->payload); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field pitch from attitude message |
||||
* |
||||
* @return Pitch angle (rad) |
||||
*/ |
||||
static inline float message_attitude_get_pitch(CommMessage_t* msg) |
||||
{ |
||||
return *((float*) (void*)msg->payload+sizeof(float)); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field yaw from attitude message |
||||
* |
||||
* @return Yaw angle (rad) |
||||
*/ |
||||
static inline float message_attitude_get_yaw(CommMessage_t* msg) |
||||
{ |
||||
return *((float*) (void*)msg->payload+sizeof(float)+sizeof(float)); |
||||
} |
||||
|
@ -1,89 +0,0 @@
@@ -1,89 +0,0 @@
|
||||
// MESSAGE ATTITUDE2 PACKING
|
||||
|
||||
#define MESSAGE_ID_ATTITUDE2 90 |
||||
|
||||
typedef struct __attitude2_t
|
||||
{ |
||||
float roll; ///< Roll angle (rad)
|
||||
float pitch; ///< Pitch angle (rad)
|
||||
float yaw; ///< Yaw angle (rad)
|
||||
|
||||
} attitude2_t; |
||||
|
||||
/**
|
||||
* @brief Send a attitude2 message |
||||
* |
||||
* @param roll Roll angle (rad) |
||||
* @param pitch Pitch angle (rad) |
||||
* @param yaw Yaw angle (rad) |
||||
* @return length of the message in bytes (excluding serial stream start sign) |
||||
*/ |
||||
static inline uint16_t message_attitude2_pack(uint8_t system_id, CommMessage_t* msg, float roll, float pitch, float yaw) |
||||
{ |
||||
msg->msgid = MESSAGE_ID_ATTITUDE2; |
||||
uint16_t i = 0; |
||||
|
||||
i += put_float_by_index(roll, i, msg->payload); //Roll angle (rad)
|
||||
i += put_float_by_index(pitch, i, msg->payload); //Pitch angle (rad)
|
||||
i += put_float_by_index(yaw, i, msg->payload); //Yaw angle (rad)
|
||||
|
||||
return finalize_message(msg, system_id, i); |
||||
} |
||||
|
||||
static inline uint16_t message_attitude2_encode(uint8_t system_id, CommMessage_t* msg, const attitude2_t* attitude2) |
||||
{ |
||||
message_attitude2_pack(system_id, msg, attitude2->roll, attitude2->pitch, attitude2->yaw); |
||||
} |
||||
// MESSAGE ATTITUDE2 UNPACKING
|
||||
|
||||
/**
|
||||
* @brief Get field roll from attitude2 message |
||||
* |
||||
* @return Roll angle (rad) |
||||
*/ |
||||
static inline float message_attitude2_get_roll(CommMessage_t* msg) |
||||
{ |
||||
generic_32bit r; |
||||
r.b[3] = (msg->payload)[0]; |
||||
r.b[2] = (msg->payload)[1]; |
||||
r.b[1] = (msg->payload)[2]; |
||||
r.b[0] = (msg->payload)[3]; |
||||
return (float)r.f; |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field pitch from attitude2 message |
||||
* |
||||
* @return Pitch angle (rad) |
||||
*/ |
||||
static inline float message_attitude2_get_pitch(CommMessage_t* msg) |
||||
{ |
||||
generic_32bit r; |
||||
r.b[3] = (msg->payload+sizeof(float))[0]; |
||||
r.b[2] = (msg->payload+sizeof(float))[1]; |
||||
r.b[1] = (msg->payload+sizeof(float))[2]; |
||||
r.b[0] = (msg->payload+sizeof(float))[3]; |
||||
return (float)r.f; |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field yaw from attitude2 message |
||||
* |
||||
* @return Yaw angle (rad) |
||||
*/ |
||||
static inline float message_attitude2_get_yaw(CommMessage_t* msg) |
||||
{ |
||||
generic_32bit r; |
||||
r.b[3] = (msg->payload+sizeof(float)+sizeof(float))[0]; |
||||
r.b[2] = (msg->payload+sizeof(float)+sizeof(float))[1]; |
||||
r.b[1] = (msg->payload+sizeof(float)+sizeof(float))[2]; |
||||
r.b[0] = (msg->payload+sizeof(float)+sizeof(float))[3]; |
||||
return (float)r.f; |
||||
} |
||||
|
||||
static inline void message_attitude2_decode(CommMessage_t* msg, attitude2_t* attitude2) |
||||
{ |
||||
attitude2->roll = message_attitude2_get_roll(msg); |
||||
attitude2->pitch = message_attitude2_get_pitch(msg); |
||||
attitude2->yaw = message_attitude2_get_yaw(msg); |
||||
} |
@ -1,32 +0,0 @@
@@ -1,32 +0,0 @@
|
||||
// MESSAGE BOOT PACKING
|
||||
|
||||
#define MESSAGE_ID_BOOT 1 |
||||
|
||||
/**
|
||||
* @brief Send a boot message |
||||
* |
||||
* @param version The onboard software version |
||||
* @return length of the message in bytes (excluding serial stream start sign) |
||||
*/ |
||||
static inline uint16_t message_boot_pack(uint8_t system_id, CommMessage_t* msg, uint32 version) |
||||
{ |
||||
msg->msgid = MESSAGE_ID_BOOT; |
||||
uint16_t i = 0; |
||||
|
||||
i += put_uint32_by_index(version, i, msg->payload); //The onboard software version
|
||||
|
||||
return finalize_message(msg, system_id, i); |
||||
} |
||||
|
||||
// MESSAGE BOOT UNPACKING
|
||||
|
||||
/**
|
||||
* @brief Get field version from boot message |
||||
* |
||||
* @return The onboard software version |
||||
*/ |
||||
static inline uint32 message_boot_get_version(CommMessage_t* msg) |
||||
{ |
||||
return *((uint32*) (void*)msg->payload); |
||||
} |
||||
|
@ -1,46 +0,0 @@
@@ -1,46 +0,0 @@
|
||||
// MESSAGE BOOT2 PACKING
|
||||
|
||||
#define MESSAGE_ID_BOOT2 1 |
||||
|
||||
typedef struct __boot2_t
|
||||
{ |
||||
uint32 version; ///< The onboard software version
|
||||
|
||||
} boot2_t; |
||||
|
||||
/**
|
||||
* @brief Send a boot2 message |
||||
* |
||||
* @param version The onboard software version |
||||
* @return length of the message in bytes (excluding serial stream start sign) |
||||
*/ |
||||
static inline uint16_t message_boot2_pack(uint8_t system_id, CommMessage_t* msg, uint32 version) |
||||
{ |
||||
msg->msgid = MESSAGE_ID_BOOT2; |
||||
uint16_t i = 0; |
||||
|
||||
i += put_uint32_by_index(version, i, msg->payload); //The onboard software version
|
||||
|
||||
return finalize_message(msg, system_id, i); |
||||
} |
||||
|
||||
static inline uint16_t message_boot2_encode(uint8_t system_id, CommMessage_t* msg, const boot2_t* boot2) |
||||
{ |
||||
message_boot2_pack(system_id, msg, boot2->version); |
||||
} |
||||
// MESSAGE BOOT2 UNPACKING
|
||||
|
||||
/**
|
||||
* @brief Get field version from boot2 message |
||||
* |
||||
* @return The onboard software version |
||||
*/ |
||||
static inline uint32 message_boot2_get_version(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
static inline void message_boot2_decode(CommMessage_t* msg, boot2_t* boot2) |
||||
{ |
||||
boot2->version = message_boot2_get_version(msg); |
||||
} |
@ -1,32 +0,0 @@
@@ -1,32 +0,0 @@
|
||||
// MESSAGE HEARTBEAT PACKING
|
||||
|
||||
#define MESSAGE_ID_HEARTBEAT 0 |
||||
|
||||
/**
|
||||
* @brief Send a heartbeat message |
||||
* |
||||
* @param type Type of the MAV (quadrotor, helicopter, etc.) |
||||
* @return length of the message in bytes (excluding serial stream start sign) |
||||
*/ |
||||
static inline uint16_t message_heartbeat_pack(uint8_t system_id, CommMessage_t* msg, uint8 type) |
||||
{ |
||||
msg->msgid = MESSAGE_ID_HEARTBEAT; |
||||
uint16_t i = 0; |
||||
|
||||
i += put_uint8_by_index(type, i, msg->payload); //Type of the MAV (quadrotor, helicopter, etc.)
|
||||
|
||||
return finalize_message(msg, system_id, i); |
||||
} |
||||
|
||||
// MESSAGE HEARTBEAT UNPACKING
|
||||
|
||||
/**
|
||||
* @brief Get field type from heartbeat message |
||||
* |
||||
* @return Type of the MAV (quadrotor, helicopter, etc.) |
||||
*/ |
||||
static inline uint8 message_heartbeat_get_type(CommMessage_t* msg) |
||||
{ |
||||
return *((uint8*) (void*)msg->payload); |
||||
} |
||||
|
@ -1,46 +0,0 @@
@@ -1,46 +0,0 @@
|
||||
// MESSAGE HEARTBEAT2 PACKING
|
||||
|
||||
#define MESSAGE_ID_HEARTBEAT2 0 |
||||
|
||||
typedef struct __heartbeat2_t
|
||||
{ |
||||
uint8 type; ///< Type of the MAV (quadrotor, helicopter, etc.)
|
||||
|
||||
} heartbeat2_t; |
||||
|
||||
/**
|
||||
* @brief Send a heartbeat2 message |
||||
* |
||||
* @param type Type of the MAV (quadrotor, helicopter, etc.) |
||||
* @return length of the message in bytes (excluding serial stream start sign) |
||||
*/ |
||||
static inline uint16_t message_heartbeat2_pack(uint8_t system_id, CommMessage_t* msg, uint8 type) |
||||
{ |
||||
msg->msgid = MESSAGE_ID_HEARTBEAT2; |
||||
uint16_t i = 0; |
||||
|
||||
i += put_uint8_by_index(type, i, msg->payload); //Type of the MAV (quadrotor, helicopter, etc.)
|
||||
|
||||
return finalize_message(msg, system_id, i); |
||||
} |
||||
|
||||
static inline uint16_t message_heartbeat2_encode(uint8_t system_id, CommMessage_t* msg, const heartbeat2_t* heartbeat2) |
||||
{ |
||||
message_heartbeat2_pack(system_id, msg, heartbeat2->type); |
||||
} |
||||
// MESSAGE HEARTBEAT2 UNPACKING
|
||||
|
||||
/**
|
||||
* @brief Get field type from heartbeat2 message |
||||
* |
||||
* @return Type of the MAV (quadrotor, helicopter, etc.) |
||||
*/ |
||||
static inline uint8 message_heartbeat2_get_type(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
static inline void message_heartbeat2_decode(CommMessage_t* msg, heartbeat2_t* heartbeat2) |
||||
{ |
||||
heartbeat2->type = message_heartbeat2_get_type(msg); |
||||
} |
@ -1,164 +0,0 @@
@@ -1,164 +0,0 @@
|
||||
// MESSAGE SENSRAW PACKING
|
||||
|
||||
#define MESSAGE_ID_SENSRAW 100 |
||||
|
||||
/**
|
||||
* @brief Send a sensraw message |
||||
* |
||||
* @param xacc X acceleration (mg raw) |
||||
* @param yacc Y acceleration (mg raw) |
||||
* @param zacc Z acceleration (mg raw) |
||||
* @param xgyro Angular speed around X axis (adc units) |
||||
* @param ygyro Angular speed around Y axis (adc units) |
||||
* @param zgyro Angular speed around Z axis (adc units) |
||||
* @param xmag
|
||||
* @param ymag
|
||||
* @param zmag
|
||||
* @param baro
|
||||
* @param gdist
|
||||
* @param temp
|
||||
* @return length of the message in bytes (excluding serial stream start sign) |
||||
*/ |
||||
static inline uint16_t message_sensraw_pack(uint8_t system_id, CommMessage_t* msg, uint32 xacc, uint32 yacc, uint32 zacc, uint32 xgyro, uint32 ygyro, uint32 zgyro, uint32 xmag, uint32 ymag, uint32 zmag, int32 baro, uint32 gdist, int32 temp) |
||||
{ |
||||
msg->msgid = MESSAGE_ID_SENSRAW; |
||||
uint16_t i = 0; |
||||
|
||||
i += put_uint32_by_index(xacc, i, msg->payload); //X acceleration (mg raw)
|
||||
i += put_uint32_by_index(yacc, i, msg->payload); //Y acceleration (mg raw)
|
||||
i += put_uint32_by_index(zacc, i, msg->payload); //Z acceleration (mg raw)
|
||||
i += put_uint32_by_index(xgyro, i, msg->payload); //Angular speed around X axis (adc units)
|
||||
i += put_uint32_by_index(ygyro, i, msg->payload); //Angular speed around Y axis (adc units)
|
||||
i += put_uint32_by_index(zgyro, i, msg->payload); //Angular speed around Z axis (adc units)
|
||||
i += put_uint32_by_index(xmag, i, msg->payload); //
|
||||
i += put_uint32_by_index(ymag, i, msg->payload); //
|
||||
i += put_uint32_by_index(zmag, i, msg->payload); //
|
||||
i += put_int32_by_index(baro, i, msg->payload); //
|
||||
i += put_uint32_by_index(gdist, i, msg->payload); //
|
||||
i += put_int32_by_index(temp, i, msg->payload); //
|
||||
|
||||
return finalize_message(msg, system_id, i); |
||||
} |
||||
|
||||
// MESSAGE SENSRAW UNPACKING
|
||||
|
||||
/**
|
||||
* @brief Get field xacc from sensraw message |
||||
* |
||||
* @return X acceleration (mg raw) |
||||
*/ |
||||
static inline uint32 message_sensraw_get_xacc(CommMessage_t* msg) |
||||
{ |
||||
return *((uint32*) (void*)msg->payload); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field yacc from sensraw message |
||||
* |
||||
* @return Y acceleration (mg raw) |
||||
*/ |
||||
static inline uint32 message_sensraw_get_yacc(CommMessage_t* msg) |
||||
{ |
||||
return *((uint32*) (void*)msg->payload+sizeof(uint32)); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field zacc from sensraw message |
||||
* |
||||
* @return Z acceleration (mg raw) |
||||
*/ |
||||
static inline uint32 message_sensraw_get_zacc(CommMessage_t* msg) |
||||
{ |
||||
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field xgyro from sensraw message |
||||
* |
||||
* @return Angular speed around X axis (adc units) |
||||
*/ |
||||
static inline uint32 message_sensraw_get_xgyro(CommMessage_t* msg) |
||||
{ |
||||
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field ygyro from sensraw message |
||||
* |
||||
* @return Angular speed around Y axis (adc units) |
||||
*/ |
||||
static inline uint32 message_sensraw_get_ygyro(CommMessage_t* msg) |
||||
{ |
||||
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field zgyro from sensraw message |
||||
* |
||||
* @return Angular speed around Z axis (adc units) |
||||
*/ |
||||
static inline uint32 message_sensraw_get_zgyro(CommMessage_t* msg) |
||||
{ |
||||
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field xmag from sensraw message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline uint32 message_sensraw_get_xmag(CommMessage_t* msg) |
||||
{ |
||||
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field ymag from sensraw message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline uint32 message_sensraw_get_ymag(CommMessage_t* msg) |
||||
{ |
||||
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field zmag from sensraw message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline uint32 message_sensraw_get_zmag(CommMessage_t* msg) |
||||
{ |
||||
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field baro from sensraw message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline int32 message_sensraw_get_baro(CommMessage_t* msg) |
||||
{ |
||||
return *((int32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field gdist from sensraw message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline uint32 message_sensraw_get_gdist(CommMessage_t* msg) |
||||
{ |
||||
return *((uint32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(int32)); |
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field temp from sensraw message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline int32 message_sensraw_get_temp(CommMessage_t* msg) |
||||
{ |
||||
return *((int32*) (void*)msg->payload+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(uint32)+sizeof(int32)+sizeof(uint32)); |
||||
} |
||||
|
@ -1,200 +0,0 @@
@@ -1,200 +0,0 @@
|
||||
// MESSAGE SENSRAW2 PACKING
|
||||
|
||||
#define MESSAGE_ID_SENSRAW2 100 |
||||
|
||||
typedef struct __sensraw2_t
|
||||
{ |
||||
uint32 xacc; ///< X acceleration (mg raw)
|
||||
uint32 yacc; ///< Y acceleration (mg raw)
|
||||
uint32 zacc; ///< Z acceleration (mg raw)
|
||||
uint32 xgyro; ///< Angular speed around X axis (adc units)
|
||||
uint32 ygyro; ///< Angular speed around Y axis (adc units)
|
||||
uint32 zgyro; ///< Angular speed around Z axis (adc units)
|
||||
uint32 xmag; ///<
|
||||
uint32 ymag; ///<
|
||||
uint32 zmag; ///<
|
||||
int32 baro; ///<
|
||||
uint32 gdist; ///<
|
||||
int32 temp; ///<
|
||||
|
||||
} sensraw2_t; |
||||
|
||||
/**
|
||||
* @brief Send a sensraw2 message |
||||
* |
||||
* @param xacc X acceleration (mg raw) |
||||
* @param yacc Y acceleration (mg raw) |
||||
* @param zacc Z acceleration (mg raw) |
||||
* @param xgyro Angular speed around X axis (adc units) |
||||
* @param ygyro Angular speed around Y axis (adc units) |
||||
* @param zgyro Angular speed around Z axis (adc units) |
||||
* @param xmag
|
||||
* @param ymag
|
||||
* @param zmag
|
||||
* @param baro
|
||||
* @param gdist
|
||||
* @param temp
|
||||
* @return length of the message in bytes (excluding serial stream start sign) |
||||
*/ |
||||
static inline uint16_t message_sensraw2_pack(uint8_t system_id, CommMessage_t* msg, uint32 xacc, uint32 yacc, uint32 zacc, uint32 xgyro, uint32 ygyro, uint32 zgyro, uint32 xmag, uint32 ymag, uint32 zmag, int32 baro, uint32 gdist, int32 temp) |
||||
{ |
||||
msg->msgid = MESSAGE_ID_SENSRAW2; |
||||
uint16_t i = 0; |
||||
|
||||
i += put_uint32_by_index(xacc, i, msg->payload); //X acceleration (mg raw)
|
||||
i += put_uint32_by_index(yacc, i, msg->payload); //Y acceleration (mg raw)
|
||||
i += put_uint32_by_index(zacc, i, msg->payload); //Z acceleration (mg raw)
|
||||
i += put_uint32_by_index(xgyro, i, msg->payload); //Angular speed around X axis (adc units)
|
||||
i += put_uint32_by_index(ygyro, i, msg->payload); //Angular speed around Y axis (adc units)
|
||||
i += put_uint32_by_index(zgyro, i, msg->payload); //Angular speed around Z axis (adc units)
|
||||
i += put_uint32_by_index(xmag, i, msg->payload); //
|
||||
i += put_uint32_by_index(ymag, i, msg->payload); //
|
||||
i += put_uint32_by_index(zmag, i, msg->payload); //
|
||||
i += put_int32_by_index(baro, i, msg->payload); //
|
||||
i += put_uint32_by_index(gdist, i, msg->payload); //
|
||||
i += put_int32_by_index(temp, i, msg->payload); //
|
||||
|
||||
return finalize_message(msg, system_id, i); |
||||
} |
||||
|
||||
static inline uint16_t message_sensraw2_encode(uint8_t system_id, CommMessage_t* msg, const sensraw2_t* sensraw2) |
||||
{ |
||||
message_sensraw2_pack(system_id, msg, sensraw2->xacc, sensraw2->yacc, sensraw2->zacc, sensraw2->xgyro, sensraw2->ygyro, sensraw2->zgyro, sensraw2->xmag, sensraw2->ymag, sensraw2->zmag, sensraw2->baro, sensraw2->gdist, sensraw2->temp); |
||||
} |
||||
// MESSAGE SENSRAW2 UNPACKING
|
||||
|
||||
/**
|
||||
* @brief Get field xacc from sensraw2 message |
||||
* |
||||
* @return X acceleration (mg raw) |
||||
*/ |
||||
static inline uint32 message_sensraw2_get_xacc(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field yacc from sensraw2 message |
||||
* |
||||
* @return Y acceleration (mg raw) |
||||
*/ |
||||
static inline uint32 message_sensraw2_get_yacc(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field zacc from sensraw2 message |
||||
* |
||||
* @return Z acceleration (mg raw) |
||||
*/ |
||||
static inline uint32 message_sensraw2_get_zacc(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field xgyro from sensraw2 message |
||||
* |
||||
* @return Angular speed around X axis (adc units) |
||||
*/ |
||||
static inline uint32 message_sensraw2_get_xgyro(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field ygyro from sensraw2 message |
||||
* |
||||
* @return Angular speed around Y axis (adc units) |
||||
*/ |
||||
static inline uint32 message_sensraw2_get_ygyro(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field zgyro from sensraw2 message |
||||
* |
||||
* @return Angular speed around Z axis (adc units) |
||||
*/ |
||||
static inline uint32 message_sensraw2_get_zgyro(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field xmag from sensraw2 message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline uint32 message_sensraw2_get_xmag(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field ymag from sensraw2 message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline uint32 message_sensraw2_get_ymag(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field zmag from sensraw2 message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline uint32 message_sensraw2_get_zmag(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field baro from sensraw2 message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline int32 message_sensraw2_get_baro(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field gdist from sensraw2 message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline uint32 message_sensraw2_get_gdist(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
/**
|
||||
* @brief Get field temp from sensraw2 message |
||||
* |
||||
* @return
|
||||
*/ |
||||
static inline int32 message_sensraw2_get_temp(CommMessage_t* msg) |
||||
{ |
||||
|
||||
} |
||||
|
||||
static inline void message_sensraw2_decode(CommMessage_t* msg, sensraw2_t* sensraw2) |
||||
{ |
||||
sensraw2->xacc = message_sensraw2_get_xacc(msg); |
||||
sensraw2->yacc = message_sensraw2_get_yacc(msg); |
||||
sensraw2->zacc = message_sensraw2_get_zacc(msg); |
||||
sensraw2->xgyro = message_sensraw2_get_xgyro(msg); |
||||
sensraw2->ygyro = message_sensraw2_get_ygyro(msg); |
||||
sensraw2->zgyro = message_sensraw2_get_zgyro(msg); |
||||
sensraw2->xmag = message_sensraw2_get_xmag(msg); |
||||
sensraw2->ymag = message_sensraw2_get_ymag(msg); |
||||
sensraw2->zmag = message_sensraw2_get_zmag(msg); |
||||
sensraw2->baro = message_sensraw2_get_baro(msg); |
||||
sensraw2->gdist = message_sensraw2_get_gdist(msg); |
||||
sensraw2->temp = message_sensraw2_get_temp(msg); |
||||
} |
@ -1,19 +0,0 @@
@@ -1,19 +0,0 @@
|
||||
/** @file
|
||||
* @brief MAVLink comm protocol. |
||||
* @see http://pixhawk.ethz.ch/software/mavlink
|
||||
* Generated on Sonntag, März 21 2010, 14:05 UTC |
||||
*/ |
||||
#ifndef MAVLINK_H |
||||
#define MAVLINK_H |
||||
|
||||
#include "protocol.h" |
||||
|
||||
// TO BE REMOVED:
|
||||
#include "generated/messages.h" |
||||
|
||||
|
||||
#include "generated/mavlink_message_heartbeat2.h" |
||||
#include "generated/mavlink_message_boot2.h" |
||||
#include "generated/mavlink_message_sensraw2.h" |
||||
#include "generated/mavlink_message_attitude2.h" |
||||
#endif |
@ -1,37 +0,0 @@
@@ -1,37 +0,0 @@
|
||||
|
||||
typedef struct __heartbeat2_t |
||||
{ |
||||
uint8 type; ///< Type of the MAV (quadrotor, helicopter, etc.) |
||||
|
||||
} heartbeat2_t; |
||||
|
||||
typedef struct __boot2_t |
||||
{ |
||||
uint32 version; ///< The onboard software version |
||||
|
||||
} boot2_t; |
||||
|
||||
typedef struct __sensraw2_t |
||||
{ |
||||
uint32 xacc; ///< X acceleration (mg raw) |
||||
uint32 yacc; ///< Y acceleration (mg raw) |
||||
uint32 zacc; ///< Z acceleration (mg raw) |
||||
uint32 xgyro; ///< Angular speed around X axis (adc units) |
||||
uint32 ygyro; ///< Angular speed around Y axis (adc units) |
||||
uint32 zgyro; ///< Angular speed around Z axis (adc units) |
||||
uint32 xmag; ///< |
||||
uint32 ymag; ///< |
||||
uint32 zmag; ///< |
||||
int32 baro; ///< |
||||
uint32 gdist; ///< |
||||
int32 temp; ///< |
||||
|
||||
} sensraw2_t; |
||||
|
||||
typedef struct __attitude2_t |
||||
{ |
||||
float roll; ///< Roll angle (rad) |
||||
float pitch; ///< Pitch angle (rad) |
||||
float yaw; ///< Yaw angle (rad) |
||||
|
||||
} attitude2_t; |
@ -1,36 +0,0 @@
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0"?> |
||||
<messages> |
||||
|
||||
<message name="HEARTBEAT" id="0"> |
||||
<field name="type" type="uint8">Type of the MAV (quadrotor, helicopter, etc.)</field> |
||||
</message> |
||||
|
||||
<message name="BOOT" id="1"> |
||||
<field name="version" type="uint32">The onboard software version</field> |
||||
</message> |
||||
|
||||
<message name="RAW_SENSOR" id="100"> |
||||
<field name="xacc" type="uint32">X acceleration (mg raw)</field> |
||||
<field name="yacc" type="uint32">Y acceleration (mg raw)</field> |
||||
<field name="zacc" type="uint32">Z acceleration (mg raw)</field> |
||||
<field name="xgyro" type="uint32">Angular speed around X axis (adc units)</field> |
||||
<field name="ygyro" type="uint32">Angular speed around Y axis (adc units)</field> |
||||
<field name="zgyro" type="uint32">Angular speed around Z axis (adc units)</field> |
||||
<field name="xmag" type="uint32">X Magnetic field (milli tesla)</field> |
||||
<field name="ymag" type="uint32">Y Magnetic field (milli tesla)</field> |
||||
<field name="zmag" type="uint32">Z Magnetic field (milli tesla)</field> |
||||
<field name="baro" type="int32">Barometric pressure (hecto Pascal)</field> |
||||
<field name="gdist" type="uint32">Ground distance (meters)</field> |
||||
<field name="temp" type="int32">Temperature (degrees celcius)</field> |
||||
</message> |
||||
|
||||
<message name="ATTITUDE" id="90"> |
||||
<field name="roll" type="float">Roll angle (rad)</field> |
||||
<field name="pitch" type="float">Pitch angle (rad)</field> |
||||
<field name="yaw" type="float">Yaw angle (rad)</field> |
||||
<field name="rollspeed" type="float">Roll angular speed (rad/s)</field> |
||||
<field name="pitchspeed" type="float">Pitch angular speed (rad/s)</field> |
||||
<field name="yawspeed" type="float">Yaw angular speed (rad/s)</field> |
||||
</message> |
||||
|
||||
</messages> |
Before Width: | Height: | Size: 284 KiB |