Commit 0f9c74de authored by PX4BuildBot's avatar PX4BuildBot

autogenerated headers for rev...

autogenerated headers for rev https://github.com/mavlink/mavlink/tree/73cc0cd28616ce2ff94ff69c82cb20933a6f4ff7
parent 2ecb760f
...@@ -13,23 +13,26 @@ typedef struct __mavlink_distance_sensor_t { ...@@ -13,23 +13,26 @@ typedef struct __mavlink_distance_sensor_t {
uint8_t id; /*< Onboard ID of the sensor*/ uint8_t id; /*< Onboard ID of the sensor*/
uint8_t orientation; /*< Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270*/ uint8_t orientation; /*< Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270*/
uint8_t covariance; /*< [cm] Measurement covariance, 0 for unknown / invalid readings*/ uint8_t covariance; /*< [cm] Measurement covariance, 0 for unknown / invalid readings*/
float horizontal_fov; /*< [rad] Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.*/
float vertical_fov; /*< [rad] Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.*/
float quaternion[4]; /*< Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid."*/
}) mavlink_distance_sensor_t; }) mavlink_distance_sensor_t;
#define MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN 14 #define MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN 38
#define MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN 14 #define MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN 14
#define MAVLINK_MSG_ID_132_LEN 14 #define MAVLINK_MSG_ID_132_LEN 38
#define MAVLINK_MSG_ID_132_MIN_LEN 14 #define MAVLINK_MSG_ID_132_MIN_LEN 14
#define MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC 85 #define MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC 85
#define MAVLINK_MSG_ID_132_CRC 85 #define MAVLINK_MSG_ID_132_CRC 85
#define MAVLINK_MSG_DISTANCE_SENSOR_FIELD_QUATERNION_LEN 4
#if MAVLINK_COMMAND_24BIT #if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \ #define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \
132, \ 132, \
"DISTANCE_SENSOR", \ "DISTANCE_SENSOR", \
8, \ 11, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \
{ "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_distance_sensor_t, min_distance) }, \ { "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_distance_sensor_t, min_distance) }, \
{ "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \ { "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \
...@@ -38,12 +41,15 @@ typedef struct __mavlink_distance_sensor_t { ...@@ -38,12 +41,15 @@ typedef struct __mavlink_distance_sensor_t {
{ "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_distance_sensor_t, id) }, \ { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_distance_sensor_t, id) }, \
{ "orientation", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_distance_sensor_t, orientation) }, \ { "orientation", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_distance_sensor_t, orientation) }, \
{ "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \ { "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \
{ "horizontal_fov", NULL, MAVLINK_TYPE_FLOAT, 0, 14, offsetof(mavlink_distance_sensor_t, horizontal_fov) }, \
{ "vertical_fov", NULL, MAVLINK_TYPE_FLOAT, 0, 18, offsetof(mavlink_distance_sensor_t, vertical_fov) }, \
{ "quaternion", NULL, MAVLINK_TYPE_FLOAT, 4, 22, offsetof(mavlink_distance_sensor_t, quaternion) }, \
} \ } \
} }
#else #else
#define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \ #define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \
"DISTANCE_SENSOR", \ "DISTANCE_SENSOR", \
8, \ 11, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \
{ "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_distance_sensor_t, min_distance) }, \ { "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_distance_sensor_t, min_distance) }, \
{ "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \ { "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \
...@@ -52,6 +58,9 @@ typedef struct __mavlink_distance_sensor_t { ...@@ -52,6 +58,9 @@ typedef struct __mavlink_distance_sensor_t {
{ "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_distance_sensor_t, id) }, \ { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_distance_sensor_t, id) }, \
{ "orientation", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_distance_sensor_t, orientation) }, \ { "orientation", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_distance_sensor_t, orientation) }, \
{ "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \ { "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \
{ "horizontal_fov", NULL, MAVLINK_TYPE_FLOAT, 0, 14, offsetof(mavlink_distance_sensor_t, horizontal_fov) }, \
{ "vertical_fov", NULL, MAVLINK_TYPE_FLOAT, 0, 18, offsetof(mavlink_distance_sensor_t, vertical_fov) }, \
{ "quaternion", NULL, MAVLINK_TYPE_FLOAT, 4, 22, offsetof(mavlink_distance_sensor_t, quaternion) }, \
} \ } \
} }
#endif #endif
...@@ -70,10 +79,13 @@ typedef struct __mavlink_distance_sensor_t { ...@@ -70,10 +79,13 @@ typedef struct __mavlink_distance_sensor_t {
* @param id Onboard ID of the sensor * @param id Onboard ID of the sensor
* @param orientation Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270 * @param orientation Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270
* @param covariance [cm] Measurement covariance, 0 for unknown / invalid readings * @param covariance [cm] Measurement covariance, 0 for unknown / invalid readings
* @param horizontal_fov [rad] Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.
* @param vertical_fov [rad] Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.
* @param quaternion Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid."
* @return length of the message in bytes (excluding serial stream start sign) * @return length of the message in bytes (excluding serial stream start sign)
*/ */
static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance) uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance, float horizontal_fov, float vertical_fov, const float *quaternion)
{ {
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN]; char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
...@@ -85,7 +97,9 @@ static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8 ...@@ -85,7 +97,9 @@ static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8
_mav_put_uint8_t(buf, 11, id); _mav_put_uint8_t(buf, 11, id);
_mav_put_uint8_t(buf, 12, orientation); _mav_put_uint8_t(buf, 12, orientation);
_mav_put_uint8_t(buf, 13, covariance); _mav_put_uint8_t(buf, 13, covariance);
_mav_put_float(buf, 14, horizontal_fov);
_mav_put_float(buf, 18, vertical_fov);
_mav_put_float_array(buf, 22, quaternion, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
#else #else
mavlink_distance_sensor_t packet; mavlink_distance_sensor_t packet;
...@@ -97,7 +111,9 @@ static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8 ...@@ -97,7 +111,9 @@ static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8
packet.id = id; packet.id = id;
packet.orientation = orientation; packet.orientation = orientation;
packet.covariance = covariance; packet.covariance = covariance;
packet.horizontal_fov = horizontal_fov;
packet.vertical_fov = vertical_fov;
mav_array_memcpy(packet.quaternion, quaternion, sizeof(float)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
#endif #endif
...@@ -119,11 +135,14 @@ static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8 ...@@ -119,11 +135,14 @@ static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8
* @param id Onboard ID of the sensor * @param id Onboard ID of the sensor
* @param orientation Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270 * @param orientation Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270
* @param covariance [cm] Measurement covariance, 0 for unknown / invalid readings * @param covariance [cm] Measurement covariance, 0 for unknown / invalid readings
* @param horizontal_fov [rad] Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.
* @param vertical_fov [rad] Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.
* @param quaternion Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid."
* @return length of the message in bytes (excluding serial stream start sign) * @return length of the message in bytes (excluding serial stream start sign)
*/ */
static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg, mavlink_message_t* msg,
uint32_t time_boot_ms,uint16_t min_distance,uint16_t max_distance,uint16_t current_distance,uint8_t type,uint8_t id,uint8_t orientation,uint8_t covariance) uint32_t time_boot_ms,uint16_t min_distance,uint16_t max_distance,uint16_t current_distance,uint8_t type,uint8_t id,uint8_t orientation,uint8_t covariance,float horizontal_fov,float vertical_fov,const float *quaternion)
{ {
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN]; char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
...@@ -135,7 +154,9 @@ static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, ...@@ -135,7 +154,9 @@ static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id,
_mav_put_uint8_t(buf, 11, id); _mav_put_uint8_t(buf, 11, id);
_mav_put_uint8_t(buf, 12, orientation); _mav_put_uint8_t(buf, 12, orientation);
_mav_put_uint8_t(buf, 13, covariance); _mav_put_uint8_t(buf, 13, covariance);
_mav_put_float(buf, 14, horizontal_fov);
_mav_put_float(buf, 18, vertical_fov);
_mav_put_float_array(buf, 22, quaternion, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
#else #else
mavlink_distance_sensor_t packet; mavlink_distance_sensor_t packet;
...@@ -147,7 +168,9 @@ static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, ...@@ -147,7 +168,9 @@ static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id,
packet.id = id; packet.id = id;
packet.orientation = orientation; packet.orientation = orientation;
packet.covariance = covariance; packet.covariance = covariance;
packet.horizontal_fov = horizontal_fov;
packet.vertical_fov = vertical_fov;
mav_array_memcpy(packet.quaternion, quaternion, sizeof(float)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
#endif #endif
...@@ -165,7 +188,7 @@ static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, ...@@ -165,7 +188,7 @@ static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id,
*/ */
static inline uint16_t mavlink_msg_distance_sensor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor) static inline uint16_t mavlink_msg_distance_sensor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor)
{ {
return mavlink_msg_distance_sensor_pack(system_id, component_id, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance); return mavlink_msg_distance_sensor_pack(system_id, component_id, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance, distance_sensor->horizontal_fov, distance_sensor->vertical_fov, distance_sensor->quaternion);
} }
/** /**
...@@ -179,7 +202,7 @@ static inline uint16_t mavlink_msg_distance_sensor_encode(uint8_t system_id, uin ...@@ -179,7 +202,7 @@ static inline uint16_t mavlink_msg_distance_sensor_encode(uint8_t system_id, uin
*/ */
static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor) static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor)
{ {
return mavlink_msg_distance_sensor_pack_chan(system_id, component_id, chan, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance); return mavlink_msg_distance_sensor_pack_chan(system_id, component_id, chan, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance, distance_sensor->horizontal_fov, distance_sensor->vertical_fov, distance_sensor->quaternion);
} }
/** /**
...@@ -194,10 +217,13 @@ static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id ...@@ -194,10 +217,13 @@ static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id
* @param id Onboard ID of the sensor * @param id Onboard ID of the sensor
* @param orientation Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270 * @param orientation Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270
* @param covariance [cm] Measurement covariance, 0 for unknown / invalid readings * @param covariance [cm] Measurement covariance, 0 for unknown / invalid readings
* @param horizontal_fov [rad] Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.
* @param vertical_fov [rad] Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.
* @param quaternion Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid."
*/ */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance) static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance, float horizontal_fov, float vertical_fov, const float *quaternion)
{ {
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN]; char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
...@@ -209,7 +235,9 @@ static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint ...@@ -209,7 +235,9 @@ static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint
_mav_put_uint8_t(buf, 11, id); _mav_put_uint8_t(buf, 11, id);
_mav_put_uint8_t(buf, 12, orientation); _mav_put_uint8_t(buf, 12, orientation);
_mav_put_uint8_t(buf, 13, covariance); _mav_put_uint8_t(buf, 13, covariance);
_mav_put_float(buf, 14, horizontal_fov);
_mav_put_float(buf, 18, vertical_fov);
_mav_put_float_array(buf, 22, quaternion, 4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
#else #else
mavlink_distance_sensor_t packet; mavlink_distance_sensor_t packet;
...@@ -221,7 +249,9 @@ static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint ...@@ -221,7 +249,9 @@ static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint
packet.id = id; packet.id = id;
packet.orientation = orientation; packet.orientation = orientation;
packet.covariance = covariance; packet.covariance = covariance;
packet.horizontal_fov = horizontal_fov;
packet.vertical_fov = vertical_fov;
mav_array_memcpy(packet.quaternion, quaternion, sizeof(float)*4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
#endif #endif
} }
...@@ -234,7 +264,7 @@ static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint ...@@ -234,7 +264,7 @@ static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint
static inline void mavlink_msg_distance_sensor_send_struct(mavlink_channel_t chan, const mavlink_distance_sensor_t* distance_sensor) static inline void mavlink_msg_distance_sensor_send_struct(mavlink_channel_t chan, const mavlink_distance_sensor_t* distance_sensor)
{ {
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_distance_sensor_send(chan, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance); mavlink_msg_distance_sensor_send(chan, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance, distance_sensor->horizontal_fov, distance_sensor->vertical_fov, distance_sensor->quaternion);
#else #else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)distance_sensor, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)distance_sensor, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
#endif #endif
...@@ -248,7 +278,7 @@ static inline void mavlink_msg_distance_sensor_send_struct(mavlink_channel_t cha ...@@ -248,7 +278,7 @@ static inline void mavlink_msg_distance_sensor_send_struct(mavlink_channel_t cha
is usually the receive buffer for the channel, and allows a reply to an is usually the receive buffer for the channel, and allows a reply to an
incoming message with minimum stack space usage. incoming message with minimum stack space usage.
*/ */
static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance) static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance, float horizontal_fov, float vertical_fov, const float *quaternion)
{ {
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf; char *buf = (char *)msgbuf;
...@@ -260,7 +290,9 @@ static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbu ...@@ -260,7 +290,9 @@ static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbu
_mav_put_uint8_t(buf, 11, id); _mav_put_uint8_t(buf, 11, id);
_mav_put_uint8_t(buf, 12, orientation); _mav_put_uint8_t(buf, 12, orientation);
_mav_put_uint8_t(buf, 13, covariance); _mav_put_uint8_t(buf, 13, covariance);
_mav_put_float(buf, 14, horizontal_fov);
_mav_put_float(buf, 18, vertical_fov);
_mav_put_float_array(buf, 22, quaternion, 4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
#else #else
mavlink_distance_sensor_t *packet = (mavlink_distance_sensor_t *)msgbuf; mavlink_distance_sensor_t *packet = (mavlink_distance_sensor_t *)msgbuf;
...@@ -272,7 +304,9 @@ static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbu ...@@ -272,7 +304,9 @@ static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbu
packet->id = id; packet->id = id;
packet->orientation = orientation; packet->orientation = orientation;
packet->covariance = covariance; packet->covariance = covariance;
packet->horizontal_fov = horizontal_fov;
packet->vertical_fov = vertical_fov;
mav_array_memcpy(packet->quaternion, quaternion, sizeof(float)*4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
#endif #endif
} }
...@@ -363,6 +397,36 @@ static inline uint8_t mavlink_msg_distance_sensor_get_covariance(const mavlink_m ...@@ -363,6 +397,36 @@ static inline uint8_t mavlink_msg_distance_sensor_get_covariance(const mavlink_m
return _MAV_RETURN_uint8_t(msg, 13); return _MAV_RETURN_uint8_t(msg, 13);
} }
/**
* @brief Get field horizontal_fov from distance_sensor message
*
* @return [rad] Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.
*/
static inline float mavlink_msg_distance_sensor_get_horizontal_fov(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 14);
}
/**
* @brief Get field vertical_fov from distance_sensor message
*
* @return [rad] Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.
*/
static inline float mavlink_msg_distance_sensor_get_vertical_fov(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 18);
}
/**
* @brief Get field quaternion from distance_sensor message
*
* @return Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid."
*/
static inline uint16_t mavlink_msg_distance_sensor_get_quaternion(const mavlink_message_t* msg, float *quaternion)
{
return _MAV_RETURN_float_array(msg, quaternion, 4, 22);
}
/** /**
* @brief Decode a distance_sensor message into a struct * @brief Decode a distance_sensor message into a struct
* *
...@@ -380,6 +444,9 @@ static inline void mavlink_msg_distance_sensor_decode(const mavlink_message_t* m ...@@ -380,6 +444,9 @@ static inline void mavlink_msg_distance_sensor_decode(const mavlink_message_t* m
distance_sensor->id = mavlink_msg_distance_sensor_get_id(msg); distance_sensor->id = mavlink_msg_distance_sensor_get_id(msg);
distance_sensor->orientation = mavlink_msg_distance_sensor_get_orientation(msg); distance_sensor->orientation = mavlink_msg_distance_sensor_get_orientation(msg);
distance_sensor->covariance = mavlink_msg_distance_sensor_get_covariance(msg); distance_sensor->covariance = mavlink_msg_distance_sensor_get_covariance(msg);
distance_sensor->horizontal_fov = mavlink_msg_distance_sensor_get_horizontal_fov(msg);
distance_sensor->vertical_fov = mavlink_msg_distance_sensor_get_vertical_fov(msg);
mavlink_msg_distance_sensor_get_quaternion(msg, distance_sensor->quaternion);
#else #else
uint8_t len = msg->len < MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN? msg->len : MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN; uint8_t len = msg->len < MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN? msg->len : MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN;
memset(distance_sensor, 0, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); memset(distance_sensor, 0, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
......
...@@ -6133,7 +6133,7 @@ static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id ...@@ -6133,7 +6133,7 @@ static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id
uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i; uint16_t i;
mavlink_distance_sensor_t packet_in = { mavlink_distance_sensor_t packet_in = {
963497464,17443,17547,17651,163,230,41,108 963497464,17443,17547,17651,163,230,41,108,115.0,143.0,{ 171.0, 172.0, 173.0, 174.0 }
}; };
mavlink_distance_sensor_t packet1, packet2; mavlink_distance_sensor_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1)); memset(&packet1, 0, sizeof(packet1));
...@@ -6145,7 +6145,10 @@ static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id ...@@ -6145,7 +6145,10 @@ static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id
packet1.id = packet_in.id; packet1.id = packet_in.id;
packet1.orientation = packet_in.orientation; packet1.orientation = packet_in.orientation;
packet1.covariance = packet_in.covariance; packet1.covariance = packet_in.covariance;
packet1.horizontal_fov = packet_in.horizontal_fov;
packet1.vertical_fov = packet_in.vertical_fov;
mav_array_memcpy(packet1.quaternion, packet_in.quaternion, sizeof(float)*4);
#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
...@@ -6159,12 +6162,12 @@ static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id ...@@ -6159,12 +6162,12 @@ static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2)); memset(&packet2, 0, sizeof(packet2));
mavlink_msg_distance_sensor_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance ); mavlink_msg_distance_sensor_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance , packet1.horizontal_fov , packet1.vertical_fov , packet1.quaternion );
mavlink_msg_distance_sensor_decode(&msg, &packet2); mavlink_msg_distance_sensor_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2)); memset(&packet2, 0, sizeof(packet2));
mavlink_msg_distance_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance ); mavlink_msg_distance_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance , packet1.horizontal_fov , packet1.vertical_fov , packet1.quaternion );
mavlink_msg_distance_sensor_decode(&msg, &packet2); mavlink_msg_distance_sensor_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
...@@ -6177,7 +6180,7 @@ static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id ...@@ -6177,7 +6180,7 @@ static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2)); memset(&packet2, 0, sizeof(packet2));
mavlink_msg_distance_sensor_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance ); mavlink_msg_distance_sensor_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance , packet1.horizontal_fov , packet1.vertical_fov , packet1.quaternion );
mavlink_msg_distance_sensor_decode(last_msg, &packet2); mavlink_msg_distance_sensor_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
} }
......
...@@ -4247,6 +4247,10 @@ ...@@ -4247,6 +4247,10 @@
<field type="uint8_t" name="id">Onboard ID of the sensor</field> <field type="uint8_t" name="id">Onboard ID of the sensor</field>
<field type="uint8_t" name="orientation" enum="MAV_SENSOR_ORIENTATION">Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270</field> <field type="uint8_t" name="orientation" enum="MAV_SENSOR_ORIENTATION">Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270</field>
<field type="uint8_t" name="covariance" units="cm">Measurement covariance, 0 for unknown / invalid readings</field> <field type="uint8_t" name="covariance" units="cm">Measurement covariance, 0 for unknown / invalid readings</field>
<extensions/>
<field type="float" name="horizontal_fov" units="rad">Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.</field>
<field type="float" name="vertical_fov" units="rad">Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.</field>
<field type="float[4]" name="quaternion">Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid."</field>
</message> </message>
<message id="133" name="TERRAIN_REQUEST"> <message id="133" name="TERRAIN_REQUEST">
<description>Request for terrain data and terrain status</description> <description>Request for terrain data and terrain status</description>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment