添加MAVLINK协议库
This commit is contained in:
1447
app/drivers/sertrf/protocol/mavlinkv2/common/common.h
Normal file
1447
app/drivers/sertrf/protocol/mavlinkv2/common/common.h
Normal file
File diff suppressed because one or more lines are too long
34
app/drivers/sertrf/protocol/mavlinkv2/common/mavlink.h
Normal file
34
app/drivers/sertrf/protocol/mavlinkv2/common/mavlink.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/** @file
|
||||
* @brief MAVLink comm protocol built from common.xml
|
||||
* @see http://mavlink.org
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef MAVLINK_H
|
||||
#define MAVLINK_H
|
||||
|
||||
#define MAVLINK_PRIMARY_XML_IDX 1
|
||||
|
||||
#ifndef MAVLINK_STX
|
||||
#define MAVLINK_STX 253
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_ENDIAN
|
||||
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_ALIGNED_FIELDS
|
||||
#define MAVLINK_ALIGNED_FIELDS 1
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_CRC_EXTRA
|
||||
#define MAVLINK_CRC_EXTRA 1
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_COMMAND_24BIT 1
|
||||
#endif
|
||||
|
||||
#include "version.h"
|
||||
#include "common.h"
|
||||
|
||||
#endif // MAVLINK_H
|
||||
@@ -0,0 +1,255 @@
|
||||
#pragma once
|
||||
// MESSAGE ACTUATOR_CONTROL_TARGET PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET 140
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_actuator_control_target_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float controls[8]; /*< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.*/
|
||||
uint8_t group_mlx; /*< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.*/
|
||||
}) mavlink_actuator_control_target_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN 41
|
||||
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN 41
|
||||
#define MAVLINK_MSG_ID_140_LEN 41
|
||||
#define MAVLINK_MSG_ID_140_MIN_LEN 41
|
||||
|
||||
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC 181
|
||||
#define MAVLINK_MSG_ID_140_CRC 181
|
||||
|
||||
#define MAVLINK_MSG_ACTUATOR_CONTROL_TARGET_FIELD_CONTROLS_LEN 8
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET { \
|
||||
140, \
|
||||
"ACTUATOR_CONTROL_TARGET", \
|
||||
3, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \
|
||||
{ "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \
|
||||
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET { \
|
||||
"ACTUATOR_CONTROL_TARGET", \
|
||||
3, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \
|
||||
{ "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \
|
||||
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a actuator_control_target message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t group_mlx, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#else
|
||||
mavlink_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a actuator_control_target message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t group_mlx,const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#else
|
||||
mavlink_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a actuator_control_target struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param actuator_control_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
|
||||
{
|
||||
return mavlink_msg_actuator_control_target_pack(system_id, component_id, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a actuator_control_target struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param actuator_control_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
|
||||
{
|
||||
return mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, chan, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a actuator_control_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_actuator_control_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
mavlink_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a actuator_control_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_actuator_control_target_send_struct(mavlink_channel_t chan, const mavlink_actuator_control_target_t* actuator_control_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_actuator_control_target_send(chan, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)actuator_control_target, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_actuator_control_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
mavlink_actuator_control_target_t *packet = (mavlink_actuator_control_target_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet->controls, controls, sizeof(float)*8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ACTUATOR_CONTROL_TARGET UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from actuator_control_target message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_actuator_control_target_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field group_mlx from actuator_control_target message
|
||||
*
|
||||
* @return Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_actuator_control_target_get_group_mlx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field controls from actuator_control_target message
|
||||
*
|
||||
* @return Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, controls, 8, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a actuator_control_target message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param actuator_control_target C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_actuator_control_target_decode(const mavlink_message_t* msg, mavlink_actuator_control_target_t* actuator_control_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
actuator_control_target->time_usec = mavlink_msg_actuator_control_target_get_time_usec(msg);
|
||||
mavlink_msg_actuator_control_target_get_controls(msg, actuator_control_target->controls);
|
||||
actuator_control_target->group_mlx = mavlink_msg_actuator_control_target_get_group_mlx(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN? msg->len : MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN;
|
||||
memset(actuator_control_target, 0, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
memcpy(actuator_control_target, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,505 @@
|
||||
#pragma once
|
||||
// MESSAGE ADSB_VEHICLE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ADSB_VEHICLE 246
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_adsb_vehicle_t {
|
||||
uint32_t ICAO_address; /*< ICAO address*/
|
||||
int32_t lat; /*< [degE7] Latitude*/
|
||||
int32_t lon; /*< [degE7] Longitude*/
|
||||
int32_t altitude; /*< [mm] Altitude(ASL)*/
|
||||
uint16_t heading; /*< [cdeg] Course over ground*/
|
||||
uint16_t hor_velocity; /*< [cm/s] The horizontal velocity*/
|
||||
int16_t ver_velocity; /*< [cm/s] The vertical velocity. Positive is up*/
|
||||
uint16_t flags; /*< Bitmap to indicate various statuses including valid data fields*/
|
||||
uint16_t squawk; /*< Squawk code*/
|
||||
uint8_t altitude_type; /*< ADSB altitude type.*/
|
||||
char callsign[9]; /*< The callsign, 8+null*/
|
||||
uint8_t emitter_type; /*< ADSB emitter type.*/
|
||||
uint8_t tslc; /*< [s] Time since last communication in seconds*/
|
||||
}) mavlink_adsb_vehicle_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ADSB_VEHICLE_LEN 38
|
||||
#define MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN 38
|
||||
#define MAVLINK_MSG_ID_246_LEN 38
|
||||
#define MAVLINK_MSG_ID_246_MIN_LEN 38
|
||||
|
||||
#define MAVLINK_MSG_ID_ADSB_VEHICLE_CRC 184
|
||||
#define MAVLINK_MSG_ID_246_CRC 184
|
||||
|
||||
#define MAVLINK_MSG_ADSB_VEHICLE_FIELD_CALLSIGN_LEN 9
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ADSB_VEHICLE { \
|
||||
246, \
|
||||
"ADSB_VEHICLE", \
|
||||
13, \
|
||||
{ { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \
|
||||
{ "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \
|
||||
{ "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_adsb_vehicle_t, heading) }, \
|
||||
{ "hor_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_adsb_vehicle_t, hor_velocity) }, \
|
||||
{ "ver_velocity", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \
|
||||
{ "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 27, offsetof(mavlink_adsb_vehicle_t, callsign) }, \
|
||||
{ "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \
|
||||
{ "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \
|
||||
{ "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ADSB_VEHICLE { \
|
||||
"ADSB_VEHICLE", \
|
||||
13, \
|
||||
{ { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \
|
||||
{ "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \
|
||||
{ "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_adsb_vehicle_t, heading) }, \
|
||||
{ "hor_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_adsb_vehicle_t, hor_velocity) }, \
|
||||
{ "ver_velocity", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \
|
||||
{ "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 27, offsetof(mavlink_adsb_vehicle_t, callsign) }, \
|
||||
{ "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \
|
||||
{ "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \
|
||||
{ "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a adsb_vehicle message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param ICAO_address ICAO address
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param altitude_type ADSB altitude type.
|
||||
* @param altitude [mm] Altitude(ASL)
|
||||
* @param heading [cdeg] Course over ground
|
||||
* @param hor_velocity [cm/s] The horizontal velocity
|
||||
* @param ver_velocity [cm/s] The vertical velocity. Positive is up
|
||||
* @param callsign The callsign, 8+null
|
||||
* @param emitter_type ADSB emitter type.
|
||||
* @param tslc [s] Time since last communication in seconds
|
||||
* @param flags Bitmap to indicate various statuses including valid data fields
|
||||
* @param squawk Squawk code
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ICAO_address);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, altitude);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_uint16_t(buf, 18, hor_velocity);
|
||||
_mav_put_int16_t(buf, 20, ver_velocity);
|
||||
_mav_put_uint16_t(buf, 22, flags);
|
||||
_mav_put_uint16_t(buf, 24, squawk);
|
||||
_mav_put_uint8_t(buf, 26, altitude_type);
|
||||
_mav_put_uint8_t(buf, 36, emitter_type);
|
||||
_mav_put_uint8_t(buf, 37, tslc);
|
||||
_mav_put_char_array(buf, 27, callsign, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
|
||||
#else
|
||||
mavlink_adsb_vehicle_t packet;
|
||||
packet.ICAO_address = ICAO_address;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.altitude = altitude;
|
||||
packet.heading = heading;
|
||||
packet.hor_velocity = hor_velocity;
|
||||
packet.ver_velocity = ver_velocity;
|
||||
packet.flags = flags;
|
||||
packet.squawk = squawk;
|
||||
packet.altitude_type = altitude_type;
|
||||
packet.emitter_type = emitter_type;
|
||||
packet.tslc = tslc;
|
||||
mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a adsb_vehicle message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param ICAO_address ICAO address
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param altitude_type ADSB altitude type.
|
||||
* @param altitude [mm] Altitude(ASL)
|
||||
* @param heading [cdeg] Course over ground
|
||||
* @param hor_velocity [cm/s] The horizontal velocity
|
||||
* @param ver_velocity [cm/s] The vertical velocity. Positive is up
|
||||
* @param callsign The callsign, 8+null
|
||||
* @param emitter_type ADSB emitter type.
|
||||
* @param tslc [s] Time since last communication in seconds
|
||||
* @param flags Bitmap to indicate various statuses including valid data fields
|
||||
* @param squawk Squawk code
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t ICAO_address,int32_t lat,int32_t lon,uint8_t altitude_type,int32_t altitude,uint16_t heading,uint16_t hor_velocity,int16_t ver_velocity,const char *callsign,uint8_t emitter_type,uint8_t tslc,uint16_t flags,uint16_t squawk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ICAO_address);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, altitude);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_uint16_t(buf, 18, hor_velocity);
|
||||
_mav_put_int16_t(buf, 20, ver_velocity);
|
||||
_mav_put_uint16_t(buf, 22, flags);
|
||||
_mav_put_uint16_t(buf, 24, squawk);
|
||||
_mav_put_uint8_t(buf, 26, altitude_type);
|
||||
_mav_put_uint8_t(buf, 36, emitter_type);
|
||||
_mav_put_uint8_t(buf, 37, tslc);
|
||||
_mav_put_char_array(buf, 27, callsign, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
|
||||
#else
|
||||
mavlink_adsb_vehicle_t packet;
|
||||
packet.ICAO_address = ICAO_address;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.altitude = altitude;
|
||||
packet.heading = heading;
|
||||
packet.hor_velocity = hor_velocity;
|
||||
packet.ver_velocity = ver_velocity;
|
||||
packet.flags = flags;
|
||||
packet.squawk = squawk;
|
||||
packet.altitude_type = altitude_type;
|
||||
packet.emitter_type = emitter_type;
|
||||
packet.tslc = tslc;
|
||||
mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a adsb_vehicle struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param adsb_vehicle C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_adsb_vehicle_t* adsb_vehicle)
|
||||
{
|
||||
return mavlink_msg_adsb_vehicle_pack(system_id, component_id, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a adsb_vehicle struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param adsb_vehicle C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_adsb_vehicle_t* adsb_vehicle)
|
||||
{
|
||||
return mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, chan, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a adsb_vehicle message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param ICAO_address ICAO address
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param altitude_type ADSB altitude type.
|
||||
* @param altitude [mm] Altitude(ASL)
|
||||
* @param heading [cdeg] Course over ground
|
||||
* @param hor_velocity [cm/s] The horizontal velocity
|
||||
* @param ver_velocity [cm/s] The vertical velocity. Positive is up
|
||||
* @param callsign The callsign, 8+null
|
||||
* @param emitter_type ADSB emitter type.
|
||||
* @param tslc [s] Time since last communication in seconds
|
||||
* @param flags Bitmap to indicate various statuses including valid data fields
|
||||
* @param squawk Squawk code
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_adsb_vehicle_send(mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ICAO_address);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, altitude);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_uint16_t(buf, 18, hor_velocity);
|
||||
_mav_put_int16_t(buf, 20, ver_velocity);
|
||||
_mav_put_uint16_t(buf, 22, flags);
|
||||
_mav_put_uint16_t(buf, 24, squawk);
|
||||
_mav_put_uint8_t(buf, 26, altitude_type);
|
||||
_mav_put_uint8_t(buf, 36, emitter_type);
|
||||
_mav_put_uint8_t(buf, 37, tslc);
|
||||
_mav_put_char_array(buf, 27, callsign, 9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
#else
|
||||
mavlink_adsb_vehicle_t packet;
|
||||
packet.ICAO_address = ICAO_address;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.altitude = altitude;
|
||||
packet.heading = heading;
|
||||
packet.hor_velocity = hor_velocity;
|
||||
packet.ver_velocity = ver_velocity;
|
||||
packet.flags = flags;
|
||||
packet.squawk = squawk;
|
||||
packet.altitude_type = altitude_type;
|
||||
packet.emitter_type = emitter_type;
|
||||
packet.tslc = tslc;
|
||||
mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)&packet, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a adsb_vehicle message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_adsb_vehicle_send_struct(mavlink_channel_t chan, const mavlink_adsb_vehicle_t* adsb_vehicle)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_adsb_vehicle_send(chan, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)adsb_vehicle, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ADSB_VEHICLE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_adsb_vehicle_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, ICAO_address);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, altitude);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_uint16_t(buf, 18, hor_velocity);
|
||||
_mav_put_int16_t(buf, 20, ver_velocity);
|
||||
_mav_put_uint16_t(buf, 22, flags);
|
||||
_mav_put_uint16_t(buf, 24, squawk);
|
||||
_mav_put_uint8_t(buf, 26, altitude_type);
|
||||
_mav_put_uint8_t(buf, 36, emitter_type);
|
||||
_mav_put_uint8_t(buf, 37, tslc);
|
||||
_mav_put_char_array(buf, 27, callsign, 9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
#else
|
||||
mavlink_adsb_vehicle_t *packet = (mavlink_adsb_vehicle_t *)msgbuf;
|
||||
packet->ICAO_address = ICAO_address;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->altitude = altitude;
|
||||
packet->heading = heading;
|
||||
packet->hor_velocity = hor_velocity;
|
||||
packet->ver_velocity = ver_velocity;
|
||||
packet->flags = flags;
|
||||
packet->squawk = squawk;
|
||||
packet->altitude_type = altitude_type;
|
||||
packet->emitter_type = emitter_type;
|
||||
packet->tslc = tslc;
|
||||
mav_array_memcpy(packet->callsign, callsign, sizeof(char)*9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)packet, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ADSB_VEHICLE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field ICAO_address from adsb_vehicle message
|
||||
*
|
||||
* @return ICAO address
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_adsb_vehicle_get_ICAO_address(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from adsb_vehicle message
|
||||
*
|
||||
* @return [degE7] Latitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_adsb_vehicle_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from adsb_vehicle message
|
||||
*
|
||||
* @return [degE7] Longitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_adsb_vehicle_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_type from adsb_vehicle message
|
||||
*
|
||||
* @return ADSB altitude type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_adsb_vehicle_get_altitude_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude from adsb_vehicle message
|
||||
*
|
||||
* @return [mm] Altitude(ASL)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_adsb_vehicle_get_altitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field heading from adsb_vehicle message
|
||||
*
|
||||
* @return [cdeg] Course over ground
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_get_heading(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field hor_velocity from adsb_vehicle message
|
||||
*
|
||||
* @return [cm/s] The horizontal velocity
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_get_hor_velocity(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ver_velocity from adsb_vehicle message
|
||||
*
|
||||
* @return [cm/s] The vertical velocity. Positive is up
|
||||
*/
|
||||
static inline int16_t mavlink_msg_adsb_vehicle_get_ver_velocity(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field callsign from adsb_vehicle message
|
||||
*
|
||||
* @return The callsign, 8+null
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_get_callsign(const mavlink_message_t* msg, char *callsign)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, callsign, 9, 27);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field emitter_type from adsb_vehicle message
|
||||
*
|
||||
* @return ADSB emitter type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field tslc from adsb_vehicle message
|
||||
*
|
||||
* @return [s] Time since last communication in seconds
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_adsb_vehicle_get_tslc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 37);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from adsb_vehicle message
|
||||
*
|
||||
* @return Bitmap to indicate various statuses including valid data fields
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field squawk from adsb_vehicle message
|
||||
*
|
||||
* @return Squawk code
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_get_squawk(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a adsb_vehicle message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param adsb_vehicle C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_adsb_vehicle_decode(const mavlink_message_t* msg, mavlink_adsb_vehicle_t* adsb_vehicle)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
adsb_vehicle->ICAO_address = mavlink_msg_adsb_vehicle_get_ICAO_address(msg);
|
||||
adsb_vehicle->lat = mavlink_msg_adsb_vehicle_get_lat(msg);
|
||||
adsb_vehicle->lon = mavlink_msg_adsb_vehicle_get_lon(msg);
|
||||
adsb_vehicle->altitude = mavlink_msg_adsb_vehicle_get_altitude(msg);
|
||||
adsb_vehicle->heading = mavlink_msg_adsb_vehicle_get_heading(msg);
|
||||
adsb_vehicle->hor_velocity = mavlink_msg_adsb_vehicle_get_hor_velocity(msg);
|
||||
adsb_vehicle->ver_velocity = mavlink_msg_adsb_vehicle_get_ver_velocity(msg);
|
||||
adsb_vehicle->flags = mavlink_msg_adsb_vehicle_get_flags(msg);
|
||||
adsb_vehicle->squawk = mavlink_msg_adsb_vehicle_get_squawk(msg);
|
||||
adsb_vehicle->altitude_type = mavlink_msg_adsb_vehicle_get_altitude_type(msg);
|
||||
mavlink_msg_adsb_vehicle_get_callsign(msg, adsb_vehicle->callsign);
|
||||
adsb_vehicle->emitter_type = mavlink_msg_adsb_vehicle_get_emitter_type(msg);
|
||||
adsb_vehicle->tslc = mavlink_msg_adsb_vehicle_get_tslc(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ADSB_VEHICLE_LEN? msg->len : MAVLINK_MSG_ID_ADSB_VEHICLE_LEN;
|
||||
memset(adsb_vehicle, 0, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
|
||||
memcpy(adsb_vehicle, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
#pragma once
|
||||
// MESSAGE ALTITUDE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ALTITUDE 141
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_altitude_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float altitude_monotonic; /*< [m] This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.*/
|
||||
float altitude_amsl; /*< [m] This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.*/
|
||||
float altitude_local; /*< [m] This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.*/
|
||||
float altitude_relative; /*< [m] This is the altitude above the home position. It resets on each change of the current home position.*/
|
||||
float altitude_terrain; /*< [m] This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.*/
|
||||
float bottom_clearance; /*< [m] This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.*/
|
||||
}) mavlink_altitude_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ALTITUDE_LEN 32
|
||||
#define MAVLINK_MSG_ID_ALTITUDE_MIN_LEN 32
|
||||
#define MAVLINK_MSG_ID_141_LEN 32
|
||||
#define MAVLINK_MSG_ID_141_MIN_LEN 32
|
||||
|
||||
#define MAVLINK_MSG_ID_ALTITUDE_CRC 47
|
||||
#define MAVLINK_MSG_ID_141_CRC 47
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ALTITUDE { \
|
||||
141, \
|
||||
"ALTITUDE", \
|
||||
7, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_altitude_t, time_usec) }, \
|
||||
{ "altitude_monotonic", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_altitude_t, altitude_monotonic) }, \
|
||||
{ "altitude_amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_altitude_t, altitude_amsl) }, \
|
||||
{ "altitude_local", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_altitude_t, altitude_local) }, \
|
||||
{ "altitude_relative", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_altitude_t, altitude_relative) }, \
|
||||
{ "altitude_terrain", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_altitude_t, altitude_terrain) }, \
|
||||
{ "bottom_clearance", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_altitude_t, bottom_clearance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ALTITUDE { \
|
||||
"ALTITUDE", \
|
||||
7, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_altitude_t, time_usec) }, \
|
||||
{ "altitude_monotonic", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_altitude_t, altitude_monotonic) }, \
|
||||
{ "altitude_amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_altitude_t, altitude_amsl) }, \
|
||||
{ "altitude_local", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_altitude_t, altitude_local) }, \
|
||||
{ "altitude_relative", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_altitude_t, altitude_relative) }, \
|
||||
{ "altitude_terrain", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_altitude_t, altitude_terrain) }, \
|
||||
{ "bottom_clearance", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_altitude_t, bottom_clearance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a altitude message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param altitude_monotonic [m] This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
|
||||
* @param altitude_amsl [m] This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
|
||||
* @param altitude_local [m] This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
|
||||
* @param altitude_relative [m] This is the altitude above the home position. It resets on each change of the current home position.
|
||||
* @param altitude_terrain [m] This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
|
||||
* @param bottom_clearance [m] This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_altitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ALTITUDE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, altitude_monotonic);
|
||||
_mav_put_float(buf, 12, altitude_amsl);
|
||||
_mav_put_float(buf, 16, altitude_local);
|
||||
_mav_put_float(buf, 20, altitude_relative);
|
||||
_mav_put_float(buf, 24, altitude_terrain);
|
||||
_mav_put_float(buf, 28, bottom_clearance);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ALTITUDE_LEN);
|
||||
#else
|
||||
mavlink_altitude_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.altitude_monotonic = altitude_monotonic;
|
||||
packet.altitude_amsl = altitude_amsl;
|
||||
packet.altitude_local = altitude_local;
|
||||
packet.altitude_relative = altitude_relative;
|
||||
packet.altitude_terrain = altitude_terrain;
|
||||
packet.bottom_clearance = bottom_clearance;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ALTITUDE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ALTITUDE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a altitude message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param altitude_monotonic [m] This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
|
||||
* @param altitude_amsl [m] This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
|
||||
* @param altitude_local [m] This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
|
||||
* @param altitude_relative [m] This is the altitude above the home position. It resets on each change of the current home position.
|
||||
* @param altitude_terrain [m] This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
|
||||
* @param bottom_clearance [m] This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_altitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,float altitude_monotonic,float altitude_amsl,float altitude_local,float altitude_relative,float altitude_terrain,float bottom_clearance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ALTITUDE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, altitude_monotonic);
|
||||
_mav_put_float(buf, 12, altitude_amsl);
|
||||
_mav_put_float(buf, 16, altitude_local);
|
||||
_mav_put_float(buf, 20, altitude_relative);
|
||||
_mav_put_float(buf, 24, altitude_terrain);
|
||||
_mav_put_float(buf, 28, bottom_clearance);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ALTITUDE_LEN);
|
||||
#else
|
||||
mavlink_altitude_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.altitude_monotonic = altitude_monotonic;
|
||||
packet.altitude_amsl = altitude_amsl;
|
||||
packet.altitude_local = altitude_local;
|
||||
packet.altitude_relative = altitude_relative;
|
||||
packet.altitude_terrain = altitude_terrain;
|
||||
packet.bottom_clearance = bottom_clearance;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ALTITUDE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ALTITUDE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a altitude struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param altitude C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_altitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_altitude_t* altitude)
|
||||
{
|
||||
return mavlink_msg_altitude_pack(system_id, component_id, msg, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a altitude struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param altitude C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_altitude_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_altitude_t* altitude)
|
||||
{
|
||||
return mavlink_msg_altitude_pack_chan(system_id, component_id, chan, msg, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a altitude message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param altitude_monotonic [m] This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
|
||||
* @param altitude_amsl [m] This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
|
||||
* @param altitude_local [m] This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
|
||||
* @param altitude_relative [m] This is the altitude above the home position. It resets on each change of the current home position.
|
||||
* @param altitude_terrain [m] This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
|
||||
* @param bottom_clearance [m] This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_altitude_send(mavlink_channel_t chan, uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ALTITUDE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, altitude_monotonic);
|
||||
_mav_put_float(buf, 12, altitude_amsl);
|
||||
_mav_put_float(buf, 16, altitude_local);
|
||||
_mav_put_float(buf, 20, altitude_relative);
|
||||
_mav_put_float(buf, 24, altitude_terrain);
|
||||
_mav_put_float(buf, 28, bottom_clearance);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
#else
|
||||
mavlink_altitude_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.altitude_monotonic = altitude_monotonic;
|
||||
packet.altitude_amsl = altitude_amsl;
|
||||
packet.altitude_local = altitude_local;
|
||||
packet.altitude_relative = altitude_relative;
|
||||
packet.altitude_terrain = altitude_terrain;
|
||||
packet.bottom_clearance = bottom_clearance;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a altitude message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_altitude_send_struct(mavlink_channel_t chan, const mavlink_altitude_t* altitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_altitude_send(chan, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)altitude, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ALTITUDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_altitude_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, altitude_monotonic);
|
||||
_mav_put_float(buf, 12, altitude_amsl);
|
||||
_mav_put_float(buf, 16, altitude_local);
|
||||
_mav_put_float(buf, 20, altitude_relative);
|
||||
_mav_put_float(buf, 24, altitude_terrain);
|
||||
_mav_put_float(buf, 28, bottom_clearance);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
#else
|
||||
mavlink_altitude_t *packet = (mavlink_altitude_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->altitude_monotonic = altitude_monotonic;
|
||||
packet->altitude_amsl = altitude_amsl;
|
||||
packet->altitude_local = altitude_local;
|
||||
packet->altitude_relative = altitude_relative;
|
||||
packet->altitude_terrain = altitude_terrain;
|
||||
packet->bottom_clearance = bottom_clearance;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)packet, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ALTITUDE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from altitude message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_altitude_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_monotonic from altitude message
|
||||
*
|
||||
* @return [m] This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_altitude_monotonic(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_amsl from altitude message
|
||||
*
|
||||
* @return [m] This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_altitude_amsl(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_local from altitude message
|
||||
*
|
||||
* @return [m] This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_altitude_local(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_relative from altitude message
|
||||
*
|
||||
* @return [m] This is the altitude above the home position. It resets on each change of the current home position.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_altitude_relative(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_terrain from altitude message
|
||||
*
|
||||
* @return [m] This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_altitude_terrain(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field bottom_clearance from altitude message
|
||||
*
|
||||
* @return [m] This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_bottom_clearance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a altitude message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param altitude C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_altitude_decode(const mavlink_message_t* msg, mavlink_altitude_t* altitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
altitude->time_usec = mavlink_msg_altitude_get_time_usec(msg);
|
||||
altitude->altitude_monotonic = mavlink_msg_altitude_get_altitude_monotonic(msg);
|
||||
altitude->altitude_amsl = mavlink_msg_altitude_get_altitude_amsl(msg);
|
||||
altitude->altitude_local = mavlink_msg_altitude_get_altitude_local(msg);
|
||||
altitude->altitude_relative = mavlink_msg_altitude_get_altitude_relative(msg);
|
||||
altitude->altitude_terrain = mavlink_msg_altitude_get_altitude_terrain(msg);
|
||||
altitude->bottom_clearance = mavlink_msg_altitude_get_bottom_clearance(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ALTITUDE_LEN? msg->len : MAVLINK_MSG_ID_ALTITUDE_LEN;
|
||||
memset(altitude, 0, MAVLINK_MSG_ID_ALTITUDE_LEN);
|
||||
memcpy(altitude, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,331 @@
|
||||
#pragma once
|
||||
// MESSAGE ATT_POS_MOCAP PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ATT_POS_MOCAP 138
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_att_pos_mocap_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
|
||||
float x; /*< [m] X position (NED)*/
|
||||
float y; /*< [m] Y position (NED)*/
|
||||
float z; /*< [m] Z position (NED)*/
|
||||
float covariance[21]; /*< Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)*/
|
||||
}) mavlink_att_pos_mocap_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN 120
|
||||
#define MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN 36
|
||||
#define MAVLINK_MSG_ID_138_LEN 120
|
||||
#define MAVLINK_MSG_ID_138_MIN_LEN 36
|
||||
|
||||
#define MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC 109
|
||||
#define MAVLINK_MSG_ID_138_CRC 109
|
||||
|
||||
#define MAVLINK_MSG_ATT_POS_MOCAP_FIELD_Q_LEN 4
|
||||
#define MAVLINK_MSG_ATT_POS_MOCAP_FIELD_COVARIANCE_LEN 21
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP { \
|
||||
138, \
|
||||
"ATT_POS_MOCAP", \
|
||||
6, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_att_pos_mocap_t, time_usec) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_att_pos_mocap_t, q) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_att_pos_mocap_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_att_pos_mocap_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_att_pos_mocap_t, z) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 36, offsetof(mavlink_att_pos_mocap_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP { \
|
||||
"ATT_POS_MOCAP", \
|
||||
6, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_att_pos_mocap_t, time_usec) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_att_pos_mocap_t, q) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_att_pos_mocap_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_att_pos_mocap_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_att_pos_mocap_t, z) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 36, offsetof(mavlink_att_pos_mocap_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a att_pos_mocap message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param x [m] X position (NED)
|
||||
* @param y [m] Y position (NED)
|
||||
* @param z [m] Z position (NED)
|
||||
* @param covariance Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, const float *q, float x, float y, float z, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#else
|
||||
mavlink_att_pos_mocap_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a att_pos_mocap message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param x [m] X position (NED)
|
||||
* @param y [m] Y position (NED)
|
||||
* @param z [m] Z position (NED)
|
||||
* @param covariance Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,const float *q,float x,float y,float z,const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#else
|
||||
mavlink_att_pos_mocap_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a att_pos_mocap struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param att_pos_mocap C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_att_pos_mocap_t* att_pos_mocap)
|
||||
{
|
||||
return mavlink_msg_att_pos_mocap_pack(system_id, component_id, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z, att_pos_mocap->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a att_pos_mocap struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param att_pos_mocap C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_att_pos_mocap_t* att_pos_mocap)
|
||||
{
|
||||
return mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, chan, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z, att_pos_mocap->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a att_pos_mocap message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param x [m] X position (NED)
|
||||
* @param y [m] Y position (NED)
|
||||
* @param z [m] Z position (NED)
|
||||
* @param covariance Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_att_pos_mocap_send(mavlink_channel_t chan, uint64_t time_usec, const float *q, float x, float y, float z, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#else
|
||||
mavlink_att_pos_mocap_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)&packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a att_pos_mocap message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_att_pos_mocap_send_struct(mavlink_channel_t chan, const mavlink_att_pos_mocap_t* att_pos_mocap)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_att_pos_mocap_send(chan, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z, att_pos_mocap->covariance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)att_pos_mocap, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_att_pos_mocap_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, const float *q, float x, float y, float z, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#else
|
||||
mavlink_att_pos_mocap_t *packet = (mavlink_att_pos_mocap_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet->covariance, covariance, sizeof(float)*21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ATT_POS_MOCAP UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from att_pos_mocap message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_att_pos_mocap_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from att_pos_mocap message
|
||||
*
|
||||
* @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from att_pos_mocap message
|
||||
*
|
||||
* @return [m] X position (NED)
|
||||
*/
|
||||
static inline float mavlink_msg_att_pos_mocap_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from att_pos_mocap message
|
||||
*
|
||||
* @return [m] Y position (NED)
|
||||
*/
|
||||
static inline float mavlink_msg_att_pos_mocap_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from att_pos_mocap message
|
||||
*
|
||||
* @return [m] Z position (NED)
|
||||
*/
|
||||
static inline float mavlink_msg_att_pos_mocap_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field covariance from att_pos_mocap message
|
||||
*
|
||||
* @return Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_get_covariance(const mavlink_message_t* msg, float *covariance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, covariance, 21, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a att_pos_mocap message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param att_pos_mocap C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_att_pos_mocap_decode(const mavlink_message_t* msg, mavlink_att_pos_mocap_t* att_pos_mocap)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
att_pos_mocap->time_usec = mavlink_msg_att_pos_mocap_get_time_usec(msg);
|
||||
mavlink_msg_att_pos_mocap_get_q(msg, att_pos_mocap->q);
|
||||
att_pos_mocap->x = mavlink_msg_att_pos_mocap_get_x(msg);
|
||||
att_pos_mocap->y = mavlink_msg_att_pos_mocap_get_y(msg);
|
||||
att_pos_mocap->z = mavlink_msg_att_pos_mocap_get_z(msg);
|
||||
mavlink_msg_att_pos_mocap_get_covariance(msg, att_pos_mocap->covariance);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN? msg->len : MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN;
|
||||
memset(att_pos_mocap, 0, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
memcpy(att_pos_mocap, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
#pragma once
|
||||
// MESSAGE ATTITUDE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE 30
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_attitude_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
float roll; /*< [rad] Roll angle (-pi..+pi)*/
|
||||
float pitch; /*< [rad] Pitch angle (-pi..+pi)*/
|
||||
float yaw; /*< [rad] Yaw angle (-pi..+pi)*/
|
||||
float rollspeed; /*< [rad/s] Roll angular speed*/
|
||||
float pitchspeed; /*< [rad/s] Pitch angular speed*/
|
||||
float yawspeed; /*< [rad/s] Yaw angular speed*/
|
||||
}) mavlink_attitude_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_LEN 28
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_MIN_LEN 28
|
||||
#define MAVLINK_MSG_ID_30_LEN 28
|
||||
#define MAVLINK_MSG_ID_30_MIN_LEN 28
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_CRC 39
|
||||
#define MAVLINK_MSG_ID_30_CRC 39
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE { \
|
||||
30, \
|
||||
"ATTITUDE", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_t, time_boot_ms) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_t, yaw) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_t, yawspeed) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE { \
|
||||
"ATTITUDE", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_t, time_boot_ms) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_t, yaw) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_t, yawspeed) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param roll [rad] Roll angle (-pi..+pi)
|
||||
* @param pitch [rad] Pitch angle (-pi..+pi)
|
||||
* @param yaw [rad] Yaw angle (-pi..+pi)
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, rollspeed);
|
||||
_mav_put_float(buf, 20, pitchspeed);
|
||||
_mav_put_float(buf, 24, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_LEN);
|
||||
#else
|
||||
mavlink_attitude_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param roll [rad] Roll angle (-pi..+pi)
|
||||
* @param pitch [rad] Pitch angle (-pi..+pi)
|
||||
* @param yaw [rad] Yaw angle (-pi..+pi)
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, rollspeed);
|
||||
_mav_put_float(buf, 20, pitchspeed);
|
||||
_mav_put_float(buf, 24, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_LEN);
|
||||
#else
|
||||
mavlink_attitude_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_t* attitude)
|
||||
{
|
||||
return mavlink_msg_attitude_pack(system_id, component_id, msg, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_t* attitude)
|
||||
{
|
||||
return mavlink_msg_attitude_pack_chan(system_id, component_id, chan, msg, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param roll [rad] Roll angle (-pi..+pi)
|
||||
* @param pitch [rad] Pitch angle (-pi..+pi)
|
||||
* @param yaw [rad] Yaw angle (-pi..+pi)
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_attitude_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, rollspeed);
|
||||
_mav_put_float(buf, 20, pitchspeed);
|
||||
_mav_put_float(buf, 24, yawspeed);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
#else
|
||||
mavlink_attitude_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_send_struct(mavlink_channel_t chan, const mavlink_attitude_t* attitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_attitude_send(chan, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)attitude, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ATTITUDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, rollspeed);
|
||||
_mav_put_float(buf, 20, pitchspeed);
|
||||
_mav_put_float(buf, 24, yawspeed);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
#else
|
||||
mavlink_attitude_t *packet = (mavlink_attitude_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->roll = roll;
|
||||
packet->pitch = pitch;
|
||||
packet->yaw = yaw;
|
||||
packet->rollspeed = rollspeed;
|
||||
packet->pitchspeed = pitchspeed;
|
||||
packet->yawspeed = yawspeed;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ATTITUDE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from attitude message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from attitude message
|
||||
*
|
||||
* @return [rad] Roll angle (-pi..+pi)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from attitude message
|
||||
*
|
||||
* @return [rad] Pitch angle (-pi..+pi)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from attitude message
|
||||
*
|
||||
* @return [rad] Yaw angle (-pi..+pi)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rollspeed from attitude message
|
||||
*
|
||||
* @return [rad/s] Roll angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitchspeed from attitude message
|
||||
*
|
||||
* @return [rad/s] Pitch angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yawspeed from attitude message
|
||||
*
|
||||
* @return [rad/s] Yaw angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_yawspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a attitude message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param attitude C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_decode(const mavlink_message_t* msg, mavlink_attitude_t* attitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
attitude->time_boot_ms = mavlink_msg_attitude_get_time_boot_ms(msg);
|
||||
attitude->roll = mavlink_msg_attitude_get_roll(msg);
|
||||
attitude->pitch = mavlink_msg_attitude_get_pitch(msg);
|
||||
attitude->yaw = mavlink_msg_attitude_get_yaw(msg);
|
||||
attitude->rollspeed = mavlink_msg_attitude_get_rollspeed(msg);
|
||||
attitude->pitchspeed = mavlink_msg_attitude_get_pitchspeed(msg);
|
||||
attitude->yawspeed = mavlink_msg_attitude_get_yawspeed(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_LEN;
|
||||
memset(attitude, 0, MAVLINK_MSG_ID_ATTITUDE_LEN);
|
||||
memcpy(attitude, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,388 @@
|
||||
#pragma once
|
||||
// MESSAGE ATTITUDE_QUATERNION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION 31
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_attitude_quaternion_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
float q1; /*< Quaternion component 1, w (1 in null-rotation)*/
|
||||
float q2; /*< Quaternion component 2, x (0 in null-rotation)*/
|
||||
float q3; /*< Quaternion component 3, y (0 in null-rotation)*/
|
||||
float q4; /*< Quaternion component 4, z (0 in null-rotation)*/
|
||||
float rollspeed; /*< [rad/s] Roll angular speed*/
|
||||
float pitchspeed; /*< [rad/s] Pitch angular speed*/
|
||||
float yawspeed; /*< [rad/s] Yaw angular speed*/
|
||||
}) mavlink_attitude_quaternion_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN 32
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN 32
|
||||
#define MAVLINK_MSG_ID_31_LEN 32
|
||||
#define MAVLINK_MSG_ID_31_MIN_LEN 32
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC 246
|
||||
#define MAVLINK_MSG_ID_31_CRC 246
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION { \
|
||||
31, \
|
||||
"ATTITUDE_QUATERNION", \
|
||||
8, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_t, time_boot_ms) }, \
|
||||
{ "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_quaternion_t, q1) }, \
|
||||
{ "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_quaternion_t, q2) }, \
|
||||
{ "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_quaternion_t, q3) }, \
|
||||
{ "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_quaternion_t, q4) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_quaternion_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_t, yawspeed) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION { \
|
||||
"ATTITUDE_QUATERNION", \
|
||||
8, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_t, time_boot_ms) }, \
|
||||
{ "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_quaternion_t, q1) }, \
|
||||
{ "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_quaternion_t, q2) }, \
|
||||
{ "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_quaternion_t, q3) }, \
|
||||
{ "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_quaternion_t, q4) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_quaternion_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_t, yawspeed) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_quaternion message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param q1 Quaternion component 1, w (1 in null-rotation)
|
||||
* @param q2 Quaternion component 2, x (0 in null-rotation)
|
||||
* @param q3 Quaternion component 3, y (0 in null-rotation)
|
||||
* @param q4 Quaternion component 4, z (0 in null-rotation)
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, q1);
|
||||
_mav_put_float(buf, 8, q2);
|
||||
_mav_put_float(buf, 12, q3);
|
||||
_mav_put_float(buf, 16, q4);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
|
||||
#else
|
||||
mavlink_attitude_quaternion_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.q1 = q1;
|
||||
packet.q2 = q2;
|
||||
packet.q3 = q3;
|
||||
packet.q4 = q4;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_quaternion message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param q1 Quaternion component 1, w (1 in null-rotation)
|
||||
* @param q2 Quaternion component 2, x (0 in null-rotation)
|
||||
* @param q3 Quaternion component 3, y (0 in null-rotation)
|
||||
* @param q4 Quaternion component 4, z (0 in null-rotation)
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,float q1,float q2,float q3,float q4,float rollspeed,float pitchspeed,float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, q1);
|
||||
_mav_put_float(buf, 8, q2);
|
||||
_mav_put_float(buf, 12, q3);
|
||||
_mav_put_float(buf, 16, q4);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
|
||||
#else
|
||||
mavlink_attitude_quaternion_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.q1 = q1;
|
||||
packet.q2 = q2;
|
||||
packet.q3 = q3;
|
||||
packet.q4 = q4;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_quaternion struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_quaternion C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_quaternion_t* attitude_quaternion)
|
||||
{
|
||||
return mavlink_msg_attitude_quaternion_pack(system_id, component_id, msg, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_quaternion struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_quaternion C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_quaternion_t* attitude_quaternion)
|
||||
{
|
||||
return mavlink_msg_attitude_quaternion_pack_chan(system_id, component_id, chan, msg, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_quaternion message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param q1 Quaternion component 1, w (1 in null-rotation)
|
||||
* @param q2 Quaternion component 2, x (0 in null-rotation)
|
||||
* @param q3 Quaternion component 3, y (0 in null-rotation)
|
||||
* @param q4 Quaternion component 4, z (0 in null-rotation)
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_attitude_quaternion_send(mavlink_channel_t chan, uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, q1);
|
||||
_mav_put_float(buf, 8, q2);
|
||||
_mav_put_float(buf, 12, q3);
|
||||
_mav_put_float(buf, 16, q4);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
#else
|
||||
mavlink_attitude_quaternion_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.q1 = q1;
|
||||
packet.q2 = q2;
|
||||
packet.q3 = q3;
|
||||
packet.q4 = q4;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_quaternion message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_send_struct(mavlink_channel_t chan, const mavlink_attitude_quaternion_t* attitude_quaternion)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_attitude_quaternion_send(chan, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)attitude_quaternion, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, q1);
|
||||
_mav_put_float(buf, 8, q2);
|
||||
_mav_put_float(buf, 12, q3);
|
||||
_mav_put_float(buf, 16, q4);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
#else
|
||||
mavlink_attitude_quaternion_t *packet = (mavlink_attitude_quaternion_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->q1 = q1;
|
||||
packet->q2 = q2;
|
||||
packet->q3 = q3;
|
||||
packet->q4 = q4;
|
||||
packet->rollspeed = rollspeed;
|
||||
packet->pitchspeed = pitchspeed;
|
||||
packet->yawspeed = yawspeed;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ATTITUDE_QUATERNION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from attitude_quaternion message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_attitude_quaternion_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q1 from attitude_quaternion message
|
||||
*
|
||||
* @return Quaternion component 1, w (1 in null-rotation)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_q1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q2 from attitude_quaternion message
|
||||
*
|
||||
* @return Quaternion component 2, x (0 in null-rotation)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_q2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q3 from attitude_quaternion message
|
||||
*
|
||||
* @return Quaternion component 3, y (0 in null-rotation)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_q3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q4 from attitude_quaternion message
|
||||
*
|
||||
* @return Quaternion component 4, z (0 in null-rotation)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_q4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rollspeed from attitude_quaternion message
|
||||
*
|
||||
* @return [rad/s] Roll angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_rollspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitchspeed from attitude_quaternion message
|
||||
*
|
||||
* @return [rad/s] Pitch angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_pitchspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yawspeed from attitude_quaternion message
|
||||
*
|
||||
* @return [rad/s] Yaw angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_yawspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a attitude_quaternion message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param attitude_quaternion C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_decode(const mavlink_message_t* msg, mavlink_attitude_quaternion_t* attitude_quaternion)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
attitude_quaternion->time_boot_ms = mavlink_msg_attitude_quaternion_get_time_boot_ms(msg);
|
||||
attitude_quaternion->q1 = mavlink_msg_attitude_quaternion_get_q1(msg);
|
||||
attitude_quaternion->q2 = mavlink_msg_attitude_quaternion_get_q2(msg);
|
||||
attitude_quaternion->q3 = mavlink_msg_attitude_quaternion_get_q3(msg);
|
||||
attitude_quaternion->q4 = mavlink_msg_attitude_quaternion_get_q4(msg);
|
||||
attitude_quaternion->rollspeed = mavlink_msg_attitude_quaternion_get_rollspeed(msg);
|
||||
attitude_quaternion->pitchspeed = mavlink_msg_attitude_quaternion_get_pitchspeed(msg);
|
||||
attitude_quaternion->yawspeed = mavlink_msg_attitude_quaternion_get_yawspeed(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN;
|
||||
memset(attitude_quaternion, 0, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
|
||||
memcpy(attitude_quaternion, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,331 @@
|
||||
#pragma once
|
||||
// MESSAGE ATTITUDE_QUATERNION_COV PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV 61
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_attitude_quaternion_cov_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float q[4]; /*< Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)*/
|
||||
float rollspeed; /*< [rad/s] Roll angular speed*/
|
||||
float pitchspeed; /*< [rad/s] Pitch angular speed*/
|
||||
float yawspeed; /*< [rad/s] Yaw angular speed*/
|
||||
float covariance[9]; /*< Attitude covariance*/
|
||||
}) mavlink_attitude_quaternion_cov_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN 72
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN 72
|
||||
#define MAVLINK_MSG_ID_61_LEN 72
|
||||
#define MAVLINK_MSG_ID_61_MIN_LEN 72
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC 167
|
||||
#define MAVLINK_MSG_ID_61_CRC 167
|
||||
|
||||
#define MAVLINK_MSG_ATTITUDE_QUATERNION_COV_FIELD_Q_LEN 4
|
||||
#define MAVLINK_MSG_ATTITUDE_QUATERNION_COV_FIELD_COVARIANCE_LEN 9
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV { \
|
||||
61, \
|
||||
"ATTITUDE_QUATERNION_COV", \
|
||||
6, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_attitude_quaternion_cov_t, time_usec) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_attitude_quaternion_cov_t, q) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_cov_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_cov_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_quaternion_cov_t, yawspeed) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 36, offsetof(mavlink_attitude_quaternion_cov_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV { \
|
||||
"ATTITUDE_QUATERNION_COV", \
|
||||
6, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_attitude_quaternion_cov_t, time_usec) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_attitude_quaternion_cov_t, q) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_cov_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_cov_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_quaternion_cov_t, yawspeed) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 36, offsetof(mavlink_attitude_quaternion_cov_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_quaternion_cov message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
* @param covariance Attitude covariance
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
|
||||
#else
|
||||
mavlink_attitude_quaternion_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_quaternion_cov message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
* @param covariance Attitude covariance
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,const float *q,float rollspeed,float pitchspeed,float yawspeed,const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
|
||||
#else
|
||||
mavlink_attitude_quaternion_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_quaternion_cov struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_quaternion_cov C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
|
||||
{
|
||||
return mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, msg, attitude_quaternion_cov->time_usec, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_quaternion_cov struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_quaternion_cov C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
|
||||
{
|
||||
return mavlink_msg_attitude_quaternion_cov_pack_chan(system_id, component_id, chan, msg, attitude_quaternion_cov->time_usec, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_quaternion_cov message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
* @param covariance Attitude covariance
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_attitude_quaternion_cov_send(mavlink_channel_t chan, uint64_t time_usec, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
#else
|
||||
mavlink_attitude_quaternion_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_quaternion_cov message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_cov_send_struct(mavlink_channel_t chan, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_attitude_quaternion_cov_send(chan, attitude_quaternion_cov->time_usec, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)attitude_quaternion_cov, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
#else
|
||||
mavlink_attitude_quaternion_cov_t *packet = (mavlink_attitude_quaternion_cov_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->rollspeed = rollspeed;
|
||||
packet->pitchspeed = pitchspeed;
|
||||
packet->yawspeed = yawspeed;
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet->covariance, covariance, sizeof(float)*9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ATTITUDE_QUATERNION_COV UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from attitude_quaternion_cov message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_attitude_quaternion_cov_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from attitude_quaternion_cov message
|
||||
*
|
||||
* @return Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rollspeed from attitude_quaternion_cov message
|
||||
*
|
||||
* @return [rad/s] Roll angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_cov_get_rollspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitchspeed from attitude_quaternion_cov message
|
||||
*
|
||||
* @return [rad/s] Pitch angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_cov_get_pitchspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yawspeed from attitude_quaternion_cov message
|
||||
*
|
||||
* @return [rad/s] Yaw angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_cov_get_yawspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field covariance from attitude_quaternion_cov message
|
||||
*
|
||||
* @return Attitude covariance
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, covariance, 9, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a attitude_quaternion_cov message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param attitude_quaternion_cov C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_cov_decode(const mavlink_message_t* msg, mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
attitude_quaternion_cov->time_usec = mavlink_msg_attitude_quaternion_cov_get_time_usec(msg);
|
||||
mavlink_msg_attitude_quaternion_cov_get_q(msg, attitude_quaternion_cov->q);
|
||||
attitude_quaternion_cov->rollspeed = mavlink_msg_attitude_quaternion_cov_get_rollspeed(msg);
|
||||
attitude_quaternion_cov->pitchspeed = mavlink_msg_attitude_quaternion_cov_get_pitchspeed(msg);
|
||||
attitude_quaternion_cov->yawspeed = mavlink_msg_attitude_quaternion_cov_get_yawspeed(msg);
|
||||
mavlink_msg_attitude_quaternion_cov_get_covariance(msg, attitude_quaternion_cov->covariance);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN;
|
||||
memset(attitude_quaternion_cov, 0, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
|
||||
memcpy(attitude_quaternion_cov, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,355 @@
|
||||
#pragma once
|
||||
// MESSAGE ATTITUDE_TARGET PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_TARGET 83
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_attitude_target_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
|
||||
float body_roll_rate; /*< [rad/s] Body roll rate*/
|
||||
float body_pitch_rate; /*< [rad/s] Body pitch rate*/
|
||||
float body_yaw_rate; /*< [rad/s] Body yaw rate*/
|
||||
float thrust; /*< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)*/
|
||||
uint8_t type_mask; /*< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude*/
|
||||
}) mavlink_attitude_target_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN 37
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN 37
|
||||
#define MAVLINK_MSG_ID_83_LEN 37
|
||||
#define MAVLINK_MSG_ID_83_MIN_LEN 37
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC 22
|
||||
#define MAVLINK_MSG_ID_83_CRC 22
|
||||
|
||||
#define MAVLINK_MSG_ATTITUDE_TARGET_FIELD_Q_LEN 4
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET { \
|
||||
83, \
|
||||
"ATTITUDE_TARGET", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_target_t, time_boot_ms) }, \
|
||||
{ "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_target_t, q) }, \
|
||||
{ "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_target_t, body_roll_rate) }, \
|
||||
{ "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_target_t, body_pitch_rate) }, \
|
||||
{ "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_target_t, body_yaw_rate) }, \
|
||||
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_target_t, thrust) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET { \
|
||||
"ATTITUDE_TARGET", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_target_t, time_boot_ms) }, \
|
||||
{ "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_target_t, q) }, \
|
||||
{ "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_target_t, body_roll_rate) }, \
|
||||
{ "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_target_t, body_pitch_rate) }, \
|
||||
{ "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_target_t, body_yaw_rate) }, \
|
||||
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_target_t, thrust) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_target message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param body_roll_rate [rad/s] Body roll rate
|
||||
* @param body_pitch_rate [rad/s] Body pitch rate
|
||||
* @param body_yaw_rate [rad/s] Body yaw rate
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 20, body_roll_rate);
|
||||
_mav_put_float(buf, 24, body_pitch_rate);
|
||||
_mav_put_float(buf, 28, body_yaw_rate);
|
||||
_mav_put_float(buf, 32, thrust);
|
||||
_mav_put_uint8_t(buf, 36, type_mask);
|
||||
_mav_put_float_array(buf, 4, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
|
||||
#else
|
||||
mavlink_attitude_target_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.body_roll_rate = body_roll_rate;
|
||||
packet.body_pitch_rate = body_pitch_rate;
|
||||
packet.body_yaw_rate = body_yaw_rate;
|
||||
packet.thrust = thrust;
|
||||
packet.type_mask = type_mask;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_target message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param body_roll_rate [rad/s] Body roll rate
|
||||
* @param body_pitch_rate [rad/s] Body pitch rate
|
||||
* @param body_yaw_rate [rad/s] Body yaw rate
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,uint8_t type_mask,const float *q,float body_roll_rate,float body_pitch_rate,float body_yaw_rate,float thrust)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 20, body_roll_rate);
|
||||
_mav_put_float(buf, 24, body_pitch_rate);
|
||||
_mav_put_float(buf, 28, body_yaw_rate);
|
||||
_mav_put_float(buf, 32, thrust);
|
||||
_mav_put_uint8_t(buf, 36, type_mask);
|
||||
_mav_put_float_array(buf, 4, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
|
||||
#else
|
||||
mavlink_attitude_target_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.body_roll_rate = body_roll_rate;
|
||||
packet.body_pitch_rate = body_pitch_rate;
|
||||
packet.body_yaw_rate = body_yaw_rate;
|
||||
packet.thrust = thrust;
|
||||
packet.type_mask = type_mask;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_target struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_target_t* attitude_target)
|
||||
{
|
||||
return mavlink_msg_attitude_target_pack(system_id, component_id, msg, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_target struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_target_t* attitude_target)
|
||||
{
|
||||
return mavlink_msg_attitude_target_pack_chan(system_id, component_id, chan, msg, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param body_roll_rate [rad/s] Body roll rate
|
||||
* @param body_pitch_rate [rad/s] Body pitch rate
|
||||
* @param body_yaw_rate [rad/s] Body yaw rate
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_attitude_target_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 20, body_roll_rate);
|
||||
_mav_put_float(buf, 24, body_pitch_rate);
|
||||
_mav_put_float(buf, 28, body_yaw_rate);
|
||||
_mav_put_float(buf, 32, thrust);
|
||||
_mav_put_uint8_t(buf, 36, type_mask);
|
||||
_mav_put_float_array(buf, 4, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
#else
|
||||
mavlink_attitude_target_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.body_roll_rate = body_roll_rate;
|
||||
packet.body_pitch_rate = body_pitch_rate;
|
||||
packet.body_yaw_rate = body_yaw_rate;
|
||||
packet.thrust = thrust;
|
||||
packet.type_mask = type_mask;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_target_send_struct(mavlink_channel_t chan, const mavlink_attitude_target_t* attitude_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_attitude_target_send(chan, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)attitude_target, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 20, body_roll_rate);
|
||||
_mav_put_float(buf, 24, body_pitch_rate);
|
||||
_mav_put_float(buf, 28, body_yaw_rate);
|
||||
_mav_put_float(buf, 32, thrust);
|
||||
_mav_put_uint8_t(buf, 36, type_mask);
|
||||
_mav_put_float_array(buf, 4, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
#else
|
||||
mavlink_attitude_target_t *packet = (mavlink_attitude_target_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->body_roll_rate = body_roll_rate;
|
||||
packet->body_pitch_rate = body_pitch_rate;
|
||||
packet->body_yaw_rate = body_yaw_rate;
|
||||
packet->thrust = thrust;
|
||||
packet->type_mask = type_mask;
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ATTITUDE_TARGET UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from attitude_target message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_attitude_target_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field type_mask from attitude_target message
|
||||
*
|
||||
* @return Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_attitude_target_get_type_mask(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from attitude_target message
|
||||
*
|
||||
* @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_target_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field body_roll_rate from attitude_target message
|
||||
*
|
||||
* @return [rad/s] Body roll rate
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_target_get_body_roll_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field body_pitch_rate from attitude_target message
|
||||
*
|
||||
* @return [rad/s] Body pitch rate
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_target_get_body_pitch_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field body_yaw_rate from attitude_target message
|
||||
*
|
||||
* @return [rad/s] Body yaw rate
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_target_get_body_yaw_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field thrust from attitude_target message
|
||||
*
|
||||
* @return Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_target_get_thrust(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a attitude_target message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param attitude_target C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_target_decode(const mavlink_message_t* msg, mavlink_attitude_target_t* attitude_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
attitude_target->time_boot_ms = mavlink_msg_attitude_target_get_time_boot_ms(msg);
|
||||
mavlink_msg_attitude_target_get_q(msg, attitude_target->q);
|
||||
attitude_target->body_roll_rate = mavlink_msg_attitude_target_get_body_roll_rate(msg);
|
||||
attitude_target->body_pitch_rate = mavlink_msg_attitude_target_get_body_pitch_rate(msg);
|
||||
attitude_target->body_yaw_rate = mavlink_msg_attitude_target_get_body_yaw_rate(msg);
|
||||
attitude_target->thrust = mavlink_msg_attitude_target_get_thrust(msg);
|
||||
attitude_target->type_mask = mavlink_msg_attitude_target_get_type_mask(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN;
|
||||
memset(attitude_target, 0, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
|
||||
memcpy(attitude_target, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
#pragma once
|
||||
// MESSAGE AUTH_KEY PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTH_KEY 7
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_auth_key_t {
|
||||
char key[32]; /*< key*/
|
||||
}) mavlink_auth_key_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTH_KEY_LEN 32
|
||||
#define MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN 32
|
||||
#define MAVLINK_MSG_ID_7_LEN 32
|
||||
#define MAVLINK_MSG_ID_7_MIN_LEN 32
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTH_KEY_CRC 119
|
||||
#define MAVLINK_MSG_ID_7_CRC 119
|
||||
|
||||
#define MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN 32
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_AUTH_KEY { \
|
||||
7, \
|
||||
"AUTH_KEY", \
|
||||
1, \
|
||||
{ { "key", NULL, MAVLINK_TYPE_CHAR, 32, 0, offsetof(mavlink_auth_key_t, key) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_AUTH_KEY { \
|
||||
"AUTH_KEY", \
|
||||
1, \
|
||||
{ { "key", NULL, MAVLINK_TYPE_CHAR, 32, 0, offsetof(mavlink_auth_key_t, key) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a auth_key message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param key key
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
const char *key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
|
||||
|
||||
_mav_put_char_array(buf, 0, key, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN);
|
||||
#else
|
||||
mavlink_auth_key_t packet;
|
||||
|
||||
mav_array_memcpy(packet.key, key, sizeof(char)*32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a auth_key message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param key key
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
const char *key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
|
||||
|
||||
_mav_put_char_array(buf, 0, key, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN);
|
||||
#else
|
||||
mavlink_auth_key_t packet;
|
||||
|
||||
mav_array_memcpy(packet.key, key, sizeof(char)*32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a auth_key struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param auth_key C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_auth_key_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_auth_key_t* auth_key)
|
||||
{
|
||||
return mavlink_msg_auth_key_pack(system_id, component_id, msg, auth_key->key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a auth_key struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param auth_key C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_auth_key_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_auth_key_t* auth_key)
|
||||
{
|
||||
return mavlink_msg_auth_key_pack_chan(system_id, component_id, chan, msg, auth_key->key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a auth_key message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param key key
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_auth_key_send(mavlink_channel_t chan, const char *key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
|
||||
|
||||
_mav_put_char_array(buf, 0, key, 32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
#else
|
||||
mavlink_auth_key_t packet;
|
||||
|
||||
mav_array_memcpy(packet.key, key, sizeof(char)*32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a auth_key message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_auth_key_send_struct(mavlink_channel_t chan, const mavlink_auth_key_t* auth_key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_auth_key_send(chan, auth_key->key);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)auth_key, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_AUTH_KEY_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_auth_key_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const char *key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
|
||||
_mav_put_char_array(buf, 0, key, 32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
#else
|
||||
mavlink_auth_key_t *packet = (mavlink_auth_key_t *)msgbuf;
|
||||
|
||||
mav_array_memcpy(packet->key, key, sizeof(char)*32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)packet, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE AUTH_KEY UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field key from auth_key message
|
||||
*
|
||||
* @return key
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_auth_key_get_key(const mavlink_message_t* msg, char *key)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, key, 32, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a auth_key message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param auth_key C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_auth_key_decode(const mavlink_message_t* msg, mavlink_auth_key_t* auth_key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_auth_key_get_key(msg, auth_key->key);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_AUTH_KEY_LEN? msg->len : MAVLINK_MSG_ID_AUTH_KEY_LEN;
|
||||
memset(auth_key, 0, MAVLINK_MSG_ID_AUTH_KEY_LEN);
|
||||
memcpy(auth_key, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,483 @@
|
||||
#pragma once
|
||||
// MESSAGE AUTOPILOT_VERSION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION 148
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_autopilot_version_t {
|
||||
uint64_t capabilities; /*< Bitmap of capabilities*/
|
||||
uint64_t uid; /*< UID if provided by hardware (see uid2)*/
|
||||
uint32_t flight_sw_version; /*< Firmware version number*/
|
||||
uint32_t middleware_sw_version; /*< Middleware version number*/
|
||||
uint32_t os_sw_version; /*< Operating system version number*/
|
||||
uint32_t board_version; /*< HW / board version (last 8 bytes should be silicon ID, if any)*/
|
||||
uint16_t vendor_id; /*< ID of the board vendor*/
|
||||
uint16_t product_id; /*< ID of the product*/
|
||||
uint8_t flight_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/
|
||||
uint8_t middleware_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/
|
||||
uint8_t os_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/
|
||||
uint8_t uid2[18]; /*< UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)*/
|
||||
}) mavlink_autopilot_version_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN 78
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN 60
|
||||
#define MAVLINK_MSG_ID_148_LEN 78
|
||||
#define MAVLINK_MSG_ID_148_MIN_LEN 60
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC 178
|
||||
#define MAVLINK_MSG_ID_148_CRC 178
|
||||
|
||||
#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_FLIGHT_CUSTOM_VERSION_LEN 8
|
||||
#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_MIDDLEWARE_CUSTOM_VERSION_LEN 8
|
||||
#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_OS_CUSTOM_VERSION_LEN 8
|
||||
#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_UID2_LEN 18
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
|
||||
148, \
|
||||
"AUTOPILOT_VERSION", \
|
||||
12, \
|
||||
{ { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
|
||||
{ "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
|
||||
{ "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
|
||||
{ "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
|
||||
{ "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
|
||||
{ "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \
|
||||
{ "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \
|
||||
{ "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \
|
||||
{ "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
|
||||
{ "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
|
||||
{ "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
|
||||
{ "uid2", NULL, MAVLINK_TYPE_UINT8_T, 18, 60, offsetof(mavlink_autopilot_version_t, uid2) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
|
||||
"AUTOPILOT_VERSION", \
|
||||
12, \
|
||||
{ { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
|
||||
{ "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
|
||||
{ "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
|
||||
{ "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
|
||||
{ "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
|
||||
{ "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \
|
||||
{ "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \
|
||||
{ "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \
|
||||
{ "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
|
||||
{ "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
|
||||
{ "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
|
||||
{ "uid2", NULL, MAVLINK_TYPE_UINT8_T, 18, 60, offsetof(mavlink_autopilot_version_t, uid2) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a autopilot_version message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param capabilities Bitmap of capabilities
|
||||
* @param flight_sw_version Firmware version number
|
||||
* @param middleware_sw_version Middleware version number
|
||||
* @param os_sw_version Operating system version number
|
||||
* @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
|
||||
* @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param vendor_id ID of the board vendor
|
||||
* @param product_id ID of the product
|
||||
* @param uid UID if provided by hardware (see uid2)
|
||||
* @param uid2 UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid, const uint8_t *uid2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, capabilities);
|
||||
_mav_put_uint64_t(buf, 8, uid);
|
||||
_mav_put_uint32_t(buf, 16, flight_sw_version);
|
||||
_mav_put_uint32_t(buf, 20, middleware_sw_version);
|
||||
_mav_put_uint32_t(buf, 24, os_sw_version);
|
||||
_mav_put_uint32_t(buf, 28, board_version);
|
||||
_mav_put_uint16_t(buf, 32, vendor_id);
|
||||
_mav_put_uint16_t(buf, 34, product_id);
|
||||
_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 60, uid2, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
|
||||
#else
|
||||
mavlink_autopilot_version_t packet;
|
||||
packet.capabilities = capabilities;
|
||||
packet.uid = uid;
|
||||
packet.flight_sw_version = flight_sw_version;
|
||||
packet.middleware_sw_version = middleware_sw_version;
|
||||
packet.os_sw_version = os_sw_version;
|
||||
packet.board_version = board_version;
|
||||
packet.vendor_id = vendor_id;
|
||||
packet.product_id = product_id;
|
||||
mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.uid2, uid2, sizeof(uint8_t)*18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a autopilot_version message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param capabilities Bitmap of capabilities
|
||||
* @param flight_sw_version Firmware version number
|
||||
* @param middleware_sw_version Middleware version number
|
||||
* @param os_sw_version Operating system version number
|
||||
* @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
|
||||
* @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param vendor_id ID of the board vendor
|
||||
* @param product_id ID of the product
|
||||
* @param uid UID if provided by hardware (see uid2)
|
||||
* @param uid2 UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t capabilities,uint32_t flight_sw_version,uint32_t middleware_sw_version,uint32_t os_sw_version,uint32_t board_version,const uint8_t *flight_custom_version,const uint8_t *middleware_custom_version,const uint8_t *os_custom_version,uint16_t vendor_id,uint16_t product_id,uint64_t uid,const uint8_t *uid2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, capabilities);
|
||||
_mav_put_uint64_t(buf, 8, uid);
|
||||
_mav_put_uint32_t(buf, 16, flight_sw_version);
|
||||
_mav_put_uint32_t(buf, 20, middleware_sw_version);
|
||||
_mav_put_uint32_t(buf, 24, os_sw_version);
|
||||
_mav_put_uint32_t(buf, 28, board_version);
|
||||
_mav_put_uint16_t(buf, 32, vendor_id);
|
||||
_mav_put_uint16_t(buf, 34, product_id);
|
||||
_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 60, uid2, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
|
||||
#else
|
||||
mavlink_autopilot_version_t packet;
|
||||
packet.capabilities = capabilities;
|
||||
packet.uid = uid;
|
||||
packet.flight_sw_version = flight_sw_version;
|
||||
packet.middleware_sw_version = middleware_sw_version;
|
||||
packet.os_sw_version = os_sw_version;
|
||||
packet.board_version = board_version;
|
||||
packet.vendor_id = vendor_id;
|
||||
packet.product_id = product_id;
|
||||
mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.uid2, uid2, sizeof(uint8_t)*18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a autopilot_version struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param autopilot_version C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_autopilot_version_t* autopilot_version)
|
||||
{
|
||||
return mavlink_msg_autopilot_version_pack(system_id, component_id, msg, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid, autopilot_version->uid2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a autopilot_version struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param autopilot_version C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_autopilot_version_t* autopilot_version)
|
||||
{
|
||||
return mavlink_msg_autopilot_version_pack_chan(system_id, component_id, chan, msg, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid, autopilot_version->uid2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a autopilot_version message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param capabilities Bitmap of capabilities
|
||||
* @param flight_sw_version Firmware version number
|
||||
* @param middleware_sw_version Middleware version number
|
||||
* @param os_sw_version Operating system version number
|
||||
* @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
|
||||
* @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param vendor_id ID of the board vendor
|
||||
* @param product_id ID of the product
|
||||
* @param uid UID if provided by hardware (see uid2)
|
||||
* @param uid2 UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_autopilot_version_send(mavlink_channel_t chan, uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid, const uint8_t *uid2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, capabilities);
|
||||
_mav_put_uint64_t(buf, 8, uid);
|
||||
_mav_put_uint32_t(buf, 16, flight_sw_version);
|
||||
_mav_put_uint32_t(buf, 20, middleware_sw_version);
|
||||
_mav_put_uint32_t(buf, 24, os_sw_version);
|
||||
_mav_put_uint32_t(buf, 28, board_version);
|
||||
_mav_put_uint16_t(buf, 32, vendor_id);
|
||||
_mav_put_uint16_t(buf, 34, product_id);
|
||||
_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 60, uid2, 18);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
#else
|
||||
mavlink_autopilot_version_t packet;
|
||||
packet.capabilities = capabilities;
|
||||
packet.uid = uid;
|
||||
packet.flight_sw_version = flight_sw_version;
|
||||
packet.middleware_sw_version = middleware_sw_version;
|
||||
packet.os_sw_version = os_sw_version;
|
||||
packet.board_version = board_version;
|
||||
packet.vendor_id = vendor_id;
|
||||
packet.product_id = product_id;
|
||||
mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.uid2, uid2, sizeof(uint8_t)*18);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)&packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a autopilot_version message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_autopilot_version_send_struct(mavlink_channel_t chan, const mavlink_autopilot_version_t* autopilot_version)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_autopilot_version_send(chan, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid, autopilot_version->uid2);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)autopilot_version, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_autopilot_version_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid, const uint8_t *uid2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, capabilities);
|
||||
_mav_put_uint64_t(buf, 8, uid);
|
||||
_mav_put_uint32_t(buf, 16, flight_sw_version);
|
||||
_mav_put_uint32_t(buf, 20, middleware_sw_version);
|
||||
_mav_put_uint32_t(buf, 24, os_sw_version);
|
||||
_mav_put_uint32_t(buf, 28, board_version);
|
||||
_mav_put_uint16_t(buf, 32, vendor_id);
|
||||
_mav_put_uint16_t(buf, 34, product_id);
|
||||
_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 60, uid2, 18);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
#else
|
||||
mavlink_autopilot_version_t *packet = (mavlink_autopilot_version_t *)msgbuf;
|
||||
packet->capabilities = capabilities;
|
||||
packet->uid = uid;
|
||||
packet->flight_sw_version = flight_sw_version;
|
||||
packet->middleware_sw_version = middleware_sw_version;
|
||||
packet->os_sw_version = os_sw_version;
|
||||
packet->board_version = board_version;
|
||||
packet->vendor_id = vendor_id;
|
||||
packet->product_id = product_id;
|
||||
mav_array_memcpy(packet->flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet->middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet->os_custom_version, os_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet->uid2, uid2, sizeof(uint8_t)*18);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE AUTOPILOT_VERSION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field capabilities from autopilot_version message
|
||||
*
|
||||
* @return Bitmap of capabilities
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_autopilot_version_get_capabilities(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flight_sw_version from autopilot_version message
|
||||
*
|
||||
* @return Firmware version number
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_autopilot_version_get_flight_sw_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field middleware_sw_version from autopilot_version message
|
||||
*
|
||||
* @return Middleware version number
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_autopilot_version_get_middleware_sw_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field os_sw_version from autopilot_version message
|
||||
*
|
||||
* @return Operating system version number
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_autopilot_version_get_os_sw_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field board_version from autopilot_version message
|
||||
*
|
||||
* @return HW / board version (last 8 bytes should be silicon ID, if any)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_autopilot_version_get_board_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flight_custom_version from autopilot_version message
|
||||
*
|
||||
* @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_get_flight_custom_version(const mavlink_message_t* msg, uint8_t *flight_custom_version)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, flight_custom_version, 8, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field middleware_custom_version from autopilot_version message
|
||||
*
|
||||
* @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_get_middleware_custom_version(const mavlink_message_t* msg, uint8_t *middleware_custom_version)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, middleware_custom_version, 8, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field os_custom_version from autopilot_version message
|
||||
*
|
||||
* @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_get_os_custom_version(const mavlink_message_t* msg, uint8_t *os_custom_version)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, os_custom_version, 8, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vendor_id from autopilot_version message
|
||||
*
|
||||
* @return ID of the board vendor
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_get_vendor_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field product_id from autopilot_version message
|
||||
*
|
||||
* @return ID of the product
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_get_product_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field uid from autopilot_version message
|
||||
*
|
||||
* @return UID if provided by hardware (see uid2)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_autopilot_version_get_uid(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field uid2 from autopilot_version message
|
||||
*
|
||||
* @return UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_get_uid2(const mavlink_message_t* msg, uint8_t *uid2)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, uid2, 18, 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a autopilot_version message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param autopilot_version C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_autopilot_version_decode(const mavlink_message_t* msg, mavlink_autopilot_version_t* autopilot_version)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
autopilot_version->capabilities = mavlink_msg_autopilot_version_get_capabilities(msg);
|
||||
autopilot_version->uid = mavlink_msg_autopilot_version_get_uid(msg);
|
||||
autopilot_version->flight_sw_version = mavlink_msg_autopilot_version_get_flight_sw_version(msg);
|
||||
autopilot_version->middleware_sw_version = mavlink_msg_autopilot_version_get_middleware_sw_version(msg);
|
||||
autopilot_version->os_sw_version = mavlink_msg_autopilot_version_get_os_sw_version(msg);
|
||||
autopilot_version->board_version = mavlink_msg_autopilot_version_get_board_version(msg);
|
||||
autopilot_version->vendor_id = mavlink_msg_autopilot_version_get_vendor_id(msg);
|
||||
autopilot_version->product_id = mavlink_msg_autopilot_version_get_product_id(msg);
|
||||
mavlink_msg_autopilot_version_get_flight_custom_version(msg, autopilot_version->flight_custom_version);
|
||||
mavlink_msg_autopilot_version_get_middleware_custom_version(msg, autopilot_version->middleware_custom_version);
|
||||
mavlink_msg_autopilot_version_get_os_custom_version(msg, autopilot_version->os_custom_version);
|
||||
mavlink_msg_autopilot_version_get_uid2(msg, autopilot_version->uid2);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN? msg->len : MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN;
|
||||
memset(autopilot_version, 0, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
|
||||
memcpy(autopilot_version, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,455 @@
|
||||
#pragma once
|
||||
// MESSAGE BATTERY_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS 147
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_battery_status_t {
|
||||
int32_t current_consumed; /*< [mAh] Consumed charge, -1: autopilot does not provide consumption estimate*/
|
||||
int32_t energy_consumed; /*< [hJ] Consumed energy, -1: autopilot does not provide energy consumption estimate*/
|
||||
int16_t temperature; /*< [cdegC] Temperature of the battery. INT16_MAX for unknown temperature.*/
|
||||
uint16_t voltages[10]; /*< [mV] Battery voltage of cells. Cells above the valid cell count for this battery should have the UINT16_MAX value.*/
|
||||
int16_t current_battery; /*< [cA] Battery current, -1: autopilot does not measure the current*/
|
||||
uint8_t id; /*< Battery ID*/
|
||||
uint8_t battery_function; /*< Function of the battery*/
|
||||
uint8_t type; /*< Type (chemistry) of the battery*/
|
||||
int8_t battery_remaining; /*< [%] Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery.*/
|
||||
int32_t time_remaining; /*< [s] Remaining battery time, 0: autopilot does not provide remaining battery time estimate*/
|
||||
uint8_t charge_state; /*< State for extent of discharge, provided by autopilot for warning or external reactions*/
|
||||
}) mavlink_battery_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 41
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN 36
|
||||
#define MAVLINK_MSG_ID_147_LEN 41
|
||||
#define MAVLINK_MSG_ID_147_MIN_LEN 36
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS_CRC 154
|
||||
#define MAVLINK_MSG_ID_147_CRC 154
|
||||
|
||||
#define MAVLINK_MSG_BATTERY_STATUS_FIELD_VOLTAGES_LEN 10
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \
|
||||
147, \
|
||||
"BATTERY_STATUS", \
|
||||
11, \
|
||||
{ { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \
|
||||
{ "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_battery_status_t, temperature) }, \
|
||||
{ "voltages", NULL, MAVLINK_TYPE_UINT16_T, 10, 10, offsetof(mavlink_battery_status_t, voltages) }, \
|
||||
{ "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_battery_status_t, current_battery) }, \
|
||||
{ "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \
|
||||
{ "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \
|
||||
{ "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \
|
||||
{ "time_remaining", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_battery_status_t, time_remaining) }, \
|
||||
{ "charge_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_battery_status_t, charge_state) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \
|
||||
"BATTERY_STATUS", \
|
||||
11, \
|
||||
{ { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \
|
||||
{ "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_battery_status_t, temperature) }, \
|
||||
{ "voltages", NULL, MAVLINK_TYPE_UINT16_T, 10, 10, offsetof(mavlink_battery_status_t, voltages) }, \
|
||||
{ "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_battery_status_t, current_battery) }, \
|
||||
{ "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \
|
||||
{ "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \
|
||||
{ "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \
|
||||
{ "time_remaining", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_battery_status_t, time_remaining) }, \
|
||||
{ "charge_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_battery_status_t, charge_state) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a battery_status message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param id Battery ID
|
||||
* @param battery_function Function of the battery
|
||||
* @param type Type (chemistry) of the battery
|
||||
* @param temperature [cdegC] Temperature of the battery. INT16_MAX for unknown temperature.
|
||||
* @param voltages [mV] Battery voltage of cells. Cells above the valid cell count for this battery should have the UINT16_MAX value.
|
||||
* @param current_battery [cA] Battery current, -1: autopilot does not measure the current
|
||||
* @param current_consumed [mAh] Consumed charge, -1: autopilot does not provide consumption estimate
|
||||
* @param energy_consumed [hJ] Consumed energy, -1: autopilot does not provide energy consumption estimate
|
||||
* @param battery_remaining [%] Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery.
|
||||
* @param time_remaining [s] Remaining battery time, 0: autopilot does not provide remaining battery time estimate
|
||||
* @param charge_state State for extent of discharge, provided by autopilot for warning or external reactions
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining, int32_t time_remaining, uint8_t charge_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
|
||||
_mav_put_int32_t(buf, 0, current_consumed);
|
||||
_mav_put_int32_t(buf, 4, energy_consumed);
|
||||
_mav_put_int16_t(buf, 8, temperature);
|
||||
_mav_put_int16_t(buf, 30, current_battery);
|
||||
_mav_put_uint8_t(buf, 32, id);
|
||||
_mav_put_uint8_t(buf, 33, battery_function);
|
||||
_mav_put_uint8_t(buf, 34, type);
|
||||
_mav_put_int8_t(buf, 35, battery_remaining);
|
||||
_mav_put_int32_t(buf, 36, time_remaining);
|
||||
_mav_put_uint8_t(buf, 40, charge_state);
|
||||
_mav_put_uint16_t_array(buf, 10, voltages, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.current_consumed = current_consumed;
|
||||
packet.energy_consumed = energy_consumed;
|
||||
packet.temperature = temperature;
|
||||
packet.current_battery = current_battery;
|
||||
packet.id = id;
|
||||
packet.battery_function = battery_function;
|
||||
packet.type = type;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
packet.time_remaining = time_remaining;
|
||||
packet.charge_state = charge_state;
|
||||
mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a battery_status message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param id Battery ID
|
||||
* @param battery_function Function of the battery
|
||||
* @param type Type (chemistry) of the battery
|
||||
* @param temperature [cdegC] Temperature of the battery. INT16_MAX for unknown temperature.
|
||||
* @param voltages [mV] Battery voltage of cells. Cells above the valid cell count for this battery should have the UINT16_MAX value.
|
||||
* @param current_battery [cA] Battery current, -1: autopilot does not measure the current
|
||||
* @param current_consumed [mAh] Consumed charge, -1: autopilot does not provide consumption estimate
|
||||
* @param energy_consumed [hJ] Consumed energy, -1: autopilot does not provide energy consumption estimate
|
||||
* @param battery_remaining [%] Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery.
|
||||
* @param time_remaining [s] Remaining battery time, 0: autopilot does not provide remaining battery time estimate
|
||||
* @param charge_state State for extent of discharge, provided by autopilot for warning or external reactions
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t id,uint8_t battery_function,uint8_t type,int16_t temperature,const uint16_t *voltages,int16_t current_battery,int32_t current_consumed,int32_t energy_consumed,int8_t battery_remaining,int32_t time_remaining,uint8_t charge_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
|
||||
_mav_put_int32_t(buf, 0, current_consumed);
|
||||
_mav_put_int32_t(buf, 4, energy_consumed);
|
||||
_mav_put_int16_t(buf, 8, temperature);
|
||||
_mav_put_int16_t(buf, 30, current_battery);
|
||||
_mav_put_uint8_t(buf, 32, id);
|
||||
_mav_put_uint8_t(buf, 33, battery_function);
|
||||
_mav_put_uint8_t(buf, 34, type);
|
||||
_mav_put_int8_t(buf, 35, battery_remaining);
|
||||
_mav_put_int32_t(buf, 36, time_remaining);
|
||||
_mav_put_uint8_t(buf, 40, charge_state);
|
||||
_mav_put_uint16_t_array(buf, 10, voltages, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.current_consumed = current_consumed;
|
||||
packet.energy_consumed = energy_consumed;
|
||||
packet.temperature = temperature;
|
||||
packet.current_battery = current_battery;
|
||||
packet.id = id;
|
||||
packet.battery_function = battery_function;
|
||||
packet.type = type;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
packet.time_remaining = time_remaining;
|
||||
packet.charge_state = charge_state;
|
||||
mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a battery_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param battery_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status)
|
||||
{
|
||||
return mavlink_msg_battery_status_pack(system_id, component_id, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining, battery_status->time_remaining, battery_status->charge_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a battery_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param battery_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status)
|
||||
{
|
||||
return mavlink_msg_battery_status_pack_chan(system_id, component_id, chan, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining, battery_status->time_remaining, battery_status->charge_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a battery_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param id Battery ID
|
||||
* @param battery_function Function of the battery
|
||||
* @param type Type (chemistry) of the battery
|
||||
* @param temperature [cdegC] Temperature of the battery. INT16_MAX for unknown temperature.
|
||||
* @param voltages [mV] Battery voltage of cells. Cells above the valid cell count for this battery should have the UINT16_MAX value.
|
||||
* @param current_battery [cA] Battery current, -1: autopilot does not measure the current
|
||||
* @param current_consumed [mAh] Consumed charge, -1: autopilot does not provide consumption estimate
|
||||
* @param energy_consumed [hJ] Consumed energy, -1: autopilot does not provide energy consumption estimate
|
||||
* @param battery_remaining [%] Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery.
|
||||
* @param time_remaining [s] Remaining battery time, 0: autopilot does not provide remaining battery time estimate
|
||||
* @param charge_state State for extent of discharge, provided by autopilot for warning or external reactions
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining, int32_t time_remaining, uint8_t charge_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
|
||||
_mav_put_int32_t(buf, 0, current_consumed);
|
||||
_mav_put_int32_t(buf, 4, energy_consumed);
|
||||
_mav_put_int16_t(buf, 8, temperature);
|
||||
_mav_put_int16_t(buf, 30, current_battery);
|
||||
_mav_put_uint8_t(buf, 32, id);
|
||||
_mav_put_uint8_t(buf, 33, battery_function);
|
||||
_mav_put_uint8_t(buf, 34, type);
|
||||
_mav_put_int8_t(buf, 35, battery_remaining);
|
||||
_mav_put_int32_t(buf, 36, time_remaining);
|
||||
_mav_put_uint8_t(buf, 40, charge_state);
|
||||
_mav_put_uint16_t_array(buf, 10, voltages, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.current_consumed = current_consumed;
|
||||
packet.energy_consumed = energy_consumed;
|
||||
packet.temperature = temperature;
|
||||
packet.current_battery = current_battery;
|
||||
packet.id = id;
|
||||
packet.battery_function = battery_function;
|
||||
packet.type = type;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
packet.time_remaining = time_remaining;
|
||||
packet.charge_state = charge_state;
|
||||
mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a battery_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_battery_status_send_struct(mavlink_channel_t chan, const mavlink_battery_status_t* battery_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_battery_status_send(chan, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining, battery_status->time_remaining, battery_status->charge_state);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)battery_status, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_BATTERY_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_battery_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining, int32_t time_remaining, uint8_t charge_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, current_consumed);
|
||||
_mav_put_int32_t(buf, 4, energy_consumed);
|
||||
_mav_put_int16_t(buf, 8, temperature);
|
||||
_mav_put_int16_t(buf, 30, current_battery);
|
||||
_mav_put_uint8_t(buf, 32, id);
|
||||
_mav_put_uint8_t(buf, 33, battery_function);
|
||||
_mav_put_uint8_t(buf, 34, type);
|
||||
_mav_put_int8_t(buf, 35, battery_remaining);
|
||||
_mav_put_int32_t(buf, 36, time_remaining);
|
||||
_mav_put_uint8_t(buf, 40, charge_state);
|
||||
_mav_put_uint16_t_array(buf, 10, voltages, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
#else
|
||||
mavlink_battery_status_t *packet = (mavlink_battery_status_t *)msgbuf;
|
||||
packet->current_consumed = current_consumed;
|
||||
packet->energy_consumed = energy_consumed;
|
||||
packet->temperature = temperature;
|
||||
packet->current_battery = current_battery;
|
||||
packet->id = id;
|
||||
packet->battery_function = battery_function;
|
||||
packet->type = type;
|
||||
packet->battery_remaining = battery_remaining;
|
||||
packet->time_remaining = time_remaining;
|
||||
packet->charge_state = charge_state;
|
||||
mav_array_memcpy(packet->voltages, voltages, sizeof(uint16_t)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)packet, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE BATTERY_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field id from battery_status message
|
||||
*
|
||||
* @return Battery ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_battery_status_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field battery_function from battery_status message
|
||||
*
|
||||
* @return Function of the battery
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_battery_status_get_battery_function(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field type from battery_status message
|
||||
*
|
||||
* @return Type (chemistry) of the battery
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_battery_status_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field temperature from battery_status message
|
||||
*
|
||||
* @return [cdegC] Temperature of the battery. INT16_MAX for unknown temperature.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_battery_status_get_temperature(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field voltages from battery_status message
|
||||
*
|
||||
* @return [mV] Battery voltage of cells. Cells above the valid cell count for this battery should have the UINT16_MAX value.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltages(const mavlink_message_t* msg, uint16_t *voltages)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t_array(msg, voltages, 10, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current_battery from battery_status message
|
||||
*
|
||||
* @return [cA] Battery current, -1: autopilot does not measure the current
|
||||
*/
|
||||
static inline int16_t mavlink_msg_battery_status_get_current_battery(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current_consumed from battery_status message
|
||||
*
|
||||
* @return [mAh] Consumed charge, -1: autopilot does not provide consumption estimate
|
||||
*/
|
||||
static inline int32_t mavlink_msg_battery_status_get_current_consumed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field energy_consumed from battery_status message
|
||||
*
|
||||
* @return [hJ] Consumed energy, -1: autopilot does not provide energy consumption estimate
|
||||
*/
|
||||
static inline int32_t mavlink_msg_battery_status_get_energy_consumed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field battery_remaining from battery_status message
|
||||
*
|
||||
* @return [%] Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery.
|
||||
*/
|
||||
static inline int8_t mavlink_msg_battery_status_get_battery_remaining(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 35);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_remaining from battery_status message
|
||||
*
|
||||
* @return [s] Remaining battery time, 0: autopilot does not provide remaining battery time estimate
|
||||
*/
|
||||
static inline int32_t mavlink_msg_battery_status_get_time_remaining(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field charge_state from battery_status message
|
||||
*
|
||||
* @return State for extent of discharge, provided by autopilot for warning or external reactions
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_battery_status_get_charge_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a battery_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param battery_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_battery_status_decode(const mavlink_message_t* msg, mavlink_battery_status_t* battery_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
battery_status->current_consumed = mavlink_msg_battery_status_get_current_consumed(msg);
|
||||
battery_status->energy_consumed = mavlink_msg_battery_status_get_energy_consumed(msg);
|
||||
battery_status->temperature = mavlink_msg_battery_status_get_temperature(msg);
|
||||
mavlink_msg_battery_status_get_voltages(msg, battery_status->voltages);
|
||||
battery_status->current_battery = mavlink_msg_battery_status_get_current_battery(msg);
|
||||
battery_status->id = mavlink_msg_battery_status_get_id(msg);
|
||||
battery_status->battery_function = mavlink_msg_battery_status_get_battery_function(msg);
|
||||
battery_status->type = mavlink_msg_battery_status_get_type(msg);
|
||||
battery_status->battery_remaining = mavlink_msg_battery_status_get_battery_remaining(msg);
|
||||
battery_status->time_remaining = mavlink_msg_battery_status_get_time_remaining(msg);
|
||||
battery_status->charge_state = mavlink_msg_battery_status_get_charge_state(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_BATTERY_STATUS_LEN? msg->len : MAVLINK_MSG_ID_BATTERY_STATUS_LEN;
|
||||
memset(battery_status, 0, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
memcpy(battery_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE BUTTON_CHANGE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_BUTTON_CHANGE 257
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_button_change_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
uint32_t last_change_ms; /*< [ms] Time of last change of button state.*/
|
||||
uint8_t state; /*< Bitmap for state of buttons.*/
|
||||
}) mavlink_button_change_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_BUTTON_CHANGE_LEN 9
|
||||
#define MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN 9
|
||||
#define MAVLINK_MSG_ID_257_LEN 9
|
||||
#define MAVLINK_MSG_ID_257_MIN_LEN 9
|
||||
|
||||
#define MAVLINK_MSG_ID_BUTTON_CHANGE_CRC 131
|
||||
#define MAVLINK_MSG_ID_257_CRC 131
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_BUTTON_CHANGE { \
|
||||
257, \
|
||||
"BUTTON_CHANGE", \
|
||||
3, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_button_change_t, time_boot_ms) }, \
|
||||
{ "last_change_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_button_change_t, last_change_ms) }, \
|
||||
{ "state", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_button_change_t, state) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_BUTTON_CHANGE { \
|
||||
"BUTTON_CHANGE", \
|
||||
3, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_button_change_t, time_boot_ms) }, \
|
||||
{ "last_change_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_button_change_t, last_change_ms) }, \
|
||||
{ "state", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_button_change_t, state) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a button_change message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param last_change_ms [ms] Time of last change of button state.
|
||||
* @param state Bitmap for state of buttons.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_button_change_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, uint32_t last_change_ms, uint8_t state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BUTTON_CHANGE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint32_t(buf, 4, last_change_ms);
|
||||
_mav_put_uint8_t(buf, 8, state);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN);
|
||||
#else
|
||||
mavlink_button_change_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.last_change_ms = last_change_ms;
|
||||
packet.state = state;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BUTTON_CHANGE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a button_change message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param last_change_ms [ms] Time of last change of button state.
|
||||
* @param state Bitmap for state of buttons.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_button_change_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,uint32_t last_change_ms,uint8_t state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BUTTON_CHANGE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint32_t(buf, 4, last_change_ms);
|
||||
_mav_put_uint8_t(buf, 8, state);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN);
|
||||
#else
|
||||
mavlink_button_change_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.last_change_ms = last_change_ms;
|
||||
packet.state = state;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BUTTON_CHANGE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a button_change struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param button_change C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_button_change_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_button_change_t* button_change)
|
||||
{
|
||||
return mavlink_msg_button_change_pack(system_id, component_id, msg, button_change->time_boot_ms, button_change->last_change_ms, button_change->state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a button_change struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param button_change C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_button_change_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_button_change_t* button_change)
|
||||
{
|
||||
return mavlink_msg_button_change_pack_chan(system_id, component_id, chan, msg, button_change->time_boot_ms, button_change->last_change_ms, button_change->state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a button_change message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param last_change_ms [ms] Time of last change of button state.
|
||||
* @param state Bitmap for state of buttons.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_button_change_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t last_change_ms, uint8_t state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BUTTON_CHANGE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint32_t(buf, 4, last_change_ms);
|
||||
_mav_put_uint8_t(buf, 8, state);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BUTTON_CHANGE, buf, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
|
||||
#else
|
||||
mavlink_button_change_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.last_change_ms = last_change_ms;
|
||||
packet.state = state;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BUTTON_CHANGE, (const char *)&packet, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a button_change message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_button_change_send_struct(mavlink_channel_t chan, const mavlink_button_change_t* button_change)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_button_change_send(chan, button_change->time_boot_ms, button_change->last_change_ms, button_change->state);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BUTTON_CHANGE, (const char *)button_change, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_BUTTON_CHANGE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_button_change_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t last_change_ms, uint8_t state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint32_t(buf, 4, last_change_ms);
|
||||
_mav_put_uint8_t(buf, 8, state);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BUTTON_CHANGE, buf, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
|
||||
#else
|
||||
mavlink_button_change_t *packet = (mavlink_button_change_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->last_change_ms = last_change_ms;
|
||||
packet->state = state;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BUTTON_CHANGE, (const char *)packet, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE BUTTON_CHANGE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from button_change message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_button_change_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field last_change_ms from button_change message
|
||||
*
|
||||
* @return [ms] Time of last change of button state.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_button_change_get_last_change_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field state from button_change message
|
||||
*
|
||||
* @return Bitmap for state of buttons.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_button_change_get_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a button_change message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param button_change C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_button_change_decode(const mavlink_message_t* msg, mavlink_button_change_t* button_change)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
button_change->time_boot_ms = mavlink_msg_button_change_get_time_boot_ms(msg);
|
||||
button_change->last_change_ms = mavlink_msg_button_change_get_last_change_ms(msg);
|
||||
button_change->state = mavlink_msg_button_change_get_state(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_BUTTON_CHANGE_LEN? msg->len : MAVLINK_MSG_ID_BUTTON_CHANGE_LEN;
|
||||
memset(button_change, 0, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN);
|
||||
memcpy(button_change, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
#pragma once
|
||||
// MESSAGE CAMERA_CAPTURE_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS 262
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_camera_capture_status_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
float image_interval; /*< [s] Image capture interval*/
|
||||
uint32_t recording_time_ms; /*< [ms] Time since recording started*/
|
||||
float available_capacity; /*< [MiB] Available storage capacity.*/
|
||||
uint8_t image_status; /*< Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)*/
|
||||
uint8_t video_status; /*< Current status of video capturing (0: idle, 1: capture in progress)*/
|
||||
}) mavlink_camera_capture_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN 18
|
||||
#define MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN 18
|
||||
#define MAVLINK_MSG_ID_262_LEN 18
|
||||
#define MAVLINK_MSG_ID_262_MIN_LEN 18
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC 12
|
||||
#define MAVLINK_MSG_ID_262_CRC 12
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_CAPTURE_STATUS { \
|
||||
262, \
|
||||
"CAMERA_CAPTURE_STATUS", \
|
||||
6, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_capture_status_t, time_boot_ms) }, \
|
||||
{ "image_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_camera_capture_status_t, image_status) }, \
|
||||
{ "video_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_camera_capture_status_t, video_status) }, \
|
||||
{ "image_interval", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_camera_capture_status_t, image_interval) }, \
|
||||
{ "recording_time_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_capture_status_t, recording_time_ms) }, \
|
||||
{ "available_capacity", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_capture_status_t, available_capacity) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_CAPTURE_STATUS { \
|
||||
"CAMERA_CAPTURE_STATUS", \
|
||||
6, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_capture_status_t, time_boot_ms) }, \
|
||||
{ "image_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_camera_capture_status_t, image_status) }, \
|
||||
{ "video_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_camera_capture_status_t, video_status) }, \
|
||||
{ "image_interval", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_camera_capture_status_t, image_interval) }, \
|
||||
{ "recording_time_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_capture_status_t, recording_time_ms) }, \
|
||||
{ "available_capacity", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_capture_status_t, available_capacity) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_capture_status message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param image_status Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)
|
||||
* @param video_status Current status of video capturing (0: idle, 1: capture in progress)
|
||||
* @param image_interval [s] Image capture interval
|
||||
* @param recording_time_ms [ms] Time since recording started
|
||||
* @param available_capacity [MiB] Available storage capacity.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_capture_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, uint8_t image_status, uint8_t video_status, float image_interval, uint32_t recording_time_ms, float available_capacity)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, image_interval);
|
||||
_mav_put_uint32_t(buf, 8, recording_time_ms);
|
||||
_mav_put_float(buf, 12, available_capacity);
|
||||
_mav_put_uint8_t(buf, 16, image_status);
|
||||
_mav_put_uint8_t(buf, 17, video_status);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
|
||||
#else
|
||||
mavlink_camera_capture_status_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.image_interval = image_interval;
|
||||
packet.recording_time_ms = recording_time_ms;
|
||||
packet.available_capacity = available_capacity;
|
||||
packet.image_status = image_status;
|
||||
packet.video_status = video_status;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_capture_status message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param image_status Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)
|
||||
* @param video_status Current status of video capturing (0: idle, 1: capture in progress)
|
||||
* @param image_interval [s] Image capture interval
|
||||
* @param recording_time_ms [ms] Time since recording started
|
||||
* @param available_capacity [MiB] Available storage capacity.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_capture_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,uint8_t image_status,uint8_t video_status,float image_interval,uint32_t recording_time_ms,float available_capacity)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, image_interval);
|
||||
_mav_put_uint32_t(buf, 8, recording_time_ms);
|
||||
_mav_put_float(buf, 12, available_capacity);
|
||||
_mav_put_uint8_t(buf, 16, image_status);
|
||||
_mav_put_uint8_t(buf, 17, video_status);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
|
||||
#else
|
||||
mavlink_camera_capture_status_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.image_interval = image_interval;
|
||||
packet.recording_time_ms = recording_time_ms;
|
||||
packet.available_capacity = available_capacity;
|
||||
packet.image_status = image_status;
|
||||
packet.video_status = video_status;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_capture_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_capture_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_capture_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_capture_status_t* camera_capture_status)
|
||||
{
|
||||
return mavlink_msg_camera_capture_status_pack(system_id, component_id, msg, camera_capture_status->time_boot_ms, camera_capture_status->image_status, camera_capture_status->video_status, camera_capture_status->image_interval, camera_capture_status->recording_time_ms, camera_capture_status->available_capacity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_capture_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_capture_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_capture_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_capture_status_t* camera_capture_status)
|
||||
{
|
||||
return mavlink_msg_camera_capture_status_pack_chan(system_id, component_id, chan, msg, camera_capture_status->time_boot_ms, camera_capture_status->image_status, camera_capture_status->video_status, camera_capture_status->image_interval, camera_capture_status->recording_time_ms, camera_capture_status->available_capacity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_capture_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param image_status Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)
|
||||
* @param video_status Current status of video capturing (0: idle, 1: capture in progress)
|
||||
* @param image_interval [s] Image capture interval
|
||||
* @param recording_time_ms [ms] Time since recording started
|
||||
* @param available_capacity [MiB] Available storage capacity.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_camera_capture_status_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t image_status, uint8_t video_status, float image_interval, uint32_t recording_time_ms, float available_capacity)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, image_interval);
|
||||
_mav_put_uint32_t(buf, 8, recording_time_ms);
|
||||
_mav_put_float(buf, 12, available_capacity);
|
||||
_mav_put_uint8_t(buf, 16, image_status);
|
||||
_mav_put_uint8_t(buf, 17, video_status);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS, buf, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
|
||||
#else
|
||||
mavlink_camera_capture_status_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.image_interval = image_interval;
|
||||
packet.recording_time_ms = recording_time_ms;
|
||||
packet.available_capacity = available_capacity;
|
||||
packet.image_status = image_status;
|
||||
packet.video_status = video_status;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_capture_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_camera_capture_status_send_struct(mavlink_channel_t chan, const mavlink_camera_capture_status_t* camera_capture_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_camera_capture_status_send(chan, camera_capture_status->time_boot_ms, camera_capture_status->image_status, camera_capture_status->video_status, camera_capture_status->image_interval, camera_capture_status->recording_time_ms, camera_capture_status->available_capacity);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS, (const char *)camera_capture_status, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_camera_capture_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t image_status, uint8_t video_status, float image_interval, uint32_t recording_time_ms, float available_capacity)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, image_interval);
|
||||
_mav_put_uint32_t(buf, 8, recording_time_ms);
|
||||
_mav_put_float(buf, 12, available_capacity);
|
||||
_mav_put_uint8_t(buf, 16, image_status);
|
||||
_mav_put_uint8_t(buf, 17, video_status);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS, buf, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
|
||||
#else
|
||||
mavlink_camera_capture_status_t *packet = (mavlink_camera_capture_status_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->image_interval = image_interval;
|
||||
packet->recording_time_ms = recording_time_ms;
|
||||
packet->available_capacity = available_capacity;
|
||||
packet->image_status = image_status;
|
||||
packet->video_status = video_status;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS, (const char *)packet, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CAMERA_CAPTURE_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from camera_capture_status message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_camera_capture_status_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field image_status from camera_capture_status message
|
||||
*
|
||||
* @return Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_camera_capture_status_get_image_status(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field video_status from camera_capture_status message
|
||||
*
|
||||
* @return Current status of video capturing (0: idle, 1: capture in progress)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_camera_capture_status_get_video_status(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 17);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field image_interval from camera_capture_status message
|
||||
*
|
||||
* @return [s] Image capture interval
|
||||
*/
|
||||
static inline float mavlink_msg_camera_capture_status_get_image_interval(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field recording_time_ms from camera_capture_status message
|
||||
*
|
||||
* @return [ms] Time since recording started
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_camera_capture_status_get_recording_time_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field available_capacity from camera_capture_status message
|
||||
*
|
||||
* @return [MiB] Available storage capacity.
|
||||
*/
|
||||
static inline float mavlink_msg_camera_capture_status_get_available_capacity(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a camera_capture_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param camera_capture_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_camera_capture_status_decode(const mavlink_message_t* msg, mavlink_camera_capture_status_t* camera_capture_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
camera_capture_status->time_boot_ms = mavlink_msg_camera_capture_status_get_time_boot_ms(msg);
|
||||
camera_capture_status->image_interval = mavlink_msg_camera_capture_status_get_image_interval(msg);
|
||||
camera_capture_status->recording_time_ms = mavlink_msg_camera_capture_status_get_recording_time_ms(msg);
|
||||
camera_capture_status->available_capacity = mavlink_msg_camera_capture_status_get_available_capacity(msg);
|
||||
camera_capture_status->image_status = mavlink_msg_camera_capture_status_get_image_status(msg);
|
||||
camera_capture_status->video_status = mavlink_msg_camera_capture_status_get_video_status(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN;
|
||||
memset(camera_capture_status, 0, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
|
||||
memcpy(camera_capture_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,456 @@
|
||||
#pragma once
|
||||
// MESSAGE CAMERA_IMAGE_CAPTURED PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED 263
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_camera_image_captured_t {
|
||||
uint64_t time_utc; /*< [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.*/
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
int32_t lat; /*< [degE7] Latitude where image was taken*/
|
||||
int32_t lon; /*< [degE7] Longitude where capture was taken*/
|
||||
int32_t alt; /*< [mm] Altitude (AMSL) where image was taken*/
|
||||
int32_t relative_alt; /*< [mm] Altitude above ground*/
|
||||
float q[4]; /*< Quaternion of camera orientation (w, x, y, z order, zero-rotation is 0, 0, 0, 0)*/
|
||||
int32_t image_index; /*< Zero based index of this image (image count since armed -1)*/
|
||||
uint8_t camera_id; /*< Camera ID (1 for first, 2 for second, etc.)*/
|
||||
int8_t capture_result; /*< Boolean indicating success (1) or failure (0) while capturing this image.*/
|
||||
char file_url[205]; /*< URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.*/
|
||||
}) mavlink_camera_image_captured_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN 255
|
||||
#define MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN 255
|
||||
#define MAVLINK_MSG_ID_263_LEN 255
|
||||
#define MAVLINK_MSG_ID_263_MIN_LEN 255
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC 133
|
||||
#define MAVLINK_MSG_ID_263_CRC 133
|
||||
|
||||
#define MAVLINK_MSG_CAMERA_IMAGE_CAPTURED_FIELD_Q_LEN 4
|
||||
#define MAVLINK_MSG_CAMERA_IMAGE_CAPTURED_FIELD_FILE_URL_LEN 205
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_IMAGE_CAPTURED { \
|
||||
263, \
|
||||
"CAMERA_IMAGE_CAPTURED", \
|
||||
11, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_image_captured_t, time_boot_ms) }, \
|
||||
{ "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_image_captured_t, time_utc) }, \
|
||||
{ "camera_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 48, offsetof(mavlink_camera_image_captured_t, camera_id) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_camera_image_captured_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_camera_image_captured_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_camera_image_captured_t, alt) }, \
|
||||
{ "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_camera_image_captured_t, relative_alt) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 28, offsetof(mavlink_camera_image_captured_t, q) }, \
|
||||
{ "image_index", NULL, MAVLINK_TYPE_INT32_T, 0, 44, offsetof(mavlink_camera_image_captured_t, image_index) }, \
|
||||
{ "capture_result", NULL, MAVLINK_TYPE_INT8_T, 0, 49, offsetof(mavlink_camera_image_captured_t, capture_result) }, \
|
||||
{ "file_url", NULL, MAVLINK_TYPE_CHAR, 205, 50, offsetof(mavlink_camera_image_captured_t, file_url) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_IMAGE_CAPTURED { \
|
||||
"CAMERA_IMAGE_CAPTURED", \
|
||||
11, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_image_captured_t, time_boot_ms) }, \
|
||||
{ "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_image_captured_t, time_utc) }, \
|
||||
{ "camera_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 48, offsetof(mavlink_camera_image_captured_t, camera_id) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_camera_image_captured_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_camera_image_captured_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_camera_image_captured_t, alt) }, \
|
||||
{ "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_camera_image_captured_t, relative_alt) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 28, offsetof(mavlink_camera_image_captured_t, q) }, \
|
||||
{ "image_index", NULL, MAVLINK_TYPE_INT32_T, 0, 44, offsetof(mavlink_camera_image_captured_t, image_index) }, \
|
||||
{ "capture_result", NULL, MAVLINK_TYPE_INT8_T, 0, 49, offsetof(mavlink_camera_image_captured_t, capture_result) }, \
|
||||
{ "file_url", NULL, MAVLINK_TYPE_CHAR, 205, 50, offsetof(mavlink_camera_image_captured_t, file_url) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_image_captured message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param time_utc [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
|
||||
* @param camera_id Camera ID (1 for first, 2 for second, etc.)
|
||||
* @param lat [degE7] Latitude where image was taken
|
||||
* @param lon [degE7] Longitude where capture was taken
|
||||
* @param alt [mm] Altitude (AMSL) where image was taken
|
||||
* @param relative_alt [mm] Altitude above ground
|
||||
* @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 0, 0, 0, 0)
|
||||
* @param image_index Zero based index of this image (image count since armed -1)
|
||||
* @param capture_result Boolean indicating success (1) or failure (0) while capturing this image.
|
||||
* @param file_url URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_image_captured_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, uint64_t time_utc, uint8_t camera_id, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, const float *q, int32_t image_index, int8_t capture_result, const char *file_url)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_utc);
|
||||
_mav_put_uint32_t(buf, 8, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_int32_t(buf, 20, alt);
|
||||
_mav_put_int32_t(buf, 24, relative_alt);
|
||||
_mav_put_int32_t(buf, 44, image_index);
|
||||
_mav_put_uint8_t(buf, 48, camera_id);
|
||||
_mav_put_int8_t(buf, 49, capture_result);
|
||||
_mav_put_float_array(buf, 28, q, 4);
|
||||
_mav_put_char_array(buf, 50, file_url, 205);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
|
||||
#else
|
||||
mavlink_camera_image_captured_t packet;
|
||||
packet.time_utc = time_utc;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.image_index = image_index;
|
||||
packet.camera_id = camera_id;
|
||||
packet.capture_result = capture_result;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.file_url, file_url, sizeof(char)*205);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_image_captured message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param time_utc [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
|
||||
* @param camera_id Camera ID (1 for first, 2 for second, etc.)
|
||||
* @param lat [degE7] Latitude where image was taken
|
||||
* @param lon [degE7] Longitude where capture was taken
|
||||
* @param alt [mm] Altitude (AMSL) where image was taken
|
||||
* @param relative_alt [mm] Altitude above ground
|
||||
* @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 0, 0, 0, 0)
|
||||
* @param image_index Zero based index of this image (image count since armed -1)
|
||||
* @param capture_result Boolean indicating success (1) or failure (0) while capturing this image.
|
||||
* @param file_url URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_image_captured_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,uint64_t time_utc,uint8_t camera_id,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,const float *q,int32_t image_index,int8_t capture_result,const char *file_url)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_utc);
|
||||
_mav_put_uint32_t(buf, 8, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_int32_t(buf, 20, alt);
|
||||
_mav_put_int32_t(buf, 24, relative_alt);
|
||||
_mav_put_int32_t(buf, 44, image_index);
|
||||
_mav_put_uint8_t(buf, 48, camera_id);
|
||||
_mav_put_int8_t(buf, 49, capture_result);
|
||||
_mav_put_float_array(buf, 28, q, 4);
|
||||
_mav_put_char_array(buf, 50, file_url, 205);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
|
||||
#else
|
||||
mavlink_camera_image_captured_t packet;
|
||||
packet.time_utc = time_utc;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.image_index = image_index;
|
||||
packet.camera_id = camera_id;
|
||||
packet.capture_result = capture_result;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.file_url, file_url, sizeof(char)*205);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_image_captured struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_image_captured C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_image_captured_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_image_captured_t* camera_image_captured)
|
||||
{
|
||||
return mavlink_msg_camera_image_captured_pack(system_id, component_id, msg, camera_image_captured->time_boot_ms, camera_image_captured->time_utc, camera_image_captured->camera_id, camera_image_captured->lat, camera_image_captured->lon, camera_image_captured->alt, camera_image_captured->relative_alt, camera_image_captured->q, camera_image_captured->image_index, camera_image_captured->capture_result, camera_image_captured->file_url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_image_captured struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_image_captured C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_image_captured_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_image_captured_t* camera_image_captured)
|
||||
{
|
||||
return mavlink_msg_camera_image_captured_pack_chan(system_id, component_id, chan, msg, camera_image_captured->time_boot_ms, camera_image_captured->time_utc, camera_image_captured->camera_id, camera_image_captured->lat, camera_image_captured->lon, camera_image_captured->alt, camera_image_captured->relative_alt, camera_image_captured->q, camera_image_captured->image_index, camera_image_captured->capture_result, camera_image_captured->file_url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_image_captured message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param time_utc [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
|
||||
* @param camera_id Camera ID (1 for first, 2 for second, etc.)
|
||||
* @param lat [degE7] Latitude where image was taken
|
||||
* @param lon [degE7] Longitude where capture was taken
|
||||
* @param alt [mm] Altitude (AMSL) where image was taken
|
||||
* @param relative_alt [mm] Altitude above ground
|
||||
* @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 0, 0, 0, 0)
|
||||
* @param image_index Zero based index of this image (image count since armed -1)
|
||||
* @param capture_result Boolean indicating success (1) or failure (0) while capturing this image.
|
||||
* @param file_url URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_camera_image_captured_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, uint8_t camera_id, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, const float *q, int32_t image_index, int8_t capture_result, const char *file_url)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_utc);
|
||||
_mav_put_uint32_t(buf, 8, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_int32_t(buf, 20, alt);
|
||||
_mav_put_int32_t(buf, 24, relative_alt);
|
||||
_mav_put_int32_t(buf, 44, image_index);
|
||||
_mav_put_uint8_t(buf, 48, camera_id);
|
||||
_mav_put_int8_t(buf, 49, capture_result);
|
||||
_mav_put_float_array(buf, 28, q, 4);
|
||||
_mav_put_char_array(buf, 50, file_url, 205);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED, buf, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
|
||||
#else
|
||||
mavlink_camera_image_captured_t packet;
|
||||
packet.time_utc = time_utc;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.image_index = image_index;
|
||||
packet.camera_id = camera_id;
|
||||
packet.capture_result = capture_result;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.file_url, file_url, sizeof(char)*205);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_image_captured message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_camera_image_captured_send_struct(mavlink_channel_t chan, const mavlink_camera_image_captured_t* camera_image_captured)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_camera_image_captured_send(chan, camera_image_captured->time_boot_ms, camera_image_captured->time_utc, camera_image_captured->camera_id, camera_image_captured->lat, camera_image_captured->lon, camera_image_captured->alt, camera_image_captured->relative_alt, camera_image_captured->q, camera_image_captured->image_index, camera_image_captured->capture_result, camera_image_captured->file_url);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED, (const char *)camera_image_captured, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_camera_image_captured_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, uint8_t camera_id, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, const float *q, int32_t image_index, int8_t capture_result, const char *file_url)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_utc);
|
||||
_mav_put_uint32_t(buf, 8, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_int32_t(buf, 20, alt);
|
||||
_mav_put_int32_t(buf, 24, relative_alt);
|
||||
_mav_put_int32_t(buf, 44, image_index);
|
||||
_mav_put_uint8_t(buf, 48, camera_id);
|
||||
_mav_put_int8_t(buf, 49, capture_result);
|
||||
_mav_put_float_array(buf, 28, q, 4);
|
||||
_mav_put_char_array(buf, 50, file_url, 205);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED, buf, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
|
||||
#else
|
||||
mavlink_camera_image_captured_t *packet = (mavlink_camera_image_captured_t *)msgbuf;
|
||||
packet->time_utc = time_utc;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->relative_alt = relative_alt;
|
||||
packet->image_index = image_index;
|
||||
packet->camera_id = camera_id;
|
||||
packet->capture_result = capture_result;
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet->file_url, file_url, sizeof(char)*205);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED, (const char *)packet, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CAMERA_IMAGE_CAPTURED UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from camera_image_captured message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_camera_image_captured_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_utc from camera_image_captured message
|
||||
*
|
||||
* @return [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_camera_image_captured_get_time_utc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field camera_id from camera_image_captured message
|
||||
*
|
||||
* @return Camera ID (1 for first, 2 for second, etc.)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_camera_image_captured_get_camera_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from camera_image_captured message
|
||||
*
|
||||
* @return [degE7] Latitude where image was taken
|
||||
*/
|
||||
static inline int32_t mavlink_msg_camera_image_captured_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from camera_image_captured message
|
||||
*
|
||||
* @return [degE7] Longitude where capture was taken
|
||||
*/
|
||||
static inline int32_t mavlink_msg_camera_image_captured_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from camera_image_captured message
|
||||
*
|
||||
* @return [mm] Altitude (AMSL) where image was taken
|
||||
*/
|
||||
static inline int32_t mavlink_msg_camera_image_captured_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field relative_alt from camera_image_captured message
|
||||
*
|
||||
* @return [mm] Altitude above ground
|
||||
*/
|
||||
static inline int32_t mavlink_msg_camera_image_captured_get_relative_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from camera_image_captured message
|
||||
*
|
||||
* @return Quaternion of camera orientation (w, x, y, z order, zero-rotation is 0, 0, 0, 0)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_image_captured_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field image_index from camera_image_captured message
|
||||
*
|
||||
* @return Zero based index of this image (image count since armed -1)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_camera_image_captured_get_image_index(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field capture_result from camera_image_captured message
|
||||
*
|
||||
* @return Boolean indicating success (1) or failure (0) while capturing this image.
|
||||
*/
|
||||
static inline int8_t mavlink_msg_camera_image_captured_get_capture_result(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 49);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field file_url from camera_image_captured message
|
||||
*
|
||||
* @return URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_image_captured_get_file_url(const mavlink_message_t* msg, char *file_url)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, file_url, 205, 50);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a camera_image_captured message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param camera_image_captured C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_camera_image_captured_decode(const mavlink_message_t* msg, mavlink_camera_image_captured_t* camera_image_captured)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
camera_image_captured->time_utc = mavlink_msg_camera_image_captured_get_time_utc(msg);
|
||||
camera_image_captured->time_boot_ms = mavlink_msg_camera_image_captured_get_time_boot_ms(msg);
|
||||
camera_image_captured->lat = mavlink_msg_camera_image_captured_get_lat(msg);
|
||||
camera_image_captured->lon = mavlink_msg_camera_image_captured_get_lon(msg);
|
||||
camera_image_captured->alt = mavlink_msg_camera_image_captured_get_alt(msg);
|
||||
camera_image_captured->relative_alt = mavlink_msg_camera_image_captured_get_relative_alt(msg);
|
||||
mavlink_msg_camera_image_captured_get_q(msg, camera_image_captured->q);
|
||||
camera_image_captured->image_index = mavlink_msg_camera_image_captured_get_image_index(msg);
|
||||
camera_image_captured->camera_id = mavlink_msg_camera_image_captured_get_camera_id(msg);
|
||||
camera_image_captured->capture_result = mavlink_msg_camera_image_captured_get_capture_result(msg);
|
||||
mavlink_msg_camera_image_captured_get_file_url(msg, camera_image_captured->file_url);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN;
|
||||
memset(camera_image_captured, 0, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
|
||||
memcpy(camera_image_captured, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,507 @@
|
||||
#pragma once
|
||||
// MESSAGE CAMERA_INFORMATION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_INFORMATION 259
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_camera_information_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
uint32_t firmware_version; /*< Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major)*/
|
||||
float focal_length; /*< [mm] Focal length*/
|
||||
float sensor_size_h; /*< [mm] Image sensor size horizontal*/
|
||||
float sensor_size_v; /*< [mm] Image sensor size vertical*/
|
||||
uint32_t flags; /*< Bitmap of camera capability flags.*/
|
||||
uint16_t resolution_h; /*< [pix] Horizontal image resolution*/
|
||||
uint16_t resolution_v; /*< [pix] Vertical image resolution*/
|
||||
uint16_t cam_definition_version; /*< Camera definition version (iteration)*/
|
||||
uint8_t vendor_name[32]; /*< Name of the camera vendor*/
|
||||
uint8_t model_name[32]; /*< Name of the camera model*/
|
||||
uint8_t lens_id; /*< Reserved for a lens ID*/
|
||||
char cam_definition_uri[140]; /*< Camera definition URI (if any, otherwise only basic functions will be available).*/
|
||||
}) mavlink_camera_information_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN 235
|
||||
#define MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN 235
|
||||
#define MAVLINK_MSG_ID_259_LEN 235
|
||||
#define MAVLINK_MSG_ID_259_MIN_LEN 235
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC 92
|
||||
#define MAVLINK_MSG_ID_259_CRC 92
|
||||
|
||||
#define MAVLINK_MSG_CAMERA_INFORMATION_FIELD_VENDOR_NAME_LEN 32
|
||||
#define MAVLINK_MSG_CAMERA_INFORMATION_FIELD_MODEL_NAME_LEN 32
|
||||
#define MAVLINK_MSG_CAMERA_INFORMATION_FIELD_CAM_DEFINITION_URI_LEN 140
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_INFORMATION { \
|
||||
259, \
|
||||
"CAMERA_INFORMATION", \
|
||||
13, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_information_t, time_boot_ms) }, \
|
||||
{ "vendor_name", NULL, MAVLINK_TYPE_UINT8_T, 32, 30, offsetof(mavlink_camera_information_t, vendor_name) }, \
|
||||
{ "model_name", NULL, MAVLINK_TYPE_UINT8_T, 32, 62, offsetof(mavlink_camera_information_t, model_name) }, \
|
||||
{ "firmware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_camera_information_t, firmware_version) }, \
|
||||
{ "focal_length", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_information_t, focal_length) }, \
|
||||
{ "sensor_size_h", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_information_t, sensor_size_h) }, \
|
||||
{ "sensor_size_v", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_information_t, sensor_size_v) }, \
|
||||
{ "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_camera_information_t, resolution_h) }, \
|
||||
{ "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_camera_information_t, resolution_v) }, \
|
||||
{ "lens_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 94, offsetof(mavlink_camera_information_t, lens_id) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_camera_information_t, flags) }, \
|
||||
{ "cam_definition_version", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_camera_information_t, cam_definition_version) }, \
|
||||
{ "cam_definition_uri", NULL, MAVLINK_TYPE_CHAR, 140, 95, offsetof(mavlink_camera_information_t, cam_definition_uri) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_INFORMATION { \
|
||||
"CAMERA_INFORMATION", \
|
||||
13, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_information_t, time_boot_ms) }, \
|
||||
{ "vendor_name", NULL, MAVLINK_TYPE_UINT8_T, 32, 30, offsetof(mavlink_camera_information_t, vendor_name) }, \
|
||||
{ "model_name", NULL, MAVLINK_TYPE_UINT8_T, 32, 62, offsetof(mavlink_camera_information_t, model_name) }, \
|
||||
{ "firmware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_camera_information_t, firmware_version) }, \
|
||||
{ "focal_length", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_information_t, focal_length) }, \
|
||||
{ "sensor_size_h", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_information_t, sensor_size_h) }, \
|
||||
{ "sensor_size_v", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_information_t, sensor_size_v) }, \
|
||||
{ "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_camera_information_t, resolution_h) }, \
|
||||
{ "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_camera_information_t, resolution_v) }, \
|
||||
{ "lens_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 94, offsetof(mavlink_camera_information_t, lens_id) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_camera_information_t, flags) }, \
|
||||
{ "cam_definition_version", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_camera_information_t, cam_definition_version) }, \
|
||||
{ "cam_definition_uri", NULL, MAVLINK_TYPE_CHAR, 140, 95, offsetof(mavlink_camera_information_t, cam_definition_uri) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_information message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param vendor_name Name of the camera vendor
|
||||
* @param model_name Name of the camera model
|
||||
* @param firmware_version Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major)
|
||||
* @param focal_length [mm] Focal length
|
||||
* @param sensor_size_h [mm] Image sensor size horizontal
|
||||
* @param sensor_size_v [mm] Image sensor size vertical
|
||||
* @param resolution_h [pix] Horizontal image resolution
|
||||
* @param resolution_v [pix] Vertical image resolution
|
||||
* @param lens_id Reserved for a lens ID
|
||||
* @param flags Bitmap of camera capability flags.
|
||||
* @param cam_definition_version Camera definition version (iteration)
|
||||
* @param cam_definition_uri Camera definition URI (if any, otherwise only basic functions will be available).
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_information_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, const uint8_t *vendor_name, const uint8_t *model_name, uint32_t firmware_version, float focal_length, float sensor_size_h, float sensor_size_v, uint16_t resolution_h, uint16_t resolution_v, uint8_t lens_id, uint32_t flags, uint16_t cam_definition_version, const char *cam_definition_uri)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint32_t(buf, 4, firmware_version);
|
||||
_mav_put_float(buf, 8, focal_length);
|
||||
_mav_put_float(buf, 12, sensor_size_h);
|
||||
_mav_put_float(buf, 16, sensor_size_v);
|
||||
_mav_put_uint32_t(buf, 20, flags);
|
||||
_mav_put_uint16_t(buf, 24, resolution_h);
|
||||
_mav_put_uint16_t(buf, 26, resolution_v);
|
||||
_mav_put_uint16_t(buf, 28, cam_definition_version);
|
||||
_mav_put_uint8_t(buf, 94, lens_id);
|
||||
_mav_put_uint8_t_array(buf, 30, vendor_name, 32);
|
||||
_mav_put_uint8_t_array(buf, 62, model_name, 32);
|
||||
_mav_put_char_array(buf, 95, cam_definition_uri, 140);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN);
|
||||
#else
|
||||
mavlink_camera_information_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.firmware_version = firmware_version;
|
||||
packet.focal_length = focal_length;
|
||||
packet.sensor_size_h = sensor_size_h;
|
||||
packet.sensor_size_v = sensor_size_v;
|
||||
packet.flags = flags;
|
||||
packet.resolution_h = resolution_h;
|
||||
packet.resolution_v = resolution_v;
|
||||
packet.cam_definition_version = cam_definition_version;
|
||||
packet.lens_id = lens_id;
|
||||
mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(uint8_t)*32);
|
||||
mav_array_memcpy(packet.model_name, model_name, sizeof(uint8_t)*32);
|
||||
mav_array_memcpy(packet.cam_definition_uri, cam_definition_uri, sizeof(char)*140);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_INFORMATION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_information message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param vendor_name Name of the camera vendor
|
||||
* @param model_name Name of the camera model
|
||||
* @param firmware_version Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major)
|
||||
* @param focal_length [mm] Focal length
|
||||
* @param sensor_size_h [mm] Image sensor size horizontal
|
||||
* @param sensor_size_v [mm] Image sensor size vertical
|
||||
* @param resolution_h [pix] Horizontal image resolution
|
||||
* @param resolution_v [pix] Vertical image resolution
|
||||
* @param lens_id Reserved for a lens ID
|
||||
* @param flags Bitmap of camera capability flags.
|
||||
* @param cam_definition_version Camera definition version (iteration)
|
||||
* @param cam_definition_uri Camera definition URI (if any, otherwise only basic functions will be available).
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_information_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,const uint8_t *vendor_name,const uint8_t *model_name,uint32_t firmware_version,float focal_length,float sensor_size_h,float sensor_size_v,uint16_t resolution_h,uint16_t resolution_v,uint8_t lens_id,uint32_t flags,uint16_t cam_definition_version,const char *cam_definition_uri)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint32_t(buf, 4, firmware_version);
|
||||
_mav_put_float(buf, 8, focal_length);
|
||||
_mav_put_float(buf, 12, sensor_size_h);
|
||||
_mav_put_float(buf, 16, sensor_size_v);
|
||||
_mav_put_uint32_t(buf, 20, flags);
|
||||
_mav_put_uint16_t(buf, 24, resolution_h);
|
||||
_mav_put_uint16_t(buf, 26, resolution_v);
|
||||
_mav_put_uint16_t(buf, 28, cam_definition_version);
|
||||
_mav_put_uint8_t(buf, 94, lens_id);
|
||||
_mav_put_uint8_t_array(buf, 30, vendor_name, 32);
|
||||
_mav_put_uint8_t_array(buf, 62, model_name, 32);
|
||||
_mav_put_char_array(buf, 95, cam_definition_uri, 140);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN);
|
||||
#else
|
||||
mavlink_camera_information_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.firmware_version = firmware_version;
|
||||
packet.focal_length = focal_length;
|
||||
packet.sensor_size_h = sensor_size_h;
|
||||
packet.sensor_size_v = sensor_size_v;
|
||||
packet.flags = flags;
|
||||
packet.resolution_h = resolution_h;
|
||||
packet.resolution_v = resolution_v;
|
||||
packet.cam_definition_version = cam_definition_version;
|
||||
packet.lens_id = lens_id;
|
||||
mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(uint8_t)*32);
|
||||
mav_array_memcpy(packet.model_name, model_name, sizeof(uint8_t)*32);
|
||||
mav_array_memcpy(packet.cam_definition_uri, cam_definition_uri, sizeof(char)*140);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_INFORMATION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_information struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_information C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_information_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_information_t* camera_information)
|
||||
{
|
||||
return mavlink_msg_camera_information_pack(system_id, component_id, msg, camera_information->time_boot_ms, camera_information->vendor_name, camera_information->model_name, camera_information->firmware_version, camera_information->focal_length, camera_information->sensor_size_h, camera_information->sensor_size_v, camera_information->resolution_h, camera_information->resolution_v, camera_information->lens_id, camera_information->flags, camera_information->cam_definition_version, camera_information->cam_definition_uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_information struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_information C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_information_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_information_t* camera_information)
|
||||
{
|
||||
return mavlink_msg_camera_information_pack_chan(system_id, component_id, chan, msg, camera_information->time_boot_ms, camera_information->vendor_name, camera_information->model_name, camera_information->firmware_version, camera_information->focal_length, camera_information->sensor_size_h, camera_information->sensor_size_v, camera_information->resolution_h, camera_information->resolution_v, camera_information->lens_id, camera_information->flags, camera_information->cam_definition_version, camera_information->cam_definition_uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_information message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param vendor_name Name of the camera vendor
|
||||
* @param model_name Name of the camera model
|
||||
* @param firmware_version Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major)
|
||||
* @param focal_length [mm] Focal length
|
||||
* @param sensor_size_h [mm] Image sensor size horizontal
|
||||
* @param sensor_size_v [mm] Image sensor size vertical
|
||||
* @param resolution_h [pix] Horizontal image resolution
|
||||
* @param resolution_v [pix] Vertical image resolution
|
||||
* @param lens_id Reserved for a lens ID
|
||||
* @param flags Bitmap of camera capability flags.
|
||||
* @param cam_definition_version Camera definition version (iteration)
|
||||
* @param cam_definition_uri Camera definition URI (if any, otherwise only basic functions will be available).
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_camera_information_send(mavlink_channel_t chan, uint32_t time_boot_ms, const uint8_t *vendor_name, const uint8_t *model_name, uint32_t firmware_version, float focal_length, float sensor_size_h, float sensor_size_v, uint16_t resolution_h, uint16_t resolution_v, uint8_t lens_id, uint32_t flags, uint16_t cam_definition_version, const char *cam_definition_uri)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint32_t(buf, 4, firmware_version);
|
||||
_mav_put_float(buf, 8, focal_length);
|
||||
_mav_put_float(buf, 12, sensor_size_h);
|
||||
_mav_put_float(buf, 16, sensor_size_v);
|
||||
_mav_put_uint32_t(buf, 20, flags);
|
||||
_mav_put_uint16_t(buf, 24, resolution_h);
|
||||
_mav_put_uint16_t(buf, 26, resolution_v);
|
||||
_mav_put_uint16_t(buf, 28, cam_definition_version);
|
||||
_mav_put_uint8_t(buf, 94, lens_id);
|
||||
_mav_put_uint8_t_array(buf, 30, vendor_name, 32);
|
||||
_mav_put_uint8_t_array(buf, 62, model_name, 32);
|
||||
_mav_put_char_array(buf, 95, cam_definition_uri, 140);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_INFORMATION, buf, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
|
||||
#else
|
||||
mavlink_camera_information_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.firmware_version = firmware_version;
|
||||
packet.focal_length = focal_length;
|
||||
packet.sensor_size_h = sensor_size_h;
|
||||
packet.sensor_size_v = sensor_size_v;
|
||||
packet.flags = flags;
|
||||
packet.resolution_h = resolution_h;
|
||||
packet.resolution_v = resolution_v;
|
||||
packet.cam_definition_version = cam_definition_version;
|
||||
packet.lens_id = lens_id;
|
||||
mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(uint8_t)*32);
|
||||
mav_array_memcpy(packet.model_name, model_name, sizeof(uint8_t)*32);
|
||||
mav_array_memcpy(packet.cam_definition_uri, cam_definition_uri, sizeof(char)*140);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_INFORMATION, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_information message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_camera_information_send_struct(mavlink_channel_t chan, const mavlink_camera_information_t* camera_information)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_camera_information_send(chan, camera_information->time_boot_ms, camera_information->vendor_name, camera_information->model_name, camera_information->firmware_version, camera_information->focal_length, camera_information->sensor_size_h, camera_information->sensor_size_v, camera_information->resolution_h, camera_information->resolution_v, camera_information->lens_id, camera_information->flags, camera_information->cam_definition_version, camera_information->cam_definition_uri);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_INFORMATION, (const char *)camera_information, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_camera_information_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, const uint8_t *vendor_name, const uint8_t *model_name, uint32_t firmware_version, float focal_length, float sensor_size_h, float sensor_size_v, uint16_t resolution_h, uint16_t resolution_v, uint8_t lens_id, uint32_t flags, uint16_t cam_definition_version, const char *cam_definition_uri)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint32_t(buf, 4, firmware_version);
|
||||
_mav_put_float(buf, 8, focal_length);
|
||||
_mav_put_float(buf, 12, sensor_size_h);
|
||||
_mav_put_float(buf, 16, sensor_size_v);
|
||||
_mav_put_uint32_t(buf, 20, flags);
|
||||
_mav_put_uint16_t(buf, 24, resolution_h);
|
||||
_mav_put_uint16_t(buf, 26, resolution_v);
|
||||
_mav_put_uint16_t(buf, 28, cam_definition_version);
|
||||
_mav_put_uint8_t(buf, 94, lens_id);
|
||||
_mav_put_uint8_t_array(buf, 30, vendor_name, 32);
|
||||
_mav_put_uint8_t_array(buf, 62, model_name, 32);
|
||||
_mav_put_char_array(buf, 95, cam_definition_uri, 140);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_INFORMATION, buf, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
|
||||
#else
|
||||
mavlink_camera_information_t *packet = (mavlink_camera_information_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->firmware_version = firmware_version;
|
||||
packet->focal_length = focal_length;
|
||||
packet->sensor_size_h = sensor_size_h;
|
||||
packet->sensor_size_v = sensor_size_v;
|
||||
packet->flags = flags;
|
||||
packet->resolution_h = resolution_h;
|
||||
packet->resolution_v = resolution_v;
|
||||
packet->cam_definition_version = cam_definition_version;
|
||||
packet->lens_id = lens_id;
|
||||
mav_array_memcpy(packet->vendor_name, vendor_name, sizeof(uint8_t)*32);
|
||||
mav_array_memcpy(packet->model_name, model_name, sizeof(uint8_t)*32);
|
||||
mav_array_memcpy(packet->cam_definition_uri, cam_definition_uri, sizeof(char)*140);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_INFORMATION, (const char *)packet, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CAMERA_INFORMATION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from camera_information message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_camera_information_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vendor_name from camera_information message
|
||||
*
|
||||
* @return Name of the camera vendor
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_information_get_vendor_name(const mavlink_message_t* msg, uint8_t *vendor_name)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, vendor_name, 32, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field model_name from camera_information message
|
||||
*
|
||||
* @return Name of the camera model
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_information_get_model_name(const mavlink_message_t* msg, uint8_t *model_name)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, model_name, 32, 62);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field firmware_version from camera_information message
|
||||
*
|
||||
* @return Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_camera_information_get_firmware_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field focal_length from camera_information message
|
||||
*
|
||||
* @return [mm] Focal length
|
||||
*/
|
||||
static inline float mavlink_msg_camera_information_get_focal_length(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sensor_size_h from camera_information message
|
||||
*
|
||||
* @return [mm] Image sensor size horizontal
|
||||
*/
|
||||
static inline float mavlink_msg_camera_information_get_sensor_size_h(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sensor_size_v from camera_information message
|
||||
*
|
||||
* @return [mm] Image sensor size vertical
|
||||
*/
|
||||
static inline float mavlink_msg_camera_information_get_sensor_size_v(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field resolution_h from camera_information message
|
||||
*
|
||||
* @return [pix] Horizontal image resolution
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_information_get_resolution_h(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field resolution_v from camera_information message
|
||||
*
|
||||
* @return [pix] Vertical image resolution
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_information_get_resolution_v(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lens_id from camera_information message
|
||||
*
|
||||
* @return Reserved for a lens ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_camera_information_get_lens_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 94);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from camera_information message
|
||||
*
|
||||
* @return Bitmap of camera capability flags.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_camera_information_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cam_definition_version from camera_information message
|
||||
*
|
||||
* @return Camera definition version (iteration)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_information_get_cam_definition_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cam_definition_uri from camera_information message
|
||||
*
|
||||
* @return Camera definition URI (if any, otherwise only basic functions will be available).
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_information_get_cam_definition_uri(const mavlink_message_t* msg, char *cam_definition_uri)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, cam_definition_uri, 140, 95);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a camera_information message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param camera_information C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_camera_information_decode(const mavlink_message_t* msg, mavlink_camera_information_t* camera_information)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
camera_information->time_boot_ms = mavlink_msg_camera_information_get_time_boot_ms(msg);
|
||||
camera_information->firmware_version = mavlink_msg_camera_information_get_firmware_version(msg);
|
||||
camera_information->focal_length = mavlink_msg_camera_information_get_focal_length(msg);
|
||||
camera_information->sensor_size_h = mavlink_msg_camera_information_get_sensor_size_h(msg);
|
||||
camera_information->sensor_size_v = mavlink_msg_camera_information_get_sensor_size_v(msg);
|
||||
camera_information->flags = mavlink_msg_camera_information_get_flags(msg);
|
||||
camera_information->resolution_h = mavlink_msg_camera_information_get_resolution_h(msg);
|
||||
camera_information->resolution_v = mavlink_msg_camera_information_get_resolution_v(msg);
|
||||
camera_information->cam_definition_version = mavlink_msg_camera_information_get_cam_definition_version(msg);
|
||||
mavlink_msg_camera_information_get_vendor_name(msg, camera_information->vendor_name);
|
||||
mavlink_msg_camera_information_get_model_name(msg, camera_information->model_name);
|
||||
camera_information->lens_id = mavlink_msg_camera_information_get_lens_id(msg);
|
||||
mavlink_msg_camera_information_get_cam_definition_uri(msg, camera_information->cam_definition_uri);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN;
|
||||
memset(camera_information, 0, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN);
|
||||
memcpy(camera_information, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
#pragma once
|
||||
// MESSAGE CAMERA_SETTINGS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_SETTINGS 260
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_camera_settings_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
uint8_t mode_id; /*< Camera mode*/
|
||||
}) mavlink_camera_settings_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN 5
|
||||
#define MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN 5
|
||||
#define MAVLINK_MSG_ID_260_LEN 5
|
||||
#define MAVLINK_MSG_ID_260_MIN_LEN 5
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_SETTINGS_CRC 146
|
||||
#define MAVLINK_MSG_ID_260_CRC 146
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_SETTINGS { \
|
||||
260, \
|
||||
"CAMERA_SETTINGS", \
|
||||
2, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_settings_t, time_boot_ms) }, \
|
||||
{ "mode_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_camera_settings_t, mode_id) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_SETTINGS { \
|
||||
"CAMERA_SETTINGS", \
|
||||
2, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_settings_t, time_boot_ms) }, \
|
||||
{ "mode_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_camera_settings_t, mode_id) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_settings message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param mode_id Camera mode
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_settings_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, uint8_t mode_id)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint8_t(buf, 4, mode_id);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN);
|
||||
#else
|
||||
mavlink_camera_settings_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.mode_id = mode_id;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_SETTINGS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_settings message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param mode_id Camera mode
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_settings_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,uint8_t mode_id)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint8_t(buf, 4, mode_id);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN);
|
||||
#else
|
||||
mavlink_camera_settings_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.mode_id = mode_id;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_SETTINGS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_settings struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_settings C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_settings_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_settings_t* camera_settings)
|
||||
{
|
||||
return mavlink_msg_camera_settings_pack(system_id, component_id, msg, camera_settings->time_boot_ms, camera_settings->mode_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_settings struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_settings C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_settings_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_settings_t* camera_settings)
|
||||
{
|
||||
return mavlink_msg_camera_settings_pack_chan(system_id, component_id, chan, msg, camera_settings->time_boot_ms, camera_settings->mode_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_settings message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param mode_id Camera mode
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_camera_settings_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t mode_id)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint8_t(buf, 4, mode_id);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_SETTINGS, buf, MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_CRC);
|
||||
#else
|
||||
mavlink_camera_settings_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.mode_id = mode_id;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_SETTINGS, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_settings message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_camera_settings_send_struct(mavlink_channel_t chan, const mavlink_camera_settings_t* camera_settings)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_camera_settings_send(chan, camera_settings->time_boot_ms, camera_settings->mode_id);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_SETTINGS, (const char *)camera_settings, MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_camera_settings_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t mode_id)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint8_t(buf, 4, mode_id);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_SETTINGS, buf, MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_CRC);
|
||||
#else
|
||||
mavlink_camera_settings_t *packet = (mavlink_camera_settings_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->mode_id = mode_id;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_SETTINGS, (const char *)packet, MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN, MAVLINK_MSG_ID_CAMERA_SETTINGS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CAMERA_SETTINGS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from camera_settings message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_camera_settings_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mode_id from camera_settings message
|
||||
*
|
||||
* @return Camera mode
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_camera_settings_get_mode_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a camera_settings message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param camera_settings C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_camera_settings_decode(const mavlink_message_t* msg, mavlink_camera_settings_t* camera_settings)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
camera_settings->time_boot_ms = mavlink_msg_camera_settings_get_time_boot_ms(msg);
|
||||
camera_settings->mode_id = mavlink_msg_camera_settings_get_mode_id(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN;
|
||||
memset(camera_settings, 0, MAVLINK_MSG_ID_CAMERA_SETTINGS_LEN);
|
||||
memcpy(camera_settings, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
#pragma once
|
||||
// MESSAGE CAMERA_TRIGGER PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_TRIGGER 112
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_camera_trigger_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
uint32_t seq; /*< Image frame sequence*/
|
||||
}) mavlink_camera_trigger_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN 12
|
||||
#define MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN 12
|
||||
#define MAVLINK_MSG_ID_112_LEN 12
|
||||
#define MAVLINK_MSG_ID_112_MIN_LEN 12
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC 174
|
||||
#define MAVLINK_MSG_ID_112_CRC 174
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER { \
|
||||
112, \
|
||||
"CAMERA_TRIGGER", \
|
||||
2, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_trigger_t, time_usec) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_trigger_t, seq) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER { \
|
||||
"CAMERA_TRIGGER", \
|
||||
2, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_trigger_t, time_usec) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_trigger_t, seq) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_trigger message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param seq Image frame sequence
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_trigger_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint32_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
|
||||
#else
|
||||
mavlink_camera_trigger_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_trigger message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param seq Image frame sequence
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_trigger_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint32_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
|
||||
#else
|
||||
mavlink_camera_trigger_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_trigger struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_trigger C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_trigger_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_trigger_t* camera_trigger)
|
||||
{
|
||||
return mavlink_msg_camera_trigger_pack(system_id, component_id, msg, camera_trigger->time_usec, camera_trigger->seq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_trigger struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_trigger C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_trigger_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_trigger_t* camera_trigger)
|
||||
{
|
||||
return mavlink_msg_camera_trigger_pack_chan(system_id, component_id, chan, msg, camera_trigger->time_usec, camera_trigger->seq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_trigger message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param seq Image frame sequence
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_camera_trigger_send(mavlink_channel_t chan, uint64_t time_usec, uint32_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, seq);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
#else
|
||||
mavlink_camera_trigger_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.seq = seq;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_trigger message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_camera_trigger_send_struct(mavlink_channel_t chan, const mavlink_camera_trigger_t* camera_trigger)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_camera_trigger_send(chan, camera_trigger->time_usec, camera_trigger->seq);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)camera_trigger, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_camera_trigger_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint32_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, seq);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
#else
|
||||
mavlink_camera_trigger_t *packet = (mavlink_camera_trigger_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->seq = seq;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CAMERA_TRIGGER UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from camera_trigger message
|
||||
*
|
||||
* @return [us] Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_camera_trigger_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field seq from camera_trigger message
|
||||
*
|
||||
* @return Image frame sequence
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_camera_trigger_get_seq(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a camera_trigger message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param camera_trigger C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_camera_trigger_decode(const mavlink_message_t* msg, mavlink_camera_trigger_t* camera_trigger)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
camera_trigger->time_usec = mavlink_msg_camera_trigger_get_time_usec(msg);
|
||||
camera_trigger->seq = mavlink_msg_camera_trigger_get_seq(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN;
|
||||
memset(camera_trigger, 0, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
|
||||
memcpy(camera_trigger, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
#pragma once
|
||||
// MESSAGE CHANGE_OPERATOR_CONTROL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL 5
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_change_operator_control_t {
|
||||
uint8_t target_system; /*< System the GCS requests control for*/
|
||||
uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/
|
||||
uint8_t version; /*< [rad] 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.*/
|
||||
char passkey[25]; /*< Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"*/
|
||||
}) mavlink_change_operator_control_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN 28
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN 28
|
||||
#define MAVLINK_MSG_ID_5_LEN 28
|
||||
#define MAVLINK_MSG_ID_5_MIN_LEN 28
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC 217
|
||||
#define MAVLINK_MSG_ID_5_CRC 217
|
||||
|
||||
#define MAVLINK_MSG_CHANGE_OPERATOR_CONTROL_FIELD_PASSKEY_LEN 25
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL { \
|
||||
5, \
|
||||
"CHANGE_OPERATOR_CONTROL", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_t, target_system) }, \
|
||||
{ "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_t, control_request) }, \
|
||||
{ "version", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_t, version) }, \
|
||||
{ "passkey", NULL, MAVLINK_TYPE_CHAR, 25, 3, offsetof(mavlink_change_operator_control_t, passkey) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL { \
|
||||
"CHANGE_OPERATOR_CONTROL", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_t, target_system) }, \
|
||||
{ "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_t, control_request) }, \
|
||||
{ "version", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_t, version) }, \
|
||||
{ "passkey", NULL, MAVLINK_TYPE_CHAR, 25, 3, offsetof(mavlink_change_operator_control_t, passkey) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a change_operator_control message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System the GCS requests control for
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param version [rad] 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
|
||||
* @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, version);
|
||||
_mav_put_char_array(buf, 3, passkey, 25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_change_operator_control_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.control_request = control_request;
|
||||
packet.version = version;
|
||||
mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a change_operator_control message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System the GCS requests control for
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param version [rad] 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
|
||||
* @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t control_request,uint8_t version,const char *passkey)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, version);
|
||||
_mav_put_char_array(buf, 3, passkey, 25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_change_operator_control_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.control_request = control_request;
|
||||
packet.version = version;
|
||||
mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a change_operator_control struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param change_operator_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_change_operator_control_t* change_operator_control)
|
||||
{
|
||||
return mavlink_msg_change_operator_control_pack(system_id, component_id, msg, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a change_operator_control struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param change_operator_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_change_operator_control_t* change_operator_control)
|
||||
{
|
||||
return mavlink_msg_change_operator_control_pack_chan(system_id, component_id, chan, msg, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a change_operator_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System the GCS requests control for
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param version [rad] 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
|
||||
* @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_change_operator_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, version);
|
||||
_mav_put_char_array(buf, 3, passkey, 25);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_change_operator_control_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.control_request = control_request;
|
||||
packet.version = version;
|
||||
mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a change_operator_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_send_struct(mavlink_channel_t chan, const mavlink_change_operator_control_t* change_operator_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_change_operator_control_send(chan, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)change_operator_control, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, version);
|
||||
_mav_put_char_array(buf, 3, passkey, 25);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_change_operator_control_t *packet = (mavlink_change_operator_control_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->control_request = control_request;
|
||||
packet->version = version;
|
||||
mav_array_memcpy(packet->passkey, passkey, sizeof(char)*25);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CHANGE_OPERATOR_CONTROL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from change_operator_control message
|
||||
*
|
||||
* @return System the GCS requests control for
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field control_request from change_operator_control message
|
||||
*
|
||||
* @return 0: request control of this MAV, 1: Release control of this MAV
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_get_control_request(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field version from change_operator_control message
|
||||
*
|
||||
* @return [rad] 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_get_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field passkey from change_operator_control message
|
||||
*
|
||||
* @return Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_get_passkey(const mavlink_message_t* msg, char *passkey)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, passkey, 25, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a change_operator_control message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param change_operator_control C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_decode(const mavlink_message_t* msg, mavlink_change_operator_control_t* change_operator_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
change_operator_control->target_system = mavlink_msg_change_operator_control_get_target_system(msg);
|
||||
change_operator_control->control_request = mavlink_msg_change_operator_control_get_control_request(msg);
|
||||
change_operator_control->version = mavlink_msg_change_operator_control_get_version(msg);
|
||||
mavlink_msg_change_operator_control_get_passkey(msg, change_operator_control->passkey);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN;
|
||||
memset(change_operator_control, 0, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
|
||||
memcpy(change_operator_control, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE CHANGE_OPERATOR_CONTROL_ACK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK 6
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_change_operator_control_ack_t {
|
||||
uint8_t gcs_system_id; /*< ID of the GCS this message */
|
||||
uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/
|
||||
uint8_t ack; /*< 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control*/
|
||||
}) mavlink_change_operator_control_ack_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN 3
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_6_LEN 3
|
||||
#define MAVLINK_MSG_ID_6_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC 104
|
||||
#define MAVLINK_MSG_ID_6_CRC 104
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK { \
|
||||
6, \
|
||||
"CHANGE_OPERATOR_CONTROL_ACK", \
|
||||
3, \
|
||||
{ { "gcs_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_ack_t, gcs_system_id) }, \
|
||||
{ "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_ack_t, control_request) }, \
|
||||
{ "ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_ack_t, ack) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK { \
|
||||
"CHANGE_OPERATOR_CONTROL_ACK", \
|
||||
3, \
|
||||
{ { "gcs_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_ack_t, gcs_system_id) }, \
|
||||
{ "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_ack_t, control_request) }, \
|
||||
{ "ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_ack_t, ack) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a change_operator_control_ack message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param gcs_system_id ID of the GCS this message
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t gcs_system_id, uint8_t control_request, uint8_t ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN];
|
||||
_mav_put_uint8_t(buf, 0, gcs_system_id);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, ack);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
|
||||
#else
|
||||
mavlink_change_operator_control_ack_t packet;
|
||||
packet.gcs_system_id = gcs_system_id;
|
||||
packet.control_request = control_request;
|
||||
packet.ack = ack;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a change_operator_control_ack message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gcs_system_id ID of the GCS this message
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t gcs_system_id,uint8_t control_request,uint8_t ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN];
|
||||
_mav_put_uint8_t(buf, 0, gcs_system_id);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, ack);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
|
||||
#else
|
||||
mavlink_change_operator_control_ack_t packet;
|
||||
packet.gcs_system_id = gcs_system_id;
|
||||
packet.control_request = control_request;
|
||||
packet.ack = ack;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a change_operator_control_ack struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param change_operator_control_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_change_operator_control_ack_t* change_operator_control_ack)
|
||||
{
|
||||
return mavlink_msg_change_operator_control_ack_pack(system_id, component_id, msg, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a change_operator_control_ack struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param change_operator_control_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_change_operator_control_ack_t* change_operator_control_ack)
|
||||
{
|
||||
return mavlink_msg_change_operator_control_ack_pack_chan(system_id, component_id, chan, msg, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a change_operator_control_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param gcs_system_id ID of the GCS this message
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_change_operator_control_ack_send(mavlink_channel_t chan, uint8_t gcs_system_id, uint8_t control_request, uint8_t ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN];
|
||||
_mav_put_uint8_t(buf, 0, gcs_system_id);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, ack);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
#else
|
||||
mavlink_change_operator_control_ack_t packet;
|
||||
packet.gcs_system_id = gcs_system_id;
|
||||
packet.control_request = control_request;
|
||||
packet.ack = ack;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a change_operator_control_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_ack_send_struct(mavlink_channel_t chan, const mavlink_change_operator_control_ack_t* change_operator_control_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_change_operator_control_ack_send(chan, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)change_operator_control_ack, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t gcs_system_id, uint8_t control_request, uint8_t ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, gcs_system_id);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, ack);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
#else
|
||||
mavlink_change_operator_control_ack_t *packet = (mavlink_change_operator_control_ack_t *)msgbuf;
|
||||
packet->gcs_system_id = gcs_system_id;
|
||||
packet->control_request = control_request;
|
||||
packet->ack = ack;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CHANGE_OPERATOR_CONTROL_ACK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field gcs_system_id from change_operator_control_ack message
|
||||
*
|
||||
* @return ID of the GCS this message
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_ack_get_gcs_system_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field control_request from change_operator_control_ack message
|
||||
*
|
||||
* @return 0: request control of this MAV, 1: Release control of this MAV
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_ack_get_control_request(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ack from change_operator_control_ack message
|
||||
*
|
||||
* @return 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_ack_get_ack(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a change_operator_control_ack message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param change_operator_control_ack C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_ack_decode(const mavlink_message_t* msg, mavlink_change_operator_control_ack_t* change_operator_control_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
change_operator_control_ack->gcs_system_id = mavlink_msg_change_operator_control_ack_get_gcs_system_id(msg);
|
||||
change_operator_control_ack->control_request = mavlink_msg_change_operator_control_ack_get_control_request(msg);
|
||||
change_operator_control_ack->ack = mavlink_msg_change_operator_control_ack_get_ack(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN? msg->len : MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN;
|
||||
memset(change_operator_control_ack, 0, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
|
||||
memcpy(change_operator_control_ack, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
#pragma once
|
||||
// MESSAGE COLLISION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_COLLISION 247
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_collision_t {
|
||||
uint32_t id; /*< Unique identifier, domain based on src field*/
|
||||
float time_to_minimum_delta; /*< [s] Estimated time until collision occurs*/
|
||||
float altitude_minimum_delta; /*< [m] Closest vertical distance between vehicle and object*/
|
||||
float horizontal_minimum_delta; /*< [m] Closest horizontal distance between vehicle and object*/
|
||||
uint8_t src; /*< Collision data source*/
|
||||
uint8_t action; /*< Action that is being taken to avoid this collision*/
|
||||
uint8_t threat_level; /*< How concerned the aircraft is about this collision*/
|
||||
}) mavlink_collision_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_COLLISION_LEN 19
|
||||
#define MAVLINK_MSG_ID_COLLISION_MIN_LEN 19
|
||||
#define MAVLINK_MSG_ID_247_LEN 19
|
||||
#define MAVLINK_MSG_ID_247_MIN_LEN 19
|
||||
|
||||
#define MAVLINK_MSG_ID_COLLISION_CRC 81
|
||||
#define MAVLINK_MSG_ID_247_CRC 81
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_COLLISION { \
|
||||
247, \
|
||||
"COLLISION", \
|
||||
7, \
|
||||
{ { "src", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_collision_t, src) }, \
|
||||
{ "id", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_collision_t, id) }, \
|
||||
{ "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_collision_t, action) }, \
|
||||
{ "threat_level", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_collision_t, threat_level) }, \
|
||||
{ "time_to_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_collision_t, time_to_minimum_delta) }, \
|
||||
{ "altitude_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_collision_t, altitude_minimum_delta) }, \
|
||||
{ "horizontal_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_collision_t, horizontal_minimum_delta) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_COLLISION { \
|
||||
"COLLISION", \
|
||||
7, \
|
||||
{ { "src", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_collision_t, src) }, \
|
||||
{ "id", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_collision_t, id) }, \
|
||||
{ "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_collision_t, action) }, \
|
||||
{ "threat_level", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_collision_t, threat_level) }, \
|
||||
{ "time_to_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_collision_t, time_to_minimum_delta) }, \
|
||||
{ "altitude_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_collision_t, altitude_minimum_delta) }, \
|
||||
{ "horizontal_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_collision_t, horizontal_minimum_delta) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a collision message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param src Collision data source
|
||||
* @param id Unique identifier, domain based on src field
|
||||
* @param action Action that is being taken to avoid this collision
|
||||
* @param threat_level How concerned the aircraft is about this collision
|
||||
* @param time_to_minimum_delta [s] Estimated time until collision occurs
|
||||
* @param altitude_minimum_delta [m] Closest vertical distance between vehicle and object
|
||||
* @param horizontal_minimum_delta [m] Closest horizontal distance between vehicle and object
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_collision_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t src, uint32_t id, uint8_t action, uint8_t threat_level, float time_to_minimum_delta, float altitude_minimum_delta, float horizontal_minimum_delta)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COLLISION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, id);
|
||||
_mav_put_float(buf, 4, time_to_minimum_delta);
|
||||
_mav_put_float(buf, 8, altitude_minimum_delta);
|
||||
_mav_put_float(buf, 12, horizontal_minimum_delta);
|
||||
_mav_put_uint8_t(buf, 16, src);
|
||||
_mav_put_uint8_t(buf, 17, action);
|
||||
_mav_put_uint8_t(buf, 18, threat_level);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COLLISION_LEN);
|
||||
#else
|
||||
mavlink_collision_t packet;
|
||||
packet.id = id;
|
||||
packet.time_to_minimum_delta = time_to_minimum_delta;
|
||||
packet.altitude_minimum_delta = altitude_minimum_delta;
|
||||
packet.horizontal_minimum_delta = horizontal_minimum_delta;
|
||||
packet.src = src;
|
||||
packet.action = action;
|
||||
packet.threat_level = threat_level;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COLLISION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COLLISION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a collision message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param src Collision data source
|
||||
* @param id Unique identifier, domain based on src field
|
||||
* @param action Action that is being taken to avoid this collision
|
||||
* @param threat_level How concerned the aircraft is about this collision
|
||||
* @param time_to_minimum_delta [s] Estimated time until collision occurs
|
||||
* @param altitude_minimum_delta [m] Closest vertical distance between vehicle and object
|
||||
* @param horizontal_minimum_delta [m] Closest horizontal distance between vehicle and object
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_collision_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t src,uint32_t id,uint8_t action,uint8_t threat_level,float time_to_minimum_delta,float altitude_minimum_delta,float horizontal_minimum_delta)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COLLISION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, id);
|
||||
_mav_put_float(buf, 4, time_to_minimum_delta);
|
||||
_mav_put_float(buf, 8, altitude_minimum_delta);
|
||||
_mav_put_float(buf, 12, horizontal_minimum_delta);
|
||||
_mav_put_uint8_t(buf, 16, src);
|
||||
_mav_put_uint8_t(buf, 17, action);
|
||||
_mav_put_uint8_t(buf, 18, threat_level);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COLLISION_LEN);
|
||||
#else
|
||||
mavlink_collision_t packet;
|
||||
packet.id = id;
|
||||
packet.time_to_minimum_delta = time_to_minimum_delta;
|
||||
packet.altitude_minimum_delta = altitude_minimum_delta;
|
||||
packet.horizontal_minimum_delta = horizontal_minimum_delta;
|
||||
packet.src = src;
|
||||
packet.action = action;
|
||||
packet.threat_level = threat_level;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COLLISION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COLLISION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a collision struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param collision C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_collision_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_collision_t* collision)
|
||||
{
|
||||
return mavlink_msg_collision_pack(system_id, component_id, msg, collision->src, collision->id, collision->action, collision->threat_level, collision->time_to_minimum_delta, collision->altitude_minimum_delta, collision->horizontal_minimum_delta);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a collision struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param collision C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_collision_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_collision_t* collision)
|
||||
{
|
||||
return mavlink_msg_collision_pack_chan(system_id, component_id, chan, msg, collision->src, collision->id, collision->action, collision->threat_level, collision->time_to_minimum_delta, collision->altitude_minimum_delta, collision->horizontal_minimum_delta);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a collision message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param src Collision data source
|
||||
* @param id Unique identifier, domain based on src field
|
||||
* @param action Action that is being taken to avoid this collision
|
||||
* @param threat_level How concerned the aircraft is about this collision
|
||||
* @param time_to_minimum_delta [s] Estimated time until collision occurs
|
||||
* @param altitude_minimum_delta [m] Closest vertical distance between vehicle and object
|
||||
* @param horizontal_minimum_delta [m] Closest horizontal distance between vehicle and object
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_collision_send(mavlink_channel_t chan, uint8_t src, uint32_t id, uint8_t action, uint8_t threat_level, float time_to_minimum_delta, float altitude_minimum_delta, float horizontal_minimum_delta)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COLLISION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, id);
|
||||
_mav_put_float(buf, 4, time_to_minimum_delta);
|
||||
_mav_put_float(buf, 8, altitude_minimum_delta);
|
||||
_mav_put_float(buf, 12, horizontal_minimum_delta);
|
||||
_mav_put_uint8_t(buf, 16, src);
|
||||
_mav_put_uint8_t(buf, 17, action);
|
||||
_mav_put_uint8_t(buf, 18, threat_level);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COLLISION, buf, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
#else
|
||||
mavlink_collision_t packet;
|
||||
packet.id = id;
|
||||
packet.time_to_minimum_delta = time_to_minimum_delta;
|
||||
packet.altitude_minimum_delta = altitude_minimum_delta;
|
||||
packet.horizontal_minimum_delta = horizontal_minimum_delta;
|
||||
packet.src = src;
|
||||
packet.action = action;
|
||||
packet.threat_level = threat_level;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COLLISION, (const char *)&packet, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a collision message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_collision_send_struct(mavlink_channel_t chan, const mavlink_collision_t* collision)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_collision_send(chan, collision->src, collision->id, collision->action, collision->threat_level, collision->time_to_minimum_delta, collision->altitude_minimum_delta, collision->horizontal_minimum_delta);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COLLISION, (const char *)collision, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_COLLISION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_collision_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t src, uint32_t id, uint8_t action, uint8_t threat_level, float time_to_minimum_delta, float altitude_minimum_delta, float horizontal_minimum_delta)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, id);
|
||||
_mav_put_float(buf, 4, time_to_minimum_delta);
|
||||
_mav_put_float(buf, 8, altitude_minimum_delta);
|
||||
_mav_put_float(buf, 12, horizontal_minimum_delta);
|
||||
_mav_put_uint8_t(buf, 16, src);
|
||||
_mav_put_uint8_t(buf, 17, action);
|
||||
_mav_put_uint8_t(buf, 18, threat_level);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COLLISION, buf, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
#else
|
||||
mavlink_collision_t *packet = (mavlink_collision_t *)msgbuf;
|
||||
packet->id = id;
|
||||
packet->time_to_minimum_delta = time_to_minimum_delta;
|
||||
packet->altitude_minimum_delta = altitude_minimum_delta;
|
||||
packet->horizontal_minimum_delta = horizontal_minimum_delta;
|
||||
packet->src = src;
|
||||
packet->action = action;
|
||||
packet->threat_level = threat_level;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COLLISION, (const char *)packet, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE COLLISION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field src from collision message
|
||||
*
|
||||
* @return Collision data source
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_collision_get_src(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field id from collision message
|
||||
*
|
||||
* @return Unique identifier, domain based on src field
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_collision_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field action from collision message
|
||||
*
|
||||
* @return Action that is being taken to avoid this collision
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_collision_get_action(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 17);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field threat_level from collision message
|
||||
*
|
||||
* @return How concerned the aircraft is about this collision
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_collision_get_threat_level(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_to_minimum_delta from collision message
|
||||
*
|
||||
* @return [s] Estimated time until collision occurs
|
||||
*/
|
||||
static inline float mavlink_msg_collision_get_time_to_minimum_delta(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_minimum_delta from collision message
|
||||
*
|
||||
* @return [m] Closest vertical distance between vehicle and object
|
||||
*/
|
||||
static inline float mavlink_msg_collision_get_altitude_minimum_delta(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field horizontal_minimum_delta from collision message
|
||||
*
|
||||
* @return [m] Closest horizontal distance between vehicle and object
|
||||
*/
|
||||
static inline float mavlink_msg_collision_get_horizontal_minimum_delta(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a collision message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param collision C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_collision_decode(const mavlink_message_t* msg, mavlink_collision_t* collision)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
collision->id = mavlink_msg_collision_get_id(msg);
|
||||
collision->time_to_minimum_delta = mavlink_msg_collision_get_time_to_minimum_delta(msg);
|
||||
collision->altitude_minimum_delta = mavlink_msg_collision_get_altitude_minimum_delta(msg);
|
||||
collision->horizontal_minimum_delta = mavlink_msg_collision_get_horizontal_minimum_delta(msg);
|
||||
collision->src = mavlink_msg_collision_get_src(msg);
|
||||
collision->action = mavlink_msg_collision_get_action(msg);
|
||||
collision->threat_level = mavlink_msg_collision_get_threat_level(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_COLLISION_LEN? msg->len : MAVLINK_MSG_ID_COLLISION_LEN;
|
||||
memset(collision, 0, MAVLINK_MSG_ID_COLLISION_LEN);
|
||||
memcpy(collision, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
#pragma once
|
||||
// MESSAGE COMMAND_ACK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_ACK 77
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_command_ack_t {
|
||||
uint16_t command; /*< Command ID (of acknowledged command).*/
|
||||
uint8_t result; /*< Result of command.*/
|
||||
uint8_t progress; /*< WIP: Also used as result_param1, it can be set with a enum containing the errors reasons of why the command was denied or the progress percentage or 255 if unknown the progress when result is MAV_RESULT_IN_PROGRESS.*/
|
||||
int32_t result_param2; /*< WIP: Additional parameter of the result, example: which parameter of MAV_CMD_NAV_WAYPOINT caused it to be denied.*/
|
||||
uint8_t target_system; /*< WIP: System which requested the command to be executed*/
|
||||
uint8_t target_component; /*< WIP: Component which requested the command to be executed*/
|
||||
}) mavlink_command_ack_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_ACK_LEN 10
|
||||
#define MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_77_LEN 10
|
||||
#define MAVLINK_MSG_ID_77_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_ACK_CRC 143
|
||||
#define MAVLINK_MSG_ID_77_CRC 143
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \
|
||||
77, \
|
||||
"COMMAND_ACK", \
|
||||
6, \
|
||||
{ { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_ack_t, command) }, \
|
||||
{ "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_ack_t, result) }, \
|
||||
{ "progress", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_command_ack_t, progress) }, \
|
||||
{ "result_param2", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_command_ack_t, result_param2) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_command_ack_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_command_ack_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \
|
||||
"COMMAND_ACK", \
|
||||
6, \
|
||||
{ { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_ack_t, command) }, \
|
||||
{ "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_ack_t, result) }, \
|
||||
{ "progress", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_command_ack_t, progress) }, \
|
||||
{ "result_param2", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_command_ack_t, result_param2) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_command_ack_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_command_ack_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a command_ack message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param command Command ID (of acknowledged command).
|
||||
* @param result Result of command.
|
||||
* @param progress WIP: Also used as result_param1, it can be set with a enum containing the errors reasons of why the command was denied or the progress percentage or 255 if unknown the progress when result is MAV_RESULT_IN_PROGRESS.
|
||||
* @param result_param2 WIP: Additional parameter of the result, example: which parameter of MAV_CMD_NAV_WAYPOINT caused it to be denied.
|
||||
* @param target_system WIP: System which requested the command to be executed
|
||||
* @param target_component WIP: Component which requested the command to be executed
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t command, uint8_t result, uint8_t progress, int32_t result_param2, uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN];
|
||||
_mav_put_uint16_t(buf, 0, command);
|
||||
_mav_put_uint8_t(buf, 2, result);
|
||||
_mav_put_uint8_t(buf, 3, progress);
|
||||
_mav_put_int32_t(buf, 4, result_param2);
|
||||
_mav_put_uint8_t(buf, 8, target_system);
|
||||
_mav_put_uint8_t(buf, 9, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
|
||||
#else
|
||||
mavlink_command_ack_t packet;
|
||||
packet.command = command;
|
||||
packet.result = result;
|
||||
packet.progress = progress;
|
||||
packet.result_param2 = result_param2;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a command_ack message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command Command ID (of acknowledged command).
|
||||
* @param result Result of command.
|
||||
* @param progress WIP: Also used as result_param1, it can be set with a enum containing the errors reasons of why the command was denied or the progress percentage or 255 if unknown the progress when result is MAV_RESULT_IN_PROGRESS.
|
||||
* @param result_param2 WIP: Additional parameter of the result, example: which parameter of MAV_CMD_NAV_WAYPOINT caused it to be denied.
|
||||
* @param target_system WIP: System which requested the command to be executed
|
||||
* @param target_component WIP: Component which requested the command to be executed
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t command,uint8_t result,uint8_t progress,int32_t result_param2,uint8_t target_system,uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN];
|
||||
_mav_put_uint16_t(buf, 0, command);
|
||||
_mav_put_uint8_t(buf, 2, result);
|
||||
_mav_put_uint8_t(buf, 3, progress);
|
||||
_mav_put_int32_t(buf, 4, result_param2);
|
||||
_mav_put_uint8_t(buf, 8, target_system);
|
||||
_mav_put_uint8_t(buf, 9, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
|
||||
#else
|
||||
mavlink_command_ack_t packet;
|
||||
packet.command = command;
|
||||
packet.result = result;
|
||||
packet.progress = progress;
|
||||
packet.result_param2 = result_param2;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_ack struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_ack_t* command_ack)
|
||||
{
|
||||
return mavlink_msg_command_ack_pack(system_id, component_id, msg, command_ack->command, command_ack->result, command_ack->progress, command_ack->result_param2, command_ack->target_system, command_ack->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_ack struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_ack_t* command_ack)
|
||||
{
|
||||
return mavlink_msg_command_ack_pack_chan(system_id, component_id, chan, msg, command_ack->command, command_ack->result, command_ack->progress, command_ack->result_param2, command_ack->target_system, command_ack->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param command Command ID (of acknowledged command).
|
||||
* @param result Result of command.
|
||||
* @param progress WIP: Also used as result_param1, it can be set with a enum containing the errors reasons of why the command was denied or the progress percentage or 255 if unknown the progress when result is MAV_RESULT_IN_PROGRESS.
|
||||
* @param result_param2 WIP: Additional parameter of the result, example: which parameter of MAV_CMD_NAV_WAYPOINT caused it to be denied.
|
||||
* @param target_system WIP: System which requested the command to be executed
|
||||
* @param target_component WIP: Component which requested the command to be executed
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, uint16_t command, uint8_t result, uint8_t progress, int32_t result_param2, uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN];
|
||||
_mav_put_uint16_t(buf, 0, command);
|
||||
_mav_put_uint8_t(buf, 2, result);
|
||||
_mav_put_uint8_t(buf, 3, progress);
|
||||
_mav_put_int32_t(buf, 4, result_param2);
|
||||
_mav_put_uint8_t(buf, 8, target_system);
|
||||
_mav_put_uint8_t(buf, 9, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
#else
|
||||
mavlink_command_ack_t packet;
|
||||
packet.command = command;
|
||||
packet.result = result;
|
||||
packet.progress = progress;
|
||||
packet.result_param2 = result_param2;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_command_ack_send_struct(mavlink_channel_t chan, const mavlink_command_ack_t* command_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_command_ack_send(chan, command_ack->command, command_ack->result, command_ack->progress, command_ack->result_param2, command_ack->target_system, command_ack->target_component);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)command_ack, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_COMMAND_ACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_command_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t command, uint8_t result, uint8_t progress, int32_t result_param2, uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, command);
|
||||
_mav_put_uint8_t(buf, 2, result);
|
||||
_mav_put_uint8_t(buf, 3, progress);
|
||||
_mav_put_int32_t(buf, 4, result_param2);
|
||||
_mav_put_uint8_t(buf, 8, target_system);
|
||||
_mav_put_uint8_t(buf, 9, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
#else
|
||||
mavlink_command_ack_t *packet = (mavlink_command_ack_t *)msgbuf;
|
||||
packet->command = command;
|
||||
packet->result = result;
|
||||
packet->progress = progress;
|
||||
packet->result_param2 = result_param2;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)packet, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE COMMAND_ACK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field command from command_ack message
|
||||
*
|
||||
* @return Command ID (of acknowledged command).
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_ack_get_command(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field result from command_ack message
|
||||
*
|
||||
* @return Result of command.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_ack_get_result(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field progress from command_ack message
|
||||
*
|
||||
* @return WIP: Also used as result_param1, it can be set with a enum containing the errors reasons of why the command was denied or the progress percentage or 255 if unknown the progress when result is MAV_RESULT_IN_PROGRESS.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_ack_get_progress(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field result_param2 from command_ack message
|
||||
*
|
||||
* @return WIP: Additional parameter of the result, example: which parameter of MAV_CMD_NAV_WAYPOINT caused it to be denied.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_command_ack_get_result_param2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from command_ack message
|
||||
*
|
||||
* @return WIP: System which requested the command to be executed
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_ack_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from command_ack message
|
||||
*
|
||||
* @return WIP: Component which requested the command to be executed
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_ack_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 9);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a command_ack message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param command_ack C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_command_ack_decode(const mavlink_message_t* msg, mavlink_command_ack_t* command_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
command_ack->command = mavlink_msg_command_ack_get_command(msg);
|
||||
command_ack->result = mavlink_msg_command_ack_get_result(msg);
|
||||
command_ack->progress = mavlink_msg_command_ack_get_progress(msg);
|
||||
command_ack->result_param2 = mavlink_msg_command_ack_get_result_param2(msg);
|
||||
command_ack->target_system = mavlink_msg_command_ack_get_target_system(msg);
|
||||
command_ack->target_component = mavlink_msg_command_ack_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_ACK_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_ACK_LEN;
|
||||
memset(command_ack, 0, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
|
||||
memcpy(command_ack, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,513 @@
|
||||
#pragma once
|
||||
// MESSAGE COMMAND_INT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_INT 75
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_command_int_t {
|
||||
float param1; /*< PARAM1, see MAV_CMD enum*/
|
||||
float param2; /*< PARAM2, see MAV_CMD enum*/
|
||||
float param3; /*< PARAM3, see MAV_CMD enum*/
|
||||
float param4; /*< PARAM4, see MAV_CMD enum*/
|
||||
int32_t x; /*< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*/
|
||||
int32_t y; /*< PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7*/
|
||||
float z; /*< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).*/
|
||||
uint16_t command; /*< The scheduled action for the mission item.*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t frame; /*< The coordinate system of the COMMAND.*/
|
||||
uint8_t current; /*< false:0, true:1*/
|
||||
uint8_t autocontinue; /*< autocontinue to next wp*/
|
||||
}) mavlink_command_int_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_INT_LEN 35
|
||||
#define MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN 35
|
||||
#define MAVLINK_MSG_ID_75_LEN 35
|
||||
#define MAVLINK_MSG_ID_75_MIN_LEN 35
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_INT_CRC 158
|
||||
#define MAVLINK_MSG_ID_75_CRC 158
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_INT { \
|
||||
75, \
|
||||
"COMMAND_INT", \
|
||||
13, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \
|
||||
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \
|
||||
{ "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \
|
||||
{ "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \
|
||||
{ "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_INT { \
|
||||
"COMMAND_INT", \
|
||||
13, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \
|
||||
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \
|
||||
{ "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \
|
||||
{ "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \
|
||||
{ "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a command_int message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param frame The coordinate system of the COMMAND.
|
||||
* @param command The scheduled action for the mission item.
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue autocontinue to next wp
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
* @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
|
||||
* @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, frame);
|
||||
_mav_put_uint8_t(buf, 33, current);
|
||||
_mav_put_uint8_t(buf, 34, autocontinue);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
|
||||
#else
|
||||
mavlink_command_int_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a command_int message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param frame The coordinate system of the COMMAND.
|
||||
* @param command The scheduled action for the mission item.
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue autocontinue to next wp
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
* @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
|
||||
* @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,int32_t x,int32_t y,float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, frame);
|
||||
_mav_put_uint8_t(buf, 33, current);
|
||||
_mav_put_uint8_t(buf, 34, autocontinue);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
|
||||
#else
|
||||
mavlink_command_int_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_int struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_int_t* command_int)
|
||||
{
|
||||
return mavlink_msg_command_int_pack(system_id, component_id, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_int struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_int_t* command_int)
|
||||
{
|
||||
return mavlink_msg_command_int_pack_chan(system_id, component_id, chan, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param frame The coordinate system of the COMMAND.
|
||||
* @param command The scheduled action for the mission item.
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue autocontinue to next wp
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
* @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
|
||||
* @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_command_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, frame);
|
||||
_mav_put_uint8_t(buf, 33, current);
|
||||
_mav_put_uint8_t(buf, 34, autocontinue);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
#else
|
||||
mavlink_command_int_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_command_int_send_struct(mavlink_channel_t chan, const mavlink_command_int_t* command_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_command_int_send(chan, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)command_int, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_COMMAND_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_command_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, frame);
|
||||
_mav_put_uint8_t(buf, 33, current);
|
||||
_mav_put_uint8_t(buf, 34, autocontinue);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
#else
|
||||
mavlink_command_int_t *packet = (mavlink_command_int_t *)msgbuf;
|
||||
packet->param1 = param1;
|
||||
packet->param2 = param2;
|
||||
packet->param3 = param3;
|
||||
packet->param4 = param4;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->command = command;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->frame = frame;
|
||||
packet->current = current;
|
||||
packet->autocontinue = autocontinue;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE COMMAND_INT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from command_int message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_int_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from command_int message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_int_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field frame from command_int message
|
||||
*
|
||||
* @return The coordinate system of the COMMAND.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_int_get_frame(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field command from command_int message
|
||||
*
|
||||
* @return The scheduled action for the mission item.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_int_get_command(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current from command_int message
|
||||
*
|
||||
* @return false:0, true:1
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_int_get_current(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field autocontinue from command_int message
|
||||
*
|
||||
* @return autocontinue to next wp
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_int_get_autocontinue(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param1 from command_int message
|
||||
*
|
||||
* @return PARAM1, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_command_int_get_param1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param2 from command_int message
|
||||
*
|
||||
* @return PARAM2, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_command_int_get_param2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param3 from command_int message
|
||||
*
|
||||
* @return PARAM3, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_command_int_get_param3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param4 from command_int message
|
||||
*
|
||||
* @return PARAM4, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_command_int_get_param4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from command_int message
|
||||
*
|
||||
* @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_command_int_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from command_int message
|
||||
*
|
||||
* @return PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_command_int_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from command_int message
|
||||
*
|
||||
* @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
|
||||
*/
|
||||
static inline float mavlink_msg_command_int_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a command_int message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param command_int C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_command_int_decode(const mavlink_message_t* msg, mavlink_command_int_t* command_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
command_int->param1 = mavlink_msg_command_int_get_param1(msg);
|
||||
command_int->param2 = mavlink_msg_command_int_get_param2(msg);
|
||||
command_int->param3 = mavlink_msg_command_int_get_param3(msg);
|
||||
command_int->param4 = mavlink_msg_command_int_get_param4(msg);
|
||||
command_int->x = mavlink_msg_command_int_get_x(msg);
|
||||
command_int->y = mavlink_msg_command_int_get_y(msg);
|
||||
command_int->z = mavlink_msg_command_int_get_z(msg);
|
||||
command_int->command = mavlink_msg_command_int_get_command(msg);
|
||||
command_int->target_system = mavlink_msg_command_int_get_target_system(msg);
|
||||
command_int->target_component = mavlink_msg_command_int_get_target_component(msg);
|
||||
command_int->frame = mavlink_msg_command_int_get_frame(msg);
|
||||
command_int->current = mavlink_msg_command_int_get_current(msg);
|
||||
command_int->autocontinue = mavlink_msg_command_int_get_autocontinue(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_INT_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_INT_LEN;
|
||||
memset(command_int, 0, MAVLINK_MSG_ID_COMMAND_INT_LEN);
|
||||
memcpy(command_int, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,463 @@
|
||||
#pragma once
|
||||
// MESSAGE COMMAND_LONG PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_LONG 76
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_command_long_t {
|
||||
float param1; /*< Parameter 1 (for the specific command).*/
|
||||
float param2; /*< Parameter 2 (for the specific command).*/
|
||||
float param3; /*< Parameter 3 (for the specific command).*/
|
||||
float param4; /*< Parameter 4 (for the specific command).*/
|
||||
float param5; /*< Parameter 5 (for the specific command).*/
|
||||
float param6; /*< Parameter 6 (for the specific command).*/
|
||||
float param7; /*< Parameter 7 (for the specific command).*/
|
||||
uint16_t command; /*< Command ID (of command to send).*/
|
||||
uint8_t target_system; /*< System which should execute the command*/
|
||||
uint8_t target_component; /*< Component which should execute the command, 0 for all components*/
|
||||
uint8_t confirmation; /*< 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)*/
|
||||
}) mavlink_command_long_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_LONG_LEN 33
|
||||
#define MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN 33
|
||||
#define MAVLINK_MSG_ID_76_LEN 33
|
||||
#define MAVLINK_MSG_ID_76_MIN_LEN 33
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_LONG_CRC 152
|
||||
#define MAVLINK_MSG_ID_76_CRC 152
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \
|
||||
76, \
|
||||
"COMMAND_LONG", \
|
||||
11, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \
|
||||
{ "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \
|
||||
{ "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \
|
||||
{ "param5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_long_t, param5) }, \
|
||||
{ "param6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_command_long_t, param6) }, \
|
||||
{ "param7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_long_t, param7) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \
|
||||
"COMMAND_LONG", \
|
||||
11, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \
|
||||
{ "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \
|
||||
{ "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \
|
||||
{ "param5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_long_t, param5) }, \
|
||||
{ "param6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_command_long_t, param6) }, \
|
||||
{ "param7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_long_t, param7) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a command_long message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System which should execute the command
|
||||
* @param target_component Component which should execute the command, 0 for all components
|
||||
* @param command Command ID (of command to send).
|
||||
* @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
||||
* @param param1 Parameter 1 (for the specific command).
|
||||
* @param param2 Parameter 2 (for the specific command).
|
||||
* @param param3 Parameter 3 (for the specific command).
|
||||
* @param param4 Parameter 4 (for the specific command).
|
||||
* @param param5 Parameter 5 (for the specific command).
|
||||
* @param param6 Parameter 6 (for the specific command).
|
||||
* @param param7 Parameter 7 (for the specific command).
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, param5);
|
||||
_mav_put_float(buf, 20, param6);
|
||||
_mav_put_float(buf, 24, param7);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, confirmation);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
|
||||
#else
|
||||
mavlink_command_long_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.param5 = param5;
|
||||
packet.param6 = param6;
|
||||
packet.param7 = param7;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.confirmation = confirmation;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a command_long message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System which should execute the command
|
||||
* @param target_component Component which should execute the command, 0 for all components
|
||||
* @param command Command ID (of command to send).
|
||||
* @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
||||
* @param param1 Parameter 1 (for the specific command).
|
||||
* @param param2 Parameter 2 (for the specific command).
|
||||
* @param param3 Parameter 3 (for the specific command).
|
||||
* @param param4 Parameter 4 (for the specific command).
|
||||
* @param param5 Parameter 5 (for the specific command).
|
||||
* @param param6 Parameter 6 (for the specific command).
|
||||
* @param param7 Parameter 7 (for the specific command).
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t command,uint8_t confirmation,float param1,float param2,float param3,float param4,float param5,float param6,float param7)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, param5);
|
||||
_mav_put_float(buf, 20, param6);
|
||||
_mav_put_float(buf, 24, param7);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, confirmation);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
|
||||
#else
|
||||
mavlink_command_long_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.param5 = param5;
|
||||
packet.param6 = param6;
|
||||
packet.param7 = param7;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.confirmation = confirmation;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_long struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_long C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_long_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_long_t* command_long)
|
||||
{
|
||||
return mavlink_msg_command_long_pack(system_id, component_id, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_long struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_long C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_long_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_long_t* command_long)
|
||||
{
|
||||
return mavlink_msg_command_long_pack_chan(system_id, component_id, chan, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_long message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System which should execute the command
|
||||
* @param target_component Component which should execute the command, 0 for all components
|
||||
* @param command Command ID (of command to send).
|
||||
* @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
||||
* @param param1 Parameter 1 (for the specific command).
|
||||
* @param param2 Parameter 2 (for the specific command).
|
||||
* @param param3 Parameter 3 (for the specific command).
|
||||
* @param param4 Parameter 4 (for the specific command).
|
||||
* @param param5 Parameter 5 (for the specific command).
|
||||
* @param param6 Parameter 6 (for the specific command).
|
||||
* @param param7 Parameter 7 (for the specific command).
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_command_long_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, param5);
|
||||
_mav_put_float(buf, 20, param6);
|
||||
_mav_put_float(buf, 24, param7);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, confirmation);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
#else
|
||||
mavlink_command_long_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.param5 = param5;
|
||||
packet.param6 = param6;
|
||||
packet.param7 = param7;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.confirmation = confirmation;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_long message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_command_long_send_struct(mavlink_channel_t chan, const mavlink_command_long_t* command_long)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_command_long_send(chan, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)command_long, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_COMMAND_LONG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_command_long_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, param5);
|
||||
_mav_put_float(buf, 20, param6);
|
||||
_mav_put_float(buf, 24, param7);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, confirmation);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
#else
|
||||
mavlink_command_long_t *packet = (mavlink_command_long_t *)msgbuf;
|
||||
packet->param1 = param1;
|
||||
packet->param2 = param2;
|
||||
packet->param3 = param3;
|
||||
packet->param4 = param4;
|
||||
packet->param5 = param5;
|
||||
packet->param6 = param6;
|
||||
packet->param7 = param7;
|
||||
packet->command = command;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->confirmation = confirmation;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)packet, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE COMMAND_LONG UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from command_long message
|
||||
*
|
||||
* @return System which should execute the command
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_long_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from command_long message
|
||||
*
|
||||
* @return Component which should execute the command, 0 for all components
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_long_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field command from command_long message
|
||||
*
|
||||
* @return Command ID (of command to send).
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_long_get_command(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field confirmation from command_long message
|
||||
*
|
||||
* @return 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_long_get_confirmation(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param1 from command_long message
|
||||
*
|
||||
* @return Parameter 1 (for the specific command).
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param2 from command_long message
|
||||
*
|
||||
* @return Parameter 2 (for the specific command).
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param3 from command_long message
|
||||
*
|
||||
* @return Parameter 3 (for the specific command).
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param4 from command_long message
|
||||
*
|
||||
* @return Parameter 4 (for the specific command).
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param5 from command_long message
|
||||
*
|
||||
* @return Parameter 5 (for the specific command).
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param5(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param6 from command_long message
|
||||
*
|
||||
* @return Parameter 6 (for the specific command).
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param6(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param7 from command_long message
|
||||
*
|
||||
* @return Parameter 7 (for the specific command).
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param7(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a command_long message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param command_long C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_command_long_decode(const mavlink_message_t* msg, mavlink_command_long_t* command_long)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
command_long->param1 = mavlink_msg_command_long_get_param1(msg);
|
||||
command_long->param2 = mavlink_msg_command_long_get_param2(msg);
|
||||
command_long->param3 = mavlink_msg_command_long_get_param3(msg);
|
||||
command_long->param4 = mavlink_msg_command_long_get_param4(msg);
|
||||
command_long->param5 = mavlink_msg_command_long_get_param5(msg);
|
||||
command_long->param6 = mavlink_msg_command_long_get_param6(msg);
|
||||
command_long->param7 = mavlink_msg_command_long_get_param7(msg);
|
||||
command_long->command = mavlink_msg_command_long_get_command(msg);
|
||||
command_long->target_system = mavlink_msg_command_long_get_target_system(msg);
|
||||
command_long->target_component = mavlink_msg_command_long_get_target_component(msg);
|
||||
command_long->confirmation = mavlink_msg_command_long_get_confirmation(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_LONG_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_LONG_LEN;
|
||||
memset(command_long, 0, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
|
||||
memcpy(command_long, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,607 @@
|
||||
#pragma once
|
||||
// MESSAGE CONTROL_SYSTEM_STATE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE 146
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_control_system_state_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float x_acc; /*< [m/s/s] X acceleration in body frame*/
|
||||
float y_acc; /*< [m/s/s] Y acceleration in body frame*/
|
||||
float z_acc; /*< [m/s/s] Z acceleration in body frame*/
|
||||
float x_vel; /*< [m/s] X velocity in body frame*/
|
||||
float y_vel; /*< [m/s] Y velocity in body frame*/
|
||||
float z_vel; /*< [m/s] Z velocity in body frame*/
|
||||
float x_pos; /*< [m] X position in local frame*/
|
||||
float y_pos; /*< [m] Y position in local frame*/
|
||||
float z_pos; /*< [m] Z position in local frame*/
|
||||
float airspeed; /*< [m/s] Airspeed, set to -1 if unknown*/
|
||||
float vel_variance[3]; /*< Variance of body velocity estimate*/
|
||||
float pos_variance[3]; /*< Variance in local position*/
|
||||
float q[4]; /*< The attitude, represented as Quaternion*/
|
||||
float roll_rate; /*< [rad/s] Angular rate in roll axis*/
|
||||
float pitch_rate; /*< [rad/s] Angular rate in pitch axis*/
|
||||
float yaw_rate; /*< [rad/s] Angular rate in yaw axis*/
|
||||
}) mavlink_control_system_state_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN 100
|
||||
#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN 100
|
||||
#define MAVLINK_MSG_ID_146_LEN 100
|
||||
#define MAVLINK_MSG_ID_146_MIN_LEN 100
|
||||
|
||||
#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC 103
|
||||
#define MAVLINK_MSG_ID_146_CRC 103
|
||||
|
||||
#define MAVLINK_MSG_CONTROL_SYSTEM_STATE_FIELD_VEL_VARIANCE_LEN 3
|
||||
#define MAVLINK_MSG_CONTROL_SYSTEM_STATE_FIELD_POS_VARIANCE_LEN 3
|
||||
#define MAVLINK_MSG_CONTROL_SYSTEM_STATE_FIELD_Q_LEN 4
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE { \
|
||||
146, \
|
||||
"CONTROL_SYSTEM_STATE", \
|
||||
17, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_control_system_state_t, time_usec) }, \
|
||||
{ "x_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_control_system_state_t, x_acc) }, \
|
||||
{ "y_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_control_system_state_t, y_acc) }, \
|
||||
{ "z_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_control_system_state_t, z_acc) }, \
|
||||
{ "x_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_control_system_state_t, x_vel) }, \
|
||||
{ "y_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_control_system_state_t, y_vel) }, \
|
||||
{ "z_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_control_system_state_t, z_vel) }, \
|
||||
{ "x_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_control_system_state_t, x_pos) }, \
|
||||
{ "y_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_control_system_state_t, y_pos) }, \
|
||||
{ "z_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_control_system_state_t, z_pos) }, \
|
||||
{ "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_control_system_state_t, airspeed) }, \
|
||||
{ "vel_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 48, offsetof(mavlink_control_system_state_t, vel_variance) }, \
|
||||
{ "pos_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 60, offsetof(mavlink_control_system_state_t, pos_variance) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 72, offsetof(mavlink_control_system_state_t, q) }, \
|
||||
{ "roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_control_system_state_t, roll_rate) }, \
|
||||
{ "pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_control_system_state_t, pitch_rate) }, \
|
||||
{ "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_control_system_state_t, yaw_rate) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE { \
|
||||
"CONTROL_SYSTEM_STATE", \
|
||||
17, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_control_system_state_t, time_usec) }, \
|
||||
{ "x_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_control_system_state_t, x_acc) }, \
|
||||
{ "y_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_control_system_state_t, y_acc) }, \
|
||||
{ "z_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_control_system_state_t, z_acc) }, \
|
||||
{ "x_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_control_system_state_t, x_vel) }, \
|
||||
{ "y_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_control_system_state_t, y_vel) }, \
|
||||
{ "z_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_control_system_state_t, z_vel) }, \
|
||||
{ "x_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_control_system_state_t, x_pos) }, \
|
||||
{ "y_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_control_system_state_t, y_pos) }, \
|
||||
{ "z_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_control_system_state_t, z_pos) }, \
|
||||
{ "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_control_system_state_t, airspeed) }, \
|
||||
{ "vel_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 48, offsetof(mavlink_control_system_state_t, vel_variance) }, \
|
||||
{ "pos_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 60, offsetof(mavlink_control_system_state_t, pos_variance) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 72, offsetof(mavlink_control_system_state_t, q) }, \
|
||||
{ "roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_control_system_state_t, roll_rate) }, \
|
||||
{ "pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_control_system_state_t, pitch_rate) }, \
|
||||
{ "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_control_system_state_t, yaw_rate) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a control_system_state message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param x_acc [m/s/s] X acceleration in body frame
|
||||
* @param y_acc [m/s/s] Y acceleration in body frame
|
||||
* @param z_acc [m/s/s] Z acceleration in body frame
|
||||
* @param x_vel [m/s] X velocity in body frame
|
||||
* @param y_vel [m/s] Y velocity in body frame
|
||||
* @param z_vel [m/s] Z velocity in body frame
|
||||
* @param x_pos [m] X position in local frame
|
||||
* @param y_pos [m] Y position in local frame
|
||||
* @param z_pos [m] Z position in local frame
|
||||
* @param airspeed [m/s] Airspeed, set to -1 if unknown
|
||||
* @param vel_variance Variance of body velocity estimate
|
||||
* @param pos_variance Variance in local position
|
||||
* @param q The attitude, represented as Quaternion
|
||||
* @param roll_rate [rad/s] Angular rate in roll axis
|
||||
* @param pitch_rate [rad/s] Angular rate in pitch axis
|
||||
* @param yaw_rate [rad/s] Angular rate in yaw axis
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x_acc);
|
||||
_mav_put_float(buf, 12, y_acc);
|
||||
_mav_put_float(buf, 16, z_acc);
|
||||
_mav_put_float(buf, 20, x_vel);
|
||||
_mav_put_float(buf, 24, y_vel);
|
||||
_mav_put_float(buf, 28, z_vel);
|
||||
_mav_put_float(buf, 32, x_pos);
|
||||
_mav_put_float(buf, 36, y_pos);
|
||||
_mav_put_float(buf, 40, z_pos);
|
||||
_mav_put_float(buf, 44, airspeed);
|
||||
_mav_put_float(buf, 88, roll_rate);
|
||||
_mav_put_float(buf, 92, pitch_rate);
|
||||
_mav_put_float(buf, 96, yaw_rate);
|
||||
_mav_put_float_array(buf, 48, vel_variance, 3);
|
||||
_mav_put_float_array(buf, 60, pos_variance, 3);
|
||||
_mav_put_float_array(buf, 72, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
|
||||
#else
|
||||
mavlink_control_system_state_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x_acc = x_acc;
|
||||
packet.y_acc = y_acc;
|
||||
packet.z_acc = z_acc;
|
||||
packet.x_vel = x_vel;
|
||||
packet.y_vel = y_vel;
|
||||
packet.z_vel = z_vel;
|
||||
packet.x_pos = x_pos;
|
||||
packet.y_pos = y_pos;
|
||||
packet.z_pos = z_pos;
|
||||
packet.airspeed = airspeed;
|
||||
packet.roll_rate = roll_rate;
|
||||
packet.pitch_rate = pitch_rate;
|
||||
packet.yaw_rate = yaw_rate;
|
||||
mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a control_system_state message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param x_acc [m/s/s] X acceleration in body frame
|
||||
* @param y_acc [m/s/s] Y acceleration in body frame
|
||||
* @param z_acc [m/s/s] Z acceleration in body frame
|
||||
* @param x_vel [m/s] X velocity in body frame
|
||||
* @param y_vel [m/s] Y velocity in body frame
|
||||
* @param z_vel [m/s] Z velocity in body frame
|
||||
* @param x_pos [m] X position in local frame
|
||||
* @param y_pos [m] Y position in local frame
|
||||
* @param z_pos [m] Z position in local frame
|
||||
* @param airspeed [m/s] Airspeed, set to -1 if unknown
|
||||
* @param vel_variance Variance of body velocity estimate
|
||||
* @param pos_variance Variance in local position
|
||||
* @param q The attitude, represented as Quaternion
|
||||
* @param roll_rate [rad/s] Angular rate in roll axis
|
||||
* @param pitch_rate [rad/s] Angular rate in pitch axis
|
||||
* @param yaw_rate [rad/s] Angular rate in yaw axis
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,float x_acc,float y_acc,float z_acc,float x_vel,float y_vel,float z_vel,float x_pos,float y_pos,float z_pos,float airspeed,const float *vel_variance,const float *pos_variance,const float *q,float roll_rate,float pitch_rate,float yaw_rate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x_acc);
|
||||
_mav_put_float(buf, 12, y_acc);
|
||||
_mav_put_float(buf, 16, z_acc);
|
||||
_mav_put_float(buf, 20, x_vel);
|
||||
_mav_put_float(buf, 24, y_vel);
|
||||
_mav_put_float(buf, 28, z_vel);
|
||||
_mav_put_float(buf, 32, x_pos);
|
||||
_mav_put_float(buf, 36, y_pos);
|
||||
_mav_put_float(buf, 40, z_pos);
|
||||
_mav_put_float(buf, 44, airspeed);
|
||||
_mav_put_float(buf, 88, roll_rate);
|
||||
_mav_put_float(buf, 92, pitch_rate);
|
||||
_mav_put_float(buf, 96, yaw_rate);
|
||||
_mav_put_float_array(buf, 48, vel_variance, 3);
|
||||
_mav_put_float_array(buf, 60, pos_variance, 3);
|
||||
_mav_put_float_array(buf, 72, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
|
||||
#else
|
||||
mavlink_control_system_state_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x_acc = x_acc;
|
||||
packet.y_acc = y_acc;
|
||||
packet.z_acc = z_acc;
|
||||
packet.x_vel = x_vel;
|
||||
packet.y_vel = y_vel;
|
||||
packet.z_vel = z_vel;
|
||||
packet.x_pos = x_pos;
|
||||
packet.y_pos = y_pos;
|
||||
packet.z_pos = z_pos;
|
||||
packet.airspeed = airspeed;
|
||||
packet.roll_rate = roll_rate;
|
||||
packet.pitch_rate = pitch_rate;
|
||||
packet.yaw_rate = yaw_rate;
|
||||
mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a control_system_state struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param control_system_state C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_control_system_state_t* control_system_state)
|
||||
{
|
||||
return mavlink_msg_control_system_state_pack(system_id, component_id, msg, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a control_system_state struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param control_system_state C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_control_system_state_t* control_system_state)
|
||||
{
|
||||
return mavlink_msg_control_system_state_pack_chan(system_id, component_id, chan, msg, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a control_system_state message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param x_acc [m/s/s] X acceleration in body frame
|
||||
* @param y_acc [m/s/s] Y acceleration in body frame
|
||||
* @param z_acc [m/s/s] Z acceleration in body frame
|
||||
* @param x_vel [m/s] X velocity in body frame
|
||||
* @param y_vel [m/s] Y velocity in body frame
|
||||
* @param z_vel [m/s] Z velocity in body frame
|
||||
* @param x_pos [m] X position in local frame
|
||||
* @param y_pos [m] Y position in local frame
|
||||
* @param z_pos [m] Z position in local frame
|
||||
* @param airspeed [m/s] Airspeed, set to -1 if unknown
|
||||
* @param vel_variance Variance of body velocity estimate
|
||||
* @param pos_variance Variance in local position
|
||||
* @param q The attitude, represented as Quaternion
|
||||
* @param roll_rate [rad/s] Angular rate in roll axis
|
||||
* @param pitch_rate [rad/s] Angular rate in pitch axis
|
||||
* @param yaw_rate [rad/s] Angular rate in yaw axis
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_control_system_state_send(mavlink_channel_t chan, uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x_acc);
|
||||
_mav_put_float(buf, 12, y_acc);
|
||||
_mav_put_float(buf, 16, z_acc);
|
||||
_mav_put_float(buf, 20, x_vel);
|
||||
_mav_put_float(buf, 24, y_vel);
|
||||
_mav_put_float(buf, 28, z_vel);
|
||||
_mav_put_float(buf, 32, x_pos);
|
||||
_mav_put_float(buf, 36, y_pos);
|
||||
_mav_put_float(buf, 40, z_pos);
|
||||
_mav_put_float(buf, 44, airspeed);
|
||||
_mav_put_float(buf, 88, roll_rate);
|
||||
_mav_put_float(buf, 92, pitch_rate);
|
||||
_mav_put_float(buf, 96, yaw_rate);
|
||||
_mav_put_float_array(buf, 48, vel_variance, 3);
|
||||
_mav_put_float_array(buf, 60, pos_variance, 3);
|
||||
_mav_put_float_array(buf, 72, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
#else
|
||||
mavlink_control_system_state_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x_acc = x_acc;
|
||||
packet.y_acc = y_acc;
|
||||
packet.z_acc = z_acc;
|
||||
packet.x_vel = x_vel;
|
||||
packet.y_vel = y_vel;
|
||||
packet.z_vel = z_vel;
|
||||
packet.x_pos = x_pos;
|
||||
packet.y_pos = y_pos;
|
||||
packet.z_pos = z_pos;
|
||||
packet.airspeed = airspeed;
|
||||
packet.roll_rate = roll_rate;
|
||||
packet.pitch_rate = pitch_rate;
|
||||
packet.yaw_rate = yaw_rate;
|
||||
mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)&packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a control_system_state message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_control_system_state_send_struct(mavlink_channel_t chan, const mavlink_control_system_state_t* control_system_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_control_system_state_send(chan, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)control_system_state, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_control_system_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x_acc);
|
||||
_mav_put_float(buf, 12, y_acc);
|
||||
_mav_put_float(buf, 16, z_acc);
|
||||
_mav_put_float(buf, 20, x_vel);
|
||||
_mav_put_float(buf, 24, y_vel);
|
||||
_mav_put_float(buf, 28, z_vel);
|
||||
_mav_put_float(buf, 32, x_pos);
|
||||
_mav_put_float(buf, 36, y_pos);
|
||||
_mav_put_float(buf, 40, z_pos);
|
||||
_mav_put_float(buf, 44, airspeed);
|
||||
_mav_put_float(buf, 88, roll_rate);
|
||||
_mav_put_float(buf, 92, pitch_rate);
|
||||
_mav_put_float(buf, 96, yaw_rate);
|
||||
_mav_put_float_array(buf, 48, vel_variance, 3);
|
||||
_mav_put_float_array(buf, 60, pos_variance, 3);
|
||||
_mav_put_float_array(buf, 72, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
#else
|
||||
mavlink_control_system_state_t *packet = (mavlink_control_system_state_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->x_acc = x_acc;
|
||||
packet->y_acc = y_acc;
|
||||
packet->z_acc = z_acc;
|
||||
packet->x_vel = x_vel;
|
||||
packet->y_vel = y_vel;
|
||||
packet->z_vel = z_vel;
|
||||
packet->x_pos = x_pos;
|
||||
packet->y_pos = y_pos;
|
||||
packet->z_pos = z_pos;
|
||||
packet->airspeed = airspeed;
|
||||
packet->roll_rate = roll_rate;
|
||||
packet->pitch_rate = pitch_rate;
|
||||
packet->yaw_rate = yaw_rate;
|
||||
mav_array_memcpy(packet->vel_variance, vel_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet->pos_variance, pos_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CONTROL_SYSTEM_STATE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from control_system_state message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_control_system_state_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x_acc from control_system_state message
|
||||
*
|
||||
* @return [m/s/s] X acceleration in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_x_acc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y_acc from control_system_state message
|
||||
*
|
||||
* @return [m/s/s] Y acceleration in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_y_acc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z_acc from control_system_state message
|
||||
*
|
||||
* @return [m/s/s] Z acceleration in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_z_acc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x_vel from control_system_state message
|
||||
*
|
||||
* @return [m/s] X velocity in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_x_vel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y_vel from control_system_state message
|
||||
*
|
||||
* @return [m/s] Y velocity in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_y_vel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z_vel from control_system_state message
|
||||
*
|
||||
* @return [m/s] Z velocity in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_z_vel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x_pos from control_system_state message
|
||||
*
|
||||
* @return [m] X position in local frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_x_pos(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y_pos from control_system_state message
|
||||
*
|
||||
* @return [m] Y position in local frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_y_pos(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z_pos from control_system_state message
|
||||
*
|
||||
* @return [m] Z position in local frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_z_pos(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field airspeed from control_system_state message
|
||||
*
|
||||
* @return [m/s] Airspeed, set to -1 if unknown
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_airspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel_variance from control_system_state message
|
||||
*
|
||||
* @return Variance of body velocity estimate
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_get_vel_variance(const mavlink_message_t* msg, float *vel_variance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, vel_variance, 3, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_variance from control_system_state message
|
||||
*
|
||||
* @return Variance in local position
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_get_pos_variance(const mavlink_message_t* msg, float *pos_variance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, pos_variance, 3, 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from control_system_state message
|
||||
*
|
||||
* @return The attitude, represented as Quaternion
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 72);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll_rate from control_system_state message
|
||||
*
|
||||
* @return [rad/s] Angular rate in roll axis
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_roll_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 88);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch_rate from control_system_state message
|
||||
*
|
||||
* @return [rad/s] Angular rate in pitch axis
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_pitch_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 92);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw_rate from control_system_state message
|
||||
*
|
||||
* @return [rad/s] Angular rate in yaw axis
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_yaw_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 96);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a control_system_state message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param control_system_state C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_control_system_state_decode(const mavlink_message_t* msg, mavlink_control_system_state_t* control_system_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
control_system_state->time_usec = mavlink_msg_control_system_state_get_time_usec(msg);
|
||||
control_system_state->x_acc = mavlink_msg_control_system_state_get_x_acc(msg);
|
||||
control_system_state->y_acc = mavlink_msg_control_system_state_get_y_acc(msg);
|
||||
control_system_state->z_acc = mavlink_msg_control_system_state_get_z_acc(msg);
|
||||
control_system_state->x_vel = mavlink_msg_control_system_state_get_x_vel(msg);
|
||||
control_system_state->y_vel = mavlink_msg_control_system_state_get_y_vel(msg);
|
||||
control_system_state->z_vel = mavlink_msg_control_system_state_get_z_vel(msg);
|
||||
control_system_state->x_pos = mavlink_msg_control_system_state_get_x_pos(msg);
|
||||
control_system_state->y_pos = mavlink_msg_control_system_state_get_y_pos(msg);
|
||||
control_system_state->z_pos = mavlink_msg_control_system_state_get_z_pos(msg);
|
||||
control_system_state->airspeed = mavlink_msg_control_system_state_get_airspeed(msg);
|
||||
mavlink_msg_control_system_state_get_vel_variance(msg, control_system_state->vel_variance);
|
||||
mavlink_msg_control_system_state_get_pos_variance(msg, control_system_state->pos_variance);
|
||||
mavlink_msg_control_system_state_get_q(msg, control_system_state->q);
|
||||
control_system_state->roll_rate = mavlink_msg_control_system_state_get_roll_rate(msg);
|
||||
control_system_state->pitch_rate = mavlink_msg_control_system_state_get_pitch_rate(msg);
|
||||
control_system_state->yaw_rate = mavlink_msg_control_system_state_get_yaw_rate(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN? msg->len : MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN;
|
||||
memset(control_system_state, 0, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
|
||||
memcpy(control_system_state, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE DATA_STREAM PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_STREAM 67
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_data_stream_t {
|
||||
uint16_t message_rate; /*< [Hz] The message rate*/
|
||||
uint8_t stream_id; /*< The ID of the requested data stream*/
|
||||
uint8_t on_off; /*< 1 stream is enabled, 0 stream is stopped.*/
|
||||
}) mavlink_data_stream_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_STREAM_LEN 4
|
||||
#define MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN 4
|
||||
#define MAVLINK_MSG_ID_67_LEN 4
|
||||
#define MAVLINK_MSG_ID_67_MIN_LEN 4
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_STREAM_CRC 21
|
||||
#define MAVLINK_MSG_ID_67_CRC 21
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DATA_STREAM { \
|
||||
67, \
|
||||
"DATA_STREAM", \
|
||||
3, \
|
||||
{ { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \
|
||||
{ "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \
|
||||
{ "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DATA_STREAM { \
|
||||
"DATA_STREAM", \
|
||||
3, \
|
||||
{ { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \
|
||||
{ "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \
|
||||
{ "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a data_stream message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param stream_id The ID of the requested data stream
|
||||
* @param message_rate [Hz] The message rate
|
||||
* @param on_off 1 stream is enabled, 0 stream is stopped.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
|
||||
_mav_put_uint16_t(buf, 0, message_rate);
|
||||
_mav_put_uint8_t(buf, 2, stream_id);
|
||||
_mav_put_uint8_t(buf, 3, on_off);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN);
|
||||
#else
|
||||
mavlink_data_stream_t packet;
|
||||
packet.message_rate = message_rate;
|
||||
packet.stream_id = stream_id;
|
||||
packet.on_off = on_off;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data_stream message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param stream_id The ID of the requested data stream
|
||||
* @param message_rate [Hz] The message rate
|
||||
* @param on_off 1 stream is enabled, 0 stream is stopped.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t stream_id,uint16_t message_rate,uint8_t on_off)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
|
||||
_mav_put_uint16_t(buf, 0, message_rate);
|
||||
_mav_put_uint8_t(buf, 2, stream_id);
|
||||
_mav_put_uint8_t(buf, 3, on_off);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN);
|
||||
#else
|
||||
mavlink_data_stream_t packet;
|
||||
packet.message_rate = message_rate;
|
||||
packet.stream_id = stream_id;
|
||||
packet.on_off = on_off;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data_stream struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data_stream C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_stream_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_stream_t* data_stream)
|
||||
{
|
||||
return mavlink_msg_data_stream_pack(system_id, component_id, msg, data_stream->stream_id, data_stream->message_rate, data_stream->on_off);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data_stream struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data_stream C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_stream_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data_stream_t* data_stream)
|
||||
{
|
||||
return mavlink_msg_data_stream_pack_chan(system_id, component_id, chan, msg, data_stream->stream_id, data_stream->message_rate, data_stream->on_off);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data_stream message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param stream_id The ID of the requested data stream
|
||||
* @param message_rate [Hz] The message rate
|
||||
* @param on_off 1 stream is enabled, 0 stream is stopped.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data_stream_send(mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
|
||||
_mav_put_uint16_t(buf, 0, message_rate);
|
||||
_mav_put_uint8_t(buf, 2, stream_id);
|
||||
_mav_put_uint8_t(buf, 3, on_off);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
#else
|
||||
mavlink_data_stream_t packet;
|
||||
packet.message_rate = message_rate;
|
||||
packet.stream_id = stream_id;
|
||||
packet.on_off = on_off;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data_stream message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_data_stream_send_struct(mavlink_channel_t chan, const mavlink_data_stream_t* data_stream)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_data_stream_send(chan, data_stream->stream_id, data_stream->message_rate, data_stream->on_off);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)data_stream, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DATA_STREAM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_data_stream_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, message_rate);
|
||||
_mav_put_uint8_t(buf, 2, stream_id);
|
||||
_mav_put_uint8_t(buf, 3, on_off);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
#else
|
||||
mavlink_data_stream_t *packet = (mavlink_data_stream_t *)msgbuf;
|
||||
packet->message_rate = message_rate;
|
||||
packet->stream_id = stream_id;
|
||||
packet->on_off = on_off;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)packet, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA_STREAM UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field stream_id from data_stream message
|
||||
*
|
||||
* @return The ID of the requested data stream
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data_stream_get_stream_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field message_rate from data_stream message
|
||||
*
|
||||
* @return [Hz] The message rate
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_stream_get_message_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field on_off from data_stream message
|
||||
*
|
||||
* @return 1 stream is enabled, 0 stream is stopped.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data_stream_get_on_off(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data_stream message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data_stream C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data_stream_decode(const mavlink_message_t* msg, mavlink_data_stream_t* data_stream)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
data_stream->message_rate = mavlink_msg_data_stream_get_message_rate(msg);
|
||||
data_stream->stream_id = mavlink_msg_data_stream_get_stream_id(msg);
|
||||
data_stream->on_off = mavlink_msg_data_stream_get_on_off(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DATA_STREAM_LEN? msg->len : MAVLINK_MSG_ID_DATA_STREAM_LEN;
|
||||
memset(data_stream, 0, MAVLINK_MSG_ID_DATA_STREAM_LEN);
|
||||
memcpy(data_stream, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
#pragma once
|
||||
// MESSAGE DATA_TRANSMISSION_HANDSHAKE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE 130
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_data_transmission_handshake_t {
|
||||
uint32_t size; /*< [bytes] total data size (set on ACK only).*/
|
||||
uint16_t width; /*< Width of a matrix or image.*/
|
||||
uint16_t height; /*< Height of a matrix or image.*/
|
||||
uint16_t packets; /*< Number of packets being sent (set on ACK only).*/
|
||||
uint8_t type; /*< Type of requested/acknowledged data.*/
|
||||
uint8_t payload; /*< [bytes] Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only).*/
|
||||
uint8_t jpg_quality; /*< [%] JPEG quality. Values: [1-100].*/
|
||||
}) mavlink_data_transmission_handshake_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN 13
|
||||
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN 13
|
||||
#define MAVLINK_MSG_ID_130_LEN 13
|
||||
#define MAVLINK_MSG_ID_130_MIN_LEN 13
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC 29
|
||||
#define MAVLINK_MSG_ID_130_CRC 29
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE { \
|
||||
130, \
|
||||
"DATA_TRANSMISSION_HANDSHAKE", \
|
||||
7, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \
|
||||
{ "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \
|
||||
{ "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, width) }, \
|
||||
{ "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, height) }, \
|
||||
{ "packets", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_data_transmission_handshake_t, packets) }, \
|
||||
{ "payload", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_data_transmission_handshake_t, payload) }, \
|
||||
{ "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE { \
|
||||
"DATA_TRANSMISSION_HANDSHAKE", \
|
||||
7, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \
|
||||
{ "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \
|
||||
{ "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, width) }, \
|
||||
{ "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, height) }, \
|
||||
{ "packets", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_data_transmission_handshake_t, packets) }, \
|
||||
{ "payload", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_data_transmission_handshake_t, payload) }, \
|
||||
{ "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a data_transmission_handshake message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param type Type of requested/acknowledged data.
|
||||
* @param size [bytes] total data size (set on ACK only).
|
||||
* @param width Width of a matrix or image.
|
||||
* @param height Height of a matrix or image.
|
||||
* @param packets Number of packets being sent (set on ACK only).
|
||||
* @param payload [bytes] Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only).
|
||||
* @param jpg_quality [%] JPEG quality. Values: [1-100].
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, size);
|
||||
_mav_put_uint16_t(buf, 4, width);
|
||||
_mav_put_uint16_t(buf, 6, height);
|
||||
_mav_put_uint16_t(buf, 8, packets);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, payload);
|
||||
_mav_put_uint8_t(buf, 12, jpg_quality);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
|
||||
#else
|
||||
mavlink_data_transmission_handshake_t packet;
|
||||
packet.size = size;
|
||||
packet.width = width;
|
||||
packet.height = height;
|
||||
packet.packets = packets;
|
||||
packet.type = type;
|
||||
packet.payload = payload;
|
||||
packet.jpg_quality = jpg_quality;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data_transmission_handshake message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param type Type of requested/acknowledged data.
|
||||
* @param size [bytes] total data size (set on ACK only).
|
||||
* @param width Width of a matrix or image.
|
||||
* @param height Height of a matrix or image.
|
||||
* @param packets Number of packets being sent (set on ACK only).
|
||||
* @param payload [bytes] Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only).
|
||||
* @param jpg_quality [%] JPEG quality. Values: [1-100].
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t type,uint32_t size,uint16_t width,uint16_t height,uint16_t packets,uint8_t payload,uint8_t jpg_quality)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, size);
|
||||
_mav_put_uint16_t(buf, 4, width);
|
||||
_mav_put_uint16_t(buf, 6, height);
|
||||
_mav_put_uint16_t(buf, 8, packets);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, payload);
|
||||
_mav_put_uint8_t(buf, 12, jpg_quality);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
|
||||
#else
|
||||
mavlink_data_transmission_handshake_t packet;
|
||||
packet.size = size;
|
||||
packet.width = width;
|
||||
packet.height = height;
|
||||
packet.packets = packets;
|
||||
packet.type = type;
|
||||
packet.payload = payload;
|
||||
packet.jpg_quality = jpg_quality;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data_transmission_handshake struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data_transmission_handshake C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
|
||||
{
|
||||
return mavlink_msg_data_transmission_handshake_pack(system_id, component_id, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data_transmission_handshake struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data_transmission_handshake C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
|
||||
{
|
||||
return mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, chan, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data_transmission_handshake message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type Type of requested/acknowledged data.
|
||||
* @param size [bytes] total data size (set on ACK only).
|
||||
* @param width Width of a matrix or image.
|
||||
* @param height Height of a matrix or image.
|
||||
* @param packets Number of packets being sent (set on ACK only).
|
||||
* @param payload [bytes] Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only).
|
||||
* @param jpg_quality [%] JPEG quality. Values: [1-100].
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data_transmission_handshake_send(mavlink_channel_t chan, uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, size);
|
||||
_mav_put_uint16_t(buf, 4, width);
|
||||
_mav_put_uint16_t(buf, 6, height);
|
||||
_mav_put_uint16_t(buf, 8, packets);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, payload);
|
||||
_mav_put_uint8_t(buf, 12, jpg_quality);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
#else
|
||||
mavlink_data_transmission_handshake_t packet;
|
||||
packet.size = size;
|
||||
packet.width = width;
|
||||
packet.height = height;
|
||||
packet.packets = packets;
|
||||
packet.type = type;
|
||||
packet.payload = payload;
|
||||
packet.jpg_quality = jpg_quality;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)&packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data_transmission_handshake message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_data_transmission_handshake_send_struct(mavlink_channel_t chan, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_data_transmission_handshake_send(chan, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)data_transmission_handshake, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_data_transmission_handshake_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, size);
|
||||
_mav_put_uint16_t(buf, 4, width);
|
||||
_mav_put_uint16_t(buf, 6, height);
|
||||
_mav_put_uint16_t(buf, 8, packets);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, payload);
|
||||
_mav_put_uint8_t(buf, 12, jpg_quality);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
#else
|
||||
mavlink_data_transmission_handshake_t *packet = (mavlink_data_transmission_handshake_t *)msgbuf;
|
||||
packet->size = size;
|
||||
packet->width = width;
|
||||
packet->height = height;
|
||||
packet->packets = packets;
|
||||
packet->type = type;
|
||||
packet->payload = payload;
|
||||
packet->jpg_quality = jpg_quality;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA_TRANSMISSION_HANDSHAKE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field type from data_transmission_handshake message
|
||||
*
|
||||
* @return Type of requested/acknowledged data.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data_transmission_handshake_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field size from data_transmission_handshake message
|
||||
*
|
||||
* @return [bytes] total data size (set on ACK only).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_data_transmission_handshake_get_size(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field width from data_transmission_handshake message
|
||||
*
|
||||
* @return Width of a matrix or image.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_get_width(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field height from data_transmission_handshake message
|
||||
*
|
||||
* @return Height of a matrix or image.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_get_height(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field packets from data_transmission_handshake message
|
||||
*
|
||||
* @return Number of packets being sent (set on ACK only).
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_get_packets(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field payload from data_transmission_handshake message
|
||||
*
|
||||
* @return [bytes] Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only).
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data_transmission_handshake_get_payload(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field jpg_quality from data_transmission_handshake message
|
||||
*
|
||||
* @return [%] JPEG quality. Values: [1-100].
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data_transmission_handshake_get_jpg_quality(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data_transmission_handshake message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data_transmission_handshake C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data_transmission_handshake_decode(const mavlink_message_t* msg, mavlink_data_transmission_handshake_t* data_transmission_handshake)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
data_transmission_handshake->size = mavlink_msg_data_transmission_handshake_get_size(msg);
|
||||
data_transmission_handshake->width = mavlink_msg_data_transmission_handshake_get_width(msg);
|
||||
data_transmission_handshake->height = mavlink_msg_data_transmission_handshake_get_height(msg);
|
||||
data_transmission_handshake->packets = mavlink_msg_data_transmission_handshake_get_packets(msg);
|
||||
data_transmission_handshake->type = mavlink_msg_data_transmission_handshake_get_type(msg);
|
||||
data_transmission_handshake->payload = mavlink_msg_data_transmission_handshake_get_payload(msg);
|
||||
data_transmission_handshake->jpg_quality = mavlink_msg_data_transmission_handshake_get_jpg_quality(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN? msg->len : MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN;
|
||||
memset(data_transmission_handshake, 0, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
|
||||
memcpy(data_transmission_handshake, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
263
app/drivers/sertrf/protocol/mavlinkv2/common/mavlink_msg_debug.h
Normal file
263
app/drivers/sertrf/protocol/mavlinkv2/common/mavlink_msg_debug.h
Normal file
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE DEBUG PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG 254
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_debug_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
float value; /*< DEBUG value*/
|
||||
uint8_t ind; /*< index of debug variable*/
|
||||
}) mavlink_debug_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG_LEN 9
|
||||
#define MAVLINK_MSG_ID_DEBUG_MIN_LEN 9
|
||||
#define MAVLINK_MSG_ID_254_LEN 9
|
||||
#define MAVLINK_MSG_ID_254_MIN_LEN 9
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG_CRC 46
|
||||
#define MAVLINK_MSG_ID_254_CRC 46
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DEBUG { \
|
||||
254, \
|
||||
"DEBUG", \
|
||||
3, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \
|
||||
{ "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_debug_t, ind) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DEBUG { \
|
||||
"DEBUG", \
|
||||
3, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \
|
||||
{ "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_debug_t, ind) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a debug message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param ind index of debug variable
|
||||
* @param value DEBUG value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, uint8_t ind, float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_uint8_t(buf, 8, ind);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_LEN);
|
||||
#else
|
||||
mavlink_debug_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
packet.ind = ind;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a debug message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param ind index of debug variable
|
||||
* @param value DEBUG value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,uint8_t ind,float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_uint8_t(buf, 8, ind);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_LEN);
|
||||
#else
|
||||
mavlink_debug_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
packet.ind = ind;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a debug struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param debug C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_t* debug)
|
||||
{
|
||||
return mavlink_msg_debug_pack(system_id, component_id, msg, debug->time_boot_ms, debug->ind, debug->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a debug struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param debug C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_debug_t* debug)
|
||||
{
|
||||
return mavlink_msg_debug_pack_chan(system_id, component_id, chan, msg, debug->time_boot_ms, debug->ind, debug->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a debug message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param ind index of debug variable
|
||||
* @param value DEBUG value
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_debug_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t ind, float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_uint8_t(buf, 8, ind);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
#else
|
||||
mavlink_debug_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
packet.ind = ind;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a debug message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_debug_send_struct(mavlink_channel_t chan, const mavlink_debug_t* debug)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_debug_send(chan, debug->time_boot_ms, debug->ind, debug->value);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)debug, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DEBUG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_debug_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t ind, float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_uint8_t(buf, 8, ind);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
#else
|
||||
mavlink_debug_t *packet = (mavlink_debug_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->value = value;
|
||||
packet->ind = ind;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)packet, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DEBUG UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from debug message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_debug_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ind from debug message
|
||||
*
|
||||
* @return index of debug variable
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_debug_get_ind(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field value from debug message
|
||||
*
|
||||
* @return DEBUG value
|
||||
*/
|
||||
static inline float mavlink_msg_debug_get_value(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a debug message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param debug C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_debug_decode(const mavlink_message_t* msg, mavlink_debug_t* debug)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
debug->time_boot_ms = mavlink_msg_debug_get_time_boot_ms(msg);
|
||||
debug->value = mavlink_msg_debug_get_value(msg);
|
||||
debug->ind = mavlink_msg_debug_get_ind(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DEBUG_LEN? msg->len : MAVLINK_MSG_ID_DEBUG_LEN;
|
||||
memset(debug, 0, MAVLINK_MSG_ID_DEBUG_LEN);
|
||||
memcpy(debug, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,305 @@
|
||||
#pragma once
|
||||
// MESSAGE DEBUG_VECT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG_VECT 250
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_debug_vect_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float x; /*< x*/
|
||||
float y; /*< y*/
|
||||
float z; /*< z*/
|
||||
char name[10]; /*< Name*/
|
||||
}) mavlink_debug_vect_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG_VECT_LEN 30
|
||||
#define MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN 30
|
||||
#define MAVLINK_MSG_ID_250_LEN 30
|
||||
#define MAVLINK_MSG_ID_250_MIN_LEN 30
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG_VECT_CRC 49
|
||||
#define MAVLINK_MSG_ID_250_CRC 49
|
||||
|
||||
#define MAVLINK_MSG_DEBUG_VECT_FIELD_NAME_LEN 10
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \
|
||||
250, \
|
||||
"DEBUG_VECT", \
|
||||
5, \
|
||||
{ { "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \
|
||||
{ "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_debug_vect_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_debug_vect_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_debug_vect_t, z) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \
|
||||
"DEBUG_VECT", \
|
||||
5, \
|
||||
{ { "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \
|
||||
{ "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_debug_vect_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_debug_vect_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_debug_vect_t, z) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a debug_vect message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param name Name
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param x x
|
||||
* @param y y
|
||||
* @param z z
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
const char *name, uint64_t time_usec, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_char_array(buf, 20, name, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
|
||||
#else
|
||||
mavlink_debug_vect_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a debug_vect message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param name Name
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param x x
|
||||
* @param y y
|
||||
* @param z z
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
const char *name,uint64_t time_usec,float x,float y,float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_char_array(buf, 20, name, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
|
||||
#else
|
||||
mavlink_debug_vect_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a debug_vect struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param debug_vect C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_vect_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_vect_t* debug_vect)
|
||||
{
|
||||
return mavlink_msg_debug_vect_pack(system_id, component_id, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a debug_vect struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param debug_vect C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_vect_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_debug_vect_t* debug_vect)
|
||||
{
|
||||
return mavlink_msg_debug_vect_pack_chan(system_id, component_id, chan, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a debug_vect message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param name Name
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param x x
|
||||
* @param y y
|
||||
* @param z z
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_debug_vect_send(mavlink_channel_t chan, const char *name, uint64_t time_usec, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_char_array(buf, 20, name, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
#else
|
||||
mavlink_debug_vect_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a debug_vect message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_debug_vect_send_struct(mavlink_channel_t chan, const mavlink_debug_vect_t* debug_vect)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_debug_vect_send(chan, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)debug_vect, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DEBUG_VECT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_debug_vect_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const char *name, uint64_t time_usec, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_char_array(buf, 20, name, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
#else
|
||||
mavlink_debug_vect_t *packet = (mavlink_debug_vect_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
mav_array_memcpy(packet->name, name, sizeof(char)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)packet, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DEBUG_VECT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field name from debug_vect message
|
||||
*
|
||||
* @return Name
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_vect_get_name(const mavlink_message_t* msg, char *name)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, name, 10, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from debug_vect message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_debug_vect_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from debug_vect message
|
||||
*
|
||||
* @return x
|
||||
*/
|
||||
static inline float mavlink_msg_debug_vect_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from debug_vect message
|
||||
*
|
||||
* @return y
|
||||
*/
|
||||
static inline float mavlink_msg_debug_vect_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from debug_vect message
|
||||
*
|
||||
* @return z
|
||||
*/
|
||||
static inline float mavlink_msg_debug_vect_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a debug_vect message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param debug_vect C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_debug_vect_decode(const mavlink_message_t* msg, mavlink_debug_vect_t* debug_vect)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
debug_vect->time_usec = mavlink_msg_debug_vect_get_time_usec(msg);
|
||||
debug_vect->x = mavlink_msg_debug_vect_get_x(msg);
|
||||
debug_vect->y = mavlink_msg_debug_vect_get_y(msg);
|
||||
debug_vect->z = mavlink_msg_debug_vect_get_z(msg);
|
||||
mavlink_msg_debug_vect_get_name(msg, debug_vect->name);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DEBUG_VECT_LEN? msg->len : MAVLINK_MSG_ID_DEBUG_VECT_LEN;
|
||||
memset(debug_vect, 0, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
|
||||
memcpy(debug_vect, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,388 @@
|
||||
#pragma once
|
||||
// MESSAGE DISTANCE_SENSOR PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DISTANCE_SENSOR 132
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_distance_sensor_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
uint16_t min_distance; /*< [cm] Minimum distance the sensor can measure*/
|
||||
uint16_t max_distance; /*< [cm] Maximum distance the sensor can measure*/
|
||||
uint16_t current_distance; /*< [cm] Current distance reading*/
|
||||
uint8_t type; /*< Type of distance 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 covariance; /*< [cm] Measurement covariance, 0 for unknown / invalid readings*/
|
||||
}) mavlink_distance_sensor_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN 14
|
||||
#define MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN 14
|
||||
#define MAVLINK_MSG_ID_132_LEN 14
|
||||
#define MAVLINK_MSG_ID_132_MIN_LEN 14
|
||||
|
||||
#define MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC 85
|
||||
#define MAVLINK_MSG_ID_132_CRC 85
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \
|
||||
132, \
|
||||
"DISTANCE_SENSOR", \
|
||||
8, \
|
||||
{ { "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) }, \
|
||||
{ "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \
|
||||
{ "current_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_distance_sensor_t, current_distance) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_distance_sensor_t, type) }, \
|
||||
{ "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) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \
|
||||
"DISTANCE_SENSOR", \
|
||||
8, \
|
||||
{ { "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) }, \
|
||||
{ "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \
|
||||
{ "current_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_distance_sensor_t, current_distance) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_distance_sensor_t, type) }, \
|
||||
{ "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) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a distance_sensor message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param min_distance [cm] Minimum distance the sensor can measure
|
||||
* @param max_distance [cm] Maximum distance the sensor can measure
|
||||
* @param current_distance [cm] Current distance reading
|
||||
* @param type Type of distance 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 covariance [cm] Measurement covariance, 0 for unknown / invalid readings
|
||||
* @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,
|
||||
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)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint16_t(buf, 4, min_distance);
|
||||
_mav_put_uint16_t(buf, 6, max_distance);
|
||||
_mav_put_uint16_t(buf, 8, current_distance);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, id);
|
||||
_mav_put_uint8_t(buf, 12, orientation);
|
||||
_mav_put_uint8_t(buf, 13, covariance);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
|
||||
#else
|
||||
mavlink_distance_sensor_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.min_distance = min_distance;
|
||||
packet.max_distance = max_distance;
|
||||
packet.current_distance = current_distance;
|
||||
packet.type = type;
|
||||
packet.id = id;
|
||||
packet.orientation = orientation;
|
||||
packet.covariance = covariance;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a distance_sensor message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param min_distance [cm] Minimum distance the sensor can measure
|
||||
* @param max_distance [cm] Maximum distance the sensor can measure
|
||||
* @param current_distance [cm] Current distance reading
|
||||
* @param type Type of distance 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 covariance [cm] Measurement covariance, 0 for unknown / invalid readings
|
||||
* @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,
|
||||
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)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint16_t(buf, 4, min_distance);
|
||||
_mav_put_uint16_t(buf, 6, max_distance);
|
||||
_mav_put_uint16_t(buf, 8, current_distance);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, id);
|
||||
_mav_put_uint8_t(buf, 12, orientation);
|
||||
_mav_put_uint8_t(buf, 13, covariance);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
|
||||
#else
|
||||
mavlink_distance_sensor_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.min_distance = min_distance;
|
||||
packet.max_distance = max_distance;
|
||||
packet.current_distance = current_distance;
|
||||
packet.type = type;
|
||||
packet.id = id;
|
||||
packet.orientation = orientation;
|
||||
packet.covariance = covariance;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a distance_sensor struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param distance_sensor C-struct to read the message contents from
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a distance_sensor struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param distance_sensor C-struct to read the message contents from
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a distance_sensor message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param min_distance [cm] Minimum distance the sensor can measure
|
||||
* @param max_distance [cm] Maximum distance the sensor can measure
|
||||
* @param current_distance [cm] Current distance reading
|
||||
* @param type Type of distance 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 covariance [cm] Measurement covariance, 0 for unknown / invalid readings
|
||||
*/
|
||||
#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)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint16_t(buf, 4, min_distance);
|
||||
_mav_put_uint16_t(buf, 6, max_distance);
|
||||
_mav_put_uint16_t(buf, 8, current_distance);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, id);
|
||||
_mav_put_uint8_t(buf, 12, orientation);
|
||||
_mav_put_uint8_t(buf, 13, covariance);
|
||||
|
||||
_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
|
||||
mavlink_distance_sensor_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.min_distance = min_distance;
|
||||
packet.max_distance = max_distance;
|
||||
packet.current_distance = current_distance;
|
||||
packet.type = type;
|
||||
packet.id = id;
|
||||
packet.orientation = orientation;
|
||||
packet.covariance = covariance;
|
||||
|
||||
_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
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a distance_sensor message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
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
|
||||
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);
|
||||
#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);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
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)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint16_t(buf, 4, min_distance);
|
||||
_mav_put_uint16_t(buf, 6, max_distance);
|
||||
_mav_put_uint16_t(buf, 8, current_distance);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, id);
|
||||
_mav_put_uint8_t(buf, 12, orientation);
|
||||
_mav_put_uint8_t(buf, 13, covariance);
|
||||
|
||||
_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
|
||||
mavlink_distance_sensor_t *packet = (mavlink_distance_sensor_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->min_distance = min_distance;
|
||||
packet->max_distance = max_distance;
|
||||
packet->current_distance = current_distance;
|
||||
packet->type = type;
|
||||
packet->id = id;
|
||||
packet->orientation = orientation;
|
||||
packet->covariance = covariance;
|
||||
|
||||
_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
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DISTANCE_SENSOR UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from distance_sensor message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_distance_sensor_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field min_distance from distance_sensor message
|
||||
*
|
||||
* @return [cm] Minimum distance the sensor can measure
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_distance_sensor_get_min_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field max_distance from distance_sensor message
|
||||
*
|
||||
* @return [cm] Maximum distance the sensor can measure
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_distance_sensor_get_max_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current_distance from distance_sensor message
|
||||
*
|
||||
* @return [cm] Current distance reading
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_distance_sensor_get_current_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field type from distance_sensor message
|
||||
*
|
||||
* @return Type of distance sensor.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_distance_sensor_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field id from distance_sensor message
|
||||
*
|
||||
* @return Onboard ID of the sensor
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_distance_sensor_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field orientation from distance_sensor message
|
||||
*
|
||||
* @return 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
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_distance_sensor_get_orientation(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field covariance from distance_sensor message
|
||||
*
|
||||
* @return [cm] Measurement covariance, 0 for unknown / invalid readings
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_distance_sensor_get_covariance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 13);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a distance_sensor message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param distance_sensor C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_distance_sensor_decode(const mavlink_message_t* msg, mavlink_distance_sensor_t* distance_sensor)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
distance_sensor->time_boot_ms = mavlink_msg_distance_sensor_get_time_boot_ms(msg);
|
||||
distance_sensor->min_distance = mavlink_msg_distance_sensor_get_min_distance(msg);
|
||||
distance_sensor->max_distance = mavlink_msg_distance_sensor_get_max_distance(msg);
|
||||
distance_sensor->current_distance = mavlink_msg_distance_sensor_get_current_distance(msg);
|
||||
distance_sensor->type = mavlink_msg_distance_sensor_get_type(msg);
|
||||
distance_sensor->id = mavlink_msg_distance_sensor_get_id(msg);
|
||||
distance_sensor->orientation = mavlink_msg_distance_sensor_get_orientation(msg);
|
||||
distance_sensor->covariance = mavlink_msg_distance_sensor_get_covariance(msg);
|
||||
#else
|
||||
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);
|
||||
memcpy(distance_sensor, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
#pragma once
|
||||
// MESSAGE ENCAPSULATED_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA 131
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_encapsulated_data_t {
|
||||
uint16_t seqnr; /*< sequence number (starting with 0 on every transmission)*/
|
||||
uint8_t data[253]; /*< image data bytes*/
|
||||
}) mavlink_encapsulated_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN 255
|
||||
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN 255
|
||||
#define MAVLINK_MSG_ID_131_LEN 255
|
||||
#define MAVLINK_MSG_ID_131_MIN_LEN 255
|
||||
|
||||
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC 223
|
||||
#define MAVLINK_MSG_ID_131_CRC 223
|
||||
|
||||
#define MAVLINK_MSG_ENCAPSULATED_DATA_FIELD_DATA_LEN 253
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA { \
|
||||
131, \
|
||||
"ENCAPSULATED_DATA", \
|
||||
2, \
|
||||
{ { "seqnr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_encapsulated_data_t, seqnr) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 253, 2, offsetof(mavlink_encapsulated_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA { \
|
||||
"ENCAPSULATED_DATA", \
|
||||
2, \
|
||||
{ { "seqnr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_encapsulated_data_t, seqnr) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 253, 2, offsetof(mavlink_encapsulated_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a encapsulated_data message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param seqnr sequence number (starting with 0 on every transmission)
|
||||
* @param data image data bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t seqnr, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seqnr);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 253);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
|
||||
#else
|
||||
mavlink_encapsulated_data_t packet;
|
||||
packet.seqnr = seqnr;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a encapsulated_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param seqnr sequence number (starting with 0 on every transmission)
|
||||
* @param data image data bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t seqnr,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seqnr);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 253);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
|
||||
#else
|
||||
mavlink_encapsulated_data_t packet;
|
||||
packet.seqnr = seqnr;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a encapsulated_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param encapsulated_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_encapsulated_data_t* encapsulated_data)
|
||||
{
|
||||
return mavlink_msg_encapsulated_data_pack(system_id, component_id, msg, encapsulated_data->seqnr, encapsulated_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a encapsulated_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param encapsulated_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_encapsulated_data_t* encapsulated_data)
|
||||
{
|
||||
return mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, chan, msg, encapsulated_data->seqnr, encapsulated_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a encapsulated_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param seqnr sequence number (starting with 0 on every transmission)
|
||||
* @param data image data bytes
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_encapsulated_data_send(mavlink_channel_t chan, uint16_t seqnr, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seqnr);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 253);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
#else
|
||||
mavlink_encapsulated_data_t packet;
|
||||
packet.seqnr = seqnr;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)&packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a encapsulated_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_encapsulated_data_send_struct(mavlink_channel_t chan, const mavlink_encapsulated_data_t* encapsulated_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_encapsulated_data_send(chan, encapsulated_data->seqnr, encapsulated_data->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)encapsulated_data, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_encapsulated_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t seqnr, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, seqnr);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 253);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
#else
|
||||
mavlink_encapsulated_data_t *packet = (mavlink_encapsulated_data_t *)msgbuf;
|
||||
packet->seqnr = seqnr;
|
||||
mav_array_memcpy(packet->data, data, sizeof(uint8_t)*253);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ENCAPSULATED_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field seqnr from encapsulated_data message
|
||||
*
|
||||
* @return sequence number (starting with 0 on every transmission)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_get_seqnr(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from encapsulated_data message
|
||||
*
|
||||
* @return image data bytes
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 253, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a encapsulated_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param encapsulated_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_encapsulated_data_decode(const mavlink_message_t* msg, mavlink_encapsulated_data_t* encapsulated_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
encapsulated_data->seqnr = mavlink_msg_encapsulated_data_get_seqnr(msg);
|
||||
mavlink_msg_encapsulated_data_get_data(msg, encapsulated_data->data);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN? msg->len : MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN;
|
||||
memset(encapsulated_data, 0, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
|
||||
memcpy(encapsulated_data, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,438 @@
|
||||
#pragma once
|
||||
// MESSAGE ESTIMATOR_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ESTIMATOR_STATUS 230
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_estimator_status_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float vel_ratio; /*< Velocity innovation test ratio*/
|
||||
float pos_horiz_ratio; /*< Horizontal position innovation test ratio*/
|
||||
float pos_vert_ratio; /*< Vertical position innovation test ratio*/
|
||||
float mag_ratio; /*< Magnetometer innovation test ratio*/
|
||||
float hagl_ratio; /*< Height above terrain innovation test ratio*/
|
||||
float tas_ratio; /*< True airspeed innovation test ratio*/
|
||||
float pos_horiz_accuracy; /*< [m] Horizontal position 1-STD accuracy relative to the EKF local origin*/
|
||||
float pos_vert_accuracy; /*< [m] Vertical position 1-STD accuracy relative to the EKF local origin*/
|
||||
uint16_t flags; /*< Bitmap indicating which EKF outputs are valid.*/
|
||||
}) mavlink_estimator_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN 42
|
||||
#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN 42
|
||||
#define MAVLINK_MSG_ID_230_LEN 42
|
||||
#define MAVLINK_MSG_ID_230_MIN_LEN 42
|
||||
|
||||
#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC 163
|
||||
#define MAVLINK_MSG_ID_230_CRC 163
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS { \
|
||||
230, \
|
||||
"ESTIMATOR_STATUS", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \
|
||||
{ "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \
|
||||
{ "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \
|
||||
{ "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \
|
||||
{ "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) }, \
|
||||
{ "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) }, \
|
||||
{ "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \
|
||||
{ "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \
|
||||
{ "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS { \
|
||||
"ESTIMATOR_STATUS", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \
|
||||
{ "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \
|
||||
{ "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \
|
||||
{ "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \
|
||||
{ "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) }, \
|
||||
{ "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) }, \
|
||||
{ "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \
|
||||
{ "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \
|
||||
{ "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a estimator_status message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param flags Bitmap indicating which EKF outputs are valid.
|
||||
* @param vel_ratio Velocity innovation test ratio
|
||||
* @param pos_horiz_ratio Horizontal position innovation test ratio
|
||||
* @param pos_vert_ratio Vertical position innovation test ratio
|
||||
* @param mag_ratio Magnetometer innovation test ratio
|
||||
* @param hagl_ratio Height above terrain innovation test ratio
|
||||
* @param tas_ratio True airspeed innovation test ratio
|
||||
* @param pos_horiz_accuracy [m] Horizontal position 1-STD accuracy relative to the EKF local origin
|
||||
* @param pos_vert_accuracy [m] Vertical position 1-STD accuracy relative to the EKF local origin
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_estimator_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, vel_ratio);
|
||||
_mav_put_float(buf, 12, pos_horiz_ratio);
|
||||
_mav_put_float(buf, 16, pos_vert_ratio);
|
||||
_mav_put_float(buf, 20, mag_ratio);
|
||||
_mav_put_float(buf, 24, hagl_ratio);
|
||||
_mav_put_float(buf, 28, tas_ratio);
|
||||
_mav_put_float(buf, 32, pos_horiz_accuracy);
|
||||
_mav_put_float(buf, 36, pos_vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 40, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
||||
#else
|
||||
mavlink_estimator_status_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.vel_ratio = vel_ratio;
|
||||
packet.pos_horiz_ratio = pos_horiz_ratio;
|
||||
packet.pos_vert_ratio = pos_vert_ratio;
|
||||
packet.mag_ratio = mag_ratio;
|
||||
packet.hagl_ratio = hagl_ratio;
|
||||
packet.tas_ratio = tas_ratio;
|
||||
packet.pos_horiz_accuracy = pos_horiz_accuracy;
|
||||
packet.pos_vert_accuracy = pos_vert_accuracy;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a estimator_status message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param flags Bitmap indicating which EKF outputs are valid.
|
||||
* @param vel_ratio Velocity innovation test ratio
|
||||
* @param pos_horiz_ratio Horizontal position innovation test ratio
|
||||
* @param pos_vert_ratio Vertical position innovation test ratio
|
||||
* @param mag_ratio Magnetometer innovation test ratio
|
||||
* @param hagl_ratio Height above terrain innovation test ratio
|
||||
* @param tas_ratio True airspeed innovation test ratio
|
||||
* @param pos_horiz_accuracy [m] Horizontal position 1-STD accuracy relative to the EKF local origin
|
||||
* @param pos_vert_accuracy [m] Vertical position 1-STD accuracy relative to the EKF local origin
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_estimator_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint16_t flags,float vel_ratio,float pos_horiz_ratio,float pos_vert_ratio,float mag_ratio,float hagl_ratio,float tas_ratio,float pos_horiz_accuracy,float pos_vert_accuracy)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, vel_ratio);
|
||||
_mav_put_float(buf, 12, pos_horiz_ratio);
|
||||
_mav_put_float(buf, 16, pos_vert_ratio);
|
||||
_mav_put_float(buf, 20, mag_ratio);
|
||||
_mav_put_float(buf, 24, hagl_ratio);
|
||||
_mav_put_float(buf, 28, tas_ratio);
|
||||
_mav_put_float(buf, 32, pos_horiz_accuracy);
|
||||
_mav_put_float(buf, 36, pos_vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 40, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
||||
#else
|
||||
mavlink_estimator_status_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.vel_ratio = vel_ratio;
|
||||
packet.pos_horiz_ratio = pos_horiz_ratio;
|
||||
packet.pos_vert_ratio = pos_vert_ratio;
|
||||
packet.mag_ratio = mag_ratio;
|
||||
packet.hagl_ratio = hagl_ratio;
|
||||
packet.tas_ratio = tas_ratio;
|
||||
packet.pos_horiz_accuracy = pos_horiz_accuracy;
|
||||
packet.pos_vert_accuracy = pos_vert_accuracy;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a estimator_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param estimator_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_estimator_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status)
|
||||
{
|
||||
return mavlink_msg_estimator_status_pack(system_id, component_id, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a estimator_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param estimator_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_estimator_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status)
|
||||
{
|
||||
return mavlink_msg_estimator_status_pack_chan(system_id, component_id, chan, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a estimator_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param flags Bitmap indicating which EKF outputs are valid.
|
||||
* @param vel_ratio Velocity innovation test ratio
|
||||
* @param pos_horiz_ratio Horizontal position innovation test ratio
|
||||
* @param pos_vert_ratio Vertical position innovation test ratio
|
||||
* @param mag_ratio Magnetometer innovation test ratio
|
||||
* @param hagl_ratio Height above terrain innovation test ratio
|
||||
* @param tas_ratio True airspeed innovation test ratio
|
||||
* @param pos_horiz_accuracy [m] Horizontal position 1-STD accuracy relative to the EKF local origin
|
||||
* @param pos_vert_accuracy [m] Vertical position 1-STD accuracy relative to the EKF local origin
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_estimator_status_send(mavlink_channel_t chan, uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, vel_ratio);
|
||||
_mav_put_float(buf, 12, pos_horiz_ratio);
|
||||
_mav_put_float(buf, 16, pos_vert_ratio);
|
||||
_mav_put_float(buf, 20, mag_ratio);
|
||||
_mav_put_float(buf, 24, hagl_ratio);
|
||||
_mav_put_float(buf, 28, tas_ratio);
|
||||
_mav_put_float(buf, 32, pos_horiz_accuracy);
|
||||
_mav_put_float(buf, 36, pos_vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 40, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
#else
|
||||
mavlink_estimator_status_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.vel_ratio = vel_ratio;
|
||||
packet.pos_horiz_ratio = pos_horiz_ratio;
|
||||
packet.pos_vert_ratio = pos_vert_ratio;
|
||||
packet.mag_ratio = mag_ratio;
|
||||
packet.hagl_ratio = hagl_ratio;
|
||||
packet.tas_ratio = tas_ratio;
|
||||
packet.pos_horiz_accuracy = pos_horiz_accuracy;
|
||||
packet.pos_vert_accuracy = pos_vert_accuracy;
|
||||
packet.flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a estimator_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_estimator_status_send_struct(mavlink_channel_t chan, const mavlink_estimator_status_t* estimator_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_estimator_status_send(chan, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)estimator_status, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_estimator_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, vel_ratio);
|
||||
_mav_put_float(buf, 12, pos_horiz_ratio);
|
||||
_mav_put_float(buf, 16, pos_vert_ratio);
|
||||
_mav_put_float(buf, 20, mag_ratio);
|
||||
_mav_put_float(buf, 24, hagl_ratio);
|
||||
_mav_put_float(buf, 28, tas_ratio);
|
||||
_mav_put_float(buf, 32, pos_horiz_accuracy);
|
||||
_mav_put_float(buf, 36, pos_vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 40, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
#else
|
||||
mavlink_estimator_status_t *packet = (mavlink_estimator_status_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->vel_ratio = vel_ratio;
|
||||
packet->pos_horiz_ratio = pos_horiz_ratio;
|
||||
packet->pos_vert_ratio = pos_vert_ratio;
|
||||
packet->mag_ratio = mag_ratio;
|
||||
packet->hagl_ratio = hagl_ratio;
|
||||
packet->tas_ratio = tas_ratio;
|
||||
packet->pos_horiz_accuracy = pos_horiz_accuracy;
|
||||
packet->pos_vert_accuracy = pos_vert_accuracy;
|
||||
packet->flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ESTIMATOR_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from estimator_status message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_estimator_status_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from estimator_status message
|
||||
*
|
||||
* @return Bitmap indicating which EKF outputs are valid.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_estimator_status_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel_ratio from estimator_status message
|
||||
*
|
||||
* @return Velocity innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_vel_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_horiz_ratio from estimator_status message
|
||||
*
|
||||
* @return Horizontal position innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_pos_horiz_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_vert_ratio from estimator_status message
|
||||
*
|
||||
* @return Vertical position innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_pos_vert_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mag_ratio from estimator_status message
|
||||
*
|
||||
* @return Magnetometer innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_mag_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field hagl_ratio from estimator_status message
|
||||
*
|
||||
* @return Height above terrain innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_hagl_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field tas_ratio from estimator_status message
|
||||
*
|
||||
* @return True airspeed innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_tas_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_horiz_accuracy from estimator_status message
|
||||
*
|
||||
* @return [m] Horizontal position 1-STD accuracy relative to the EKF local origin
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_pos_horiz_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_vert_accuracy from estimator_status message
|
||||
*
|
||||
* @return [m] Vertical position 1-STD accuracy relative to the EKF local origin
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_pos_vert_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a estimator_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param estimator_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_estimator_status_decode(const mavlink_message_t* msg, mavlink_estimator_status_t* estimator_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
estimator_status->time_usec = mavlink_msg_estimator_status_get_time_usec(msg);
|
||||
estimator_status->vel_ratio = mavlink_msg_estimator_status_get_vel_ratio(msg);
|
||||
estimator_status->pos_horiz_ratio = mavlink_msg_estimator_status_get_pos_horiz_ratio(msg);
|
||||
estimator_status->pos_vert_ratio = mavlink_msg_estimator_status_get_pos_vert_ratio(msg);
|
||||
estimator_status->mag_ratio = mavlink_msg_estimator_status_get_mag_ratio(msg);
|
||||
estimator_status->hagl_ratio = mavlink_msg_estimator_status_get_hagl_ratio(msg);
|
||||
estimator_status->tas_ratio = mavlink_msg_estimator_status_get_tas_ratio(msg);
|
||||
estimator_status->pos_horiz_accuracy = mavlink_msg_estimator_status_get_pos_horiz_accuracy(msg);
|
||||
estimator_status->pos_vert_accuracy = mavlink_msg_estimator_status_get_pos_vert_accuracy(msg);
|
||||
estimator_status->flags = mavlink_msg_estimator_status_get_flags(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN? msg->len : MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN;
|
||||
memset(estimator_status, 0, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
||||
memcpy(estimator_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
#pragma once
|
||||
// MESSAGE EXTENDED_SYS_STATE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE 245
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_extended_sys_state_t {
|
||||
uint8_t vtol_state; /*< The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.*/
|
||||
uint8_t landed_state; /*< The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.*/
|
||||
}) mavlink_extended_sys_state_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN 2
|
||||
#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN 2
|
||||
#define MAVLINK_MSG_ID_245_LEN 2
|
||||
#define MAVLINK_MSG_ID_245_MIN_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC 130
|
||||
#define MAVLINK_MSG_ID_245_CRC 130
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE { \
|
||||
245, \
|
||||
"EXTENDED_SYS_STATE", \
|
||||
2, \
|
||||
{ { "vtol_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_extended_sys_state_t, vtol_state) }, \
|
||||
{ "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_extended_sys_state_t, landed_state) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE { \
|
||||
"EXTENDED_SYS_STATE", \
|
||||
2, \
|
||||
{ { "vtol_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_extended_sys_state_t, vtol_state) }, \
|
||||
{ "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_extended_sys_state_t, landed_state) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a extended_sys_state message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
|
||||
* @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_extended_sys_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t vtol_state, uint8_t landed_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, vtol_state);
|
||||
_mav_put_uint8_t(buf, 1, landed_state);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
|
||||
#else
|
||||
mavlink_extended_sys_state_t packet;
|
||||
packet.vtol_state = vtol_state;
|
||||
packet.landed_state = landed_state;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a extended_sys_state message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
|
||||
* @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_extended_sys_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t vtol_state,uint8_t landed_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, vtol_state);
|
||||
_mav_put_uint8_t(buf, 1, landed_state);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
|
||||
#else
|
||||
mavlink_extended_sys_state_t packet;
|
||||
packet.vtol_state = vtol_state;
|
||||
packet.landed_state = landed_state;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a extended_sys_state struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param extended_sys_state C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_extended_sys_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_extended_sys_state_t* extended_sys_state)
|
||||
{
|
||||
return mavlink_msg_extended_sys_state_pack(system_id, component_id, msg, extended_sys_state->vtol_state, extended_sys_state->landed_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a extended_sys_state struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param extended_sys_state C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_extended_sys_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_extended_sys_state_t* extended_sys_state)
|
||||
{
|
||||
return mavlink_msg_extended_sys_state_pack_chan(system_id, component_id, chan, msg, extended_sys_state->vtol_state, extended_sys_state->landed_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a extended_sys_state message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
|
||||
* @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_extended_sys_state_send(mavlink_channel_t chan, uint8_t vtol_state, uint8_t landed_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, vtol_state);
|
||||
_mav_put_uint8_t(buf, 1, landed_state);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
#else
|
||||
mavlink_extended_sys_state_t packet;
|
||||
packet.vtol_state = vtol_state;
|
||||
packet.landed_state = landed_state;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)&packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a extended_sys_state message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_extended_sys_state_send_struct(mavlink_channel_t chan, const mavlink_extended_sys_state_t* extended_sys_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_extended_sys_state_send(chan, extended_sys_state->vtol_state, extended_sys_state->landed_state);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)extended_sys_state, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_extended_sys_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t vtol_state, uint8_t landed_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, vtol_state);
|
||||
_mav_put_uint8_t(buf, 1, landed_state);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
#else
|
||||
mavlink_extended_sys_state_t *packet = (mavlink_extended_sys_state_t *)msgbuf;
|
||||
packet->vtol_state = vtol_state;
|
||||
packet->landed_state = landed_state;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE EXTENDED_SYS_STATE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field vtol_state from extended_sys_state message
|
||||
*
|
||||
* @return The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_extended_sys_state_get_vtol_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field landed_state from extended_sys_state message
|
||||
*
|
||||
* @return The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_extended_sys_state_get_landed_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a extended_sys_state message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param extended_sys_state C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_extended_sys_state_decode(const mavlink_message_t* msg, mavlink_extended_sys_state_t* extended_sys_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
extended_sys_state->vtol_state = mavlink_msg_extended_sys_state_get_vtol_state(msg);
|
||||
extended_sys_state->landed_state = mavlink_msg_extended_sys_state_get_landed_state(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN? msg->len : MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN;
|
||||
memset(extended_sys_state, 0, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
|
||||
memcpy(extended_sys_state, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
#pragma once
|
||||
// MESSAGE FILE_TRANSFER_PROTOCOL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL 110
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_file_transfer_protocol_t {
|
||||
uint8_t target_network; /*< Network ID (0 for broadcast)*/
|
||||
uint8_t target_system; /*< System ID (0 for broadcast)*/
|
||||
uint8_t target_component; /*< Component ID (0 for broadcast)*/
|
||||
uint8_t payload[251]; /*< Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.*/
|
||||
}) mavlink_file_transfer_protocol_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN 254
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN 254
|
||||
#define MAVLINK_MSG_ID_110_LEN 254
|
||||
#define MAVLINK_MSG_ID_110_MIN_LEN 254
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC 84
|
||||
#define MAVLINK_MSG_ID_110_CRC 84
|
||||
|
||||
#define MAVLINK_MSG_FILE_TRANSFER_PROTOCOL_FIELD_PAYLOAD_LEN 251
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL { \
|
||||
110, \
|
||||
"FILE_TRANSFER_PROTOCOL", \
|
||||
4, \
|
||||
{ { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_file_transfer_protocol_t, target_network) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_file_transfer_protocol_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_file_transfer_protocol_t, target_component) }, \
|
||||
{ "payload", NULL, MAVLINK_TYPE_UINT8_T, 251, 3, offsetof(mavlink_file_transfer_protocol_t, payload) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL { \
|
||||
"FILE_TRANSFER_PROTOCOL", \
|
||||
4, \
|
||||
{ { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_file_transfer_protocol_t, target_network) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_file_transfer_protocol_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_file_transfer_protocol_t, target_component) }, \
|
||||
{ "payload", NULL, MAVLINK_TYPE_UINT8_T, 251, 3, offsetof(mavlink_file_transfer_protocol_t, payload) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a file_transfer_protocol message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_network Network ID (0 for broadcast)
|
||||
* @param target_system System ID (0 for broadcast)
|
||||
* @param target_component Component ID (0 for broadcast)
|
||||
* @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_protocol_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_network);
|
||||
_mav_put_uint8_t(buf, 1, target_system);
|
||||
_mav_put_uint8_t(buf, 2, target_component);
|
||||
_mav_put_uint8_t_array(buf, 3, payload, 251);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
|
||||
#else
|
||||
mavlink_file_transfer_protocol_t packet;
|
||||
packet.target_network = target_network;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a file_transfer_protocol message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_network Network ID (0 for broadcast)
|
||||
* @param target_system System ID (0 for broadcast)
|
||||
* @param target_component Component ID (0 for broadcast)
|
||||
* @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_protocol_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_network,uint8_t target_system,uint8_t target_component,const uint8_t *payload)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_network);
|
||||
_mav_put_uint8_t(buf, 1, target_system);
|
||||
_mav_put_uint8_t(buf, 2, target_component);
|
||||
_mav_put_uint8_t_array(buf, 3, payload, 251);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
|
||||
#else
|
||||
mavlink_file_transfer_protocol_t packet;
|
||||
packet.target_network = target_network;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a file_transfer_protocol struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param file_transfer_protocol C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_protocol_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_file_transfer_protocol_t* file_transfer_protocol)
|
||||
{
|
||||
return mavlink_msg_file_transfer_protocol_pack(system_id, component_id, msg, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a file_transfer_protocol struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param file_transfer_protocol C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_protocol_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_file_transfer_protocol_t* file_transfer_protocol)
|
||||
{
|
||||
return mavlink_msg_file_transfer_protocol_pack_chan(system_id, component_id, chan, msg, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a file_transfer_protocol message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_network Network ID (0 for broadcast)
|
||||
* @param target_system System ID (0 for broadcast)
|
||||
* @param target_component Component ID (0 for broadcast)
|
||||
* @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_file_transfer_protocol_send(mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_network);
|
||||
_mav_put_uint8_t(buf, 1, target_system);
|
||||
_mav_put_uint8_t(buf, 2, target_component);
|
||||
_mav_put_uint8_t_array(buf, 3, payload, 251);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
#else
|
||||
mavlink_file_transfer_protocol_t packet;
|
||||
packet.target_network = target_network;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a file_transfer_protocol message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_file_transfer_protocol_send_struct(mavlink_channel_t chan, const mavlink_file_transfer_protocol_t* file_transfer_protocol)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_file_transfer_protocol_send(chan, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)file_transfer_protocol, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_file_transfer_protocol_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_network);
|
||||
_mav_put_uint8_t(buf, 1, target_system);
|
||||
_mav_put_uint8_t(buf, 2, target_component);
|
||||
_mav_put_uint8_t_array(buf, 3, payload, 251);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
#else
|
||||
mavlink_file_transfer_protocol_t *packet = (mavlink_file_transfer_protocol_t *)msgbuf;
|
||||
packet->target_network = target_network;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
mav_array_memcpy(packet->payload, payload, sizeof(uint8_t)*251);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE FILE_TRANSFER_PROTOCOL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_network from file_transfer_protocol message
|
||||
*
|
||||
* @return Network ID (0 for broadcast)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_network(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from file_transfer_protocol message
|
||||
*
|
||||
* @return System ID (0 for broadcast)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from file_transfer_protocol message
|
||||
*
|
||||
* @return Component ID (0 for broadcast)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field payload from file_transfer_protocol message
|
||||
*
|
||||
* @return Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_protocol_get_payload(const mavlink_message_t* msg, uint8_t *payload)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, payload, 251, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a file_transfer_protocol message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param file_transfer_protocol C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_file_transfer_protocol_decode(const mavlink_message_t* msg, mavlink_file_transfer_protocol_t* file_transfer_protocol)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
file_transfer_protocol->target_network = mavlink_msg_file_transfer_protocol_get_target_network(msg);
|
||||
file_transfer_protocol->target_system = mavlink_msg_file_transfer_protocol_get_target_system(msg);
|
||||
file_transfer_protocol->target_component = mavlink_msg_file_transfer_protocol_get_target_component(msg);
|
||||
mavlink_msg_file_transfer_protocol_get_payload(msg, file_transfer_protocol->payload);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN? msg->len : MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN;
|
||||
memset(file_transfer_protocol, 0, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
|
||||
memcpy(file_transfer_protocol, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
#pragma once
|
||||
// MESSAGE FLIGHT_INFORMATION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_FLIGHT_INFORMATION 264
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_flight_information_t {
|
||||
uint64_t arming_time_utc; /*< [us] Timestamp at arming (time since UNIX epoch) in UTC, 0 for unknown*/
|
||||
uint64_t takeoff_time_utc; /*< [us] Timestamp at takeoff (time since UNIX epoch) in UTC, 0 for unknown*/
|
||||
uint64_t flight_uuid; /*< Universally unique identifier (UUID) of flight, should correspond to name of log files*/
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
}) mavlink_flight_information_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN 28
|
||||
#define MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN 28
|
||||
#define MAVLINK_MSG_ID_264_LEN 28
|
||||
#define MAVLINK_MSG_ID_264_MIN_LEN 28
|
||||
|
||||
#define MAVLINK_MSG_ID_FLIGHT_INFORMATION_CRC 49
|
||||
#define MAVLINK_MSG_ID_264_CRC 49
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_FLIGHT_INFORMATION { \
|
||||
264, \
|
||||
"FLIGHT_INFORMATION", \
|
||||
4, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_flight_information_t, time_boot_ms) }, \
|
||||
{ "arming_time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_flight_information_t, arming_time_utc) }, \
|
||||
{ "takeoff_time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_flight_information_t, takeoff_time_utc) }, \
|
||||
{ "flight_uuid", NULL, MAVLINK_TYPE_UINT64_T, 0, 16, offsetof(mavlink_flight_information_t, flight_uuid) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_FLIGHT_INFORMATION { \
|
||||
"FLIGHT_INFORMATION", \
|
||||
4, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_flight_information_t, time_boot_ms) }, \
|
||||
{ "arming_time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_flight_information_t, arming_time_utc) }, \
|
||||
{ "takeoff_time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_flight_information_t, takeoff_time_utc) }, \
|
||||
{ "flight_uuid", NULL, MAVLINK_TYPE_UINT64_T, 0, 16, offsetof(mavlink_flight_information_t, flight_uuid) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a flight_information message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param arming_time_utc [us] Timestamp at arming (time since UNIX epoch) in UTC, 0 for unknown
|
||||
* @param takeoff_time_utc [us] Timestamp at takeoff (time since UNIX epoch) in UTC, 0 for unknown
|
||||
* @param flight_uuid Universally unique identifier (UUID) of flight, should correspond to name of log files
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_flight_information_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, uint64_t arming_time_utc, uint64_t takeoff_time_utc, uint64_t flight_uuid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, arming_time_utc);
|
||||
_mav_put_uint64_t(buf, 8, takeoff_time_utc);
|
||||
_mav_put_uint64_t(buf, 16, flight_uuid);
|
||||
_mav_put_uint32_t(buf, 24, time_boot_ms);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN);
|
||||
#else
|
||||
mavlink_flight_information_t packet;
|
||||
packet.arming_time_utc = arming_time_utc;
|
||||
packet.takeoff_time_utc = takeoff_time_utc;
|
||||
packet.flight_uuid = flight_uuid;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FLIGHT_INFORMATION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a flight_information message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param arming_time_utc [us] Timestamp at arming (time since UNIX epoch) in UTC, 0 for unknown
|
||||
* @param takeoff_time_utc [us] Timestamp at takeoff (time since UNIX epoch) in UTC, 0 for unknown
|
||||
* @param flight_uuid Universally unique identifier (UUID) of flight, should correspond to name of log files
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_flight_information_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,uint64_t arming_time_utc,uint64_t takeoff_time_utc,uint64_t flight_uuid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, arming_time_utc);
|
||||
_mav_put_uint64_t(buf, 8, takeoff_time_utc);
|
||||
_mav_put_uint64_t(buf, 16, flight_uuid);
|
||||
_mav_put_uint32_t(buf, 24, time_boot_ms);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN);
|
||||
#else
|
||||
mavlink_flight_information_t packet;
|
||||
packet.arming_time_utc = arming_time_utc;
|
||||
packet.takeoff_time_utc = takeoff_time_utc;
|
||||
packet.flight_uuid = flight_uuid;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FLIGHT_INFORMATION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a flight_information struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param flight_information C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_flight_information_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flight_information_t* flight_information)
|
||||
{
|
||||
return mavlink_msg_flight_information_pack(system_id, component_id, msg, flight_information->time_boot_ms, flight_information->arming_time_utc, flight_information->takeoff_time_utc, flight_information->flight_uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a flight_information struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param flight_information C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_flight_information_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_flight_information_t* flight_information)
|
||||
{
|
||||
return mavlink_msg_flight_information_pack_chan(system_id, component_id, chan, msg, flight_information->time_boot_ms, flight_information->arming_time_utc, flight_information->takeoff_time_utc, flight_information->flight_uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a flight_information message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param arming_time_utc [us] Timestamp at arming (time since UNIX epoch) in UTC, 0 for unknown
|
||||
* @param takeoff_time_utc [us] Timestamp at takeoff (time since UNIX epoch) in UTC, 0 for unknown
|
||||
* @param flight_uuid Universally unique identifier (UUID) of flight, should correspond to name of log files
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_flight_information_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t arming_time_utc, uint64_t takeoff_time_utc, uint64_t flight_uuid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, arming_time_utc);
|
||||
_mav_put_uint64_t(buf, 8, takeoff_time_utc);
|
||||
_mav_put_uint64_t(buf, 16, flight_uuid);
|
||||
_mav_put_uint32_t(buf, 24, time_boot_ms);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLIGHT_INFORMATION, buf, MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_CRC);
|
||||
#else
|
||||
mavlink_flight_information_t packet;
|
||||
packet.arming_time_utc = arming_time_utc;
|
||||
packet.takeoff_time_utc = takeoff_time_utc;
|
||||
packet.flight_uuid = flight_uuid;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLIGHT_INFORMATION, (const char *)&packet, MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a flight_information message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_flight_information_send_struct(mavlink_channel_t chan, const mavlink_flight_information_t* flight_information)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_flight_information_send(chan, flight_information->time_boot_ms, flight_information->arming_time_utc, flight_information->takeoff_time_utc, flight_information->flight_uuid);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLIGHT_INFORMATION, (const char *)flight_information, MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_flight_information_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t arming_time_utc, uint64_t takeoff_time_utc, uint64_t flight_uuid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, arming_time_utc);
|
||||
_mav_put_uint64_t(buf, 8, takeoff_time_utc);
|
||||
_mav_put_uint64_t(buf, 16, flight_uuid);
|
||||
_mav_put_uint32_t(buf, 24, time_boot_ms);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLIGHT_INFORMATION, buf, MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_CRC);
|
||||
#else
|
||||
mavlink_flight_information_t *packet = (mavlink_flight_information_t *)msgbuf;
|
||||
packet->arming_time_utc = arming_time_utc;
|
||||
packet->takeoff_time_utc = takeoff_time_utc;
|
||||
packet->flight_uuid = flight_uuid;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLIGHT_INFORMATION, (const char *)packet, MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN, MAVLINK_MSG_ID_FLIGHT_INFORMATION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE FLIGHT_INFORMATION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from flight_information message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_flight_information_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field arming_time_utc from flight_information message
|
||||
*
|
||||
* @return [us] Timestamp at arming (time since UNIX epoch) in UTC, 0 for unknown
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_flight_information_get_arming_time_utc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field takeoff_time_utc from flight_information message
|
||||
*
|
||||
* @return [us] Timestamp at takeoff (time since UNIX epoch) in UTC, 0 for unknown
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_flight_information_get_takeoff_time_utc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flight_uuid from flight_information message
|
||||
*
|
||||
* @return Universally unique identifier (UUID) of flight, should correspond to name of log files
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_flight_information_get_flight_uuid(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a flight_information message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param flight_information C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_flight_information_decode(const mavlink_message_t* msg, mavlink_flight_information_t* flight_information)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
flight_information->arming_time_utc = mavlink_msg_flight_information_get_arming_time_utc(msg);
|
||||
flight_information->takeoff_time_utc = mavlink_msg_flight_information_get_takeoff_time_utc(msg);
|
||||
flight_information->flight_uuid = mavlink_msg_flight_information_get_flight_uuid(msg);
|
||||
flight_information->time_boot_ms = mavlink_msg_flight_information_get_time_boot_ms(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN? msg->len : MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN;
|
||||
memset(flight_information, 0, MAVLINK_MSG_ID_FLIGHT_INFORMATION_LEN);
|
||||
memcpy(flight_information, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,459 @@
|
||||
#pragma once
|
||||
// MESSAGE FOLLOW_TARGET PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET 144
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_follow_target_t {
|
||||
uint64_t timestamp; /*< [ms] Timestamp (time since system boot).*/
|
||||
uint64_t custom_state; /*< button states or switches of a tracker device*/
|
||||
int32_t lat; /*< [degE7] Latitude (WGS84)*/
|
||||
int32_t lon; /*< [degE7] Longitude (WGS84)*/
|
||||
float alt; /*< [m] Altitude (AMSL)*/
|
||||
float vel[3]; /*< [m/s] target velocity (0,0,0) for unknown*/
|
||||
float acc[3]; /*< [m/s/s] linear target acceleration (0,0,0) for unknown*/
|
||||
float attitude_q[4]; /*< (1 0 0 0 for unknown)*/
|
||||
float rates[3]; /*< (0 0 0 for unknown)*/
|
||||
float position_cov[3]; /*< eph epv*/
|
||||
uint8_t est_capabilities; /*< bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)*/
|
||||
}) mavlink_follow_target_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_LEN 93
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN 93
|
||||
#define MAVLINK_MSG_ID_144_LEN 93
|
||||
#define MAVLINK_MSG_ID_144_MIN_LEN 93
|
||||
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_CRC 127
|
||||
#define MAVLINK_MSG_ID_144_CRC 127
|
||||
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_VEL_LEN 3
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_ACC_LEN 3
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_ATTITUDE_Q_LEN 4
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_RATES_LEN 3
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_POSITION_COV_LEN 3
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_FOLLOW_TARGET { \
|
||||
144, \
|
||||
"FOLLOW_TARGET", \
|
||||
11, \
|
||||
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
|
||||
{ "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, vel) }, \
|
||||
{ "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 40, offsetof(mavlink_follow_target_t, acc) }, \
|
||||
{ "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \
|
||||
{ "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \
|
||||
{ "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \
|
||||
{ "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_FOLLOW_TARGET { \
|
||||
"FOLLOW_TARGET", \
|
||||
11, \
|
||||
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
|
||||
{ "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, vel) }, \
|
||||
{ "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 40, offsetof(mavlink_follow_target_t, acc) }, \
|
||||
{ "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \
|
||||
{ "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \
|
||||
{ "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \
|
||||
{ "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a follow_target message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param timestamp [ms] Timestamp (time since system boot).
|
||||
* @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [m] Altitude (AMSL)
|
||||
* @param vel [m/s] target velocity (0,0,0) for unknown
|
||||
* @param acc [m/s/s] linear target acceleration (0,0,0) for unknown
|
||||
* @param attitude_q (1 0 0 0 for unknown)
|
||||
* @param rates (0 0 0 for unknown)
|
||||
* @param position_cov eph epv
|
||||
* @param custom_state button states or switches of a tracker device
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
#else
|
||||
mavlink_follow_target_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.custom_state = custom_state;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a follow_target message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param timestamp [ms] Timestamp (time since system boot).
|
||||
* @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [m] Altitude (AMSL)
|
||||
* @param vel [m/s] target velocity (0,0,0) for unknown
|
||||
* @param acc [m/s/s] linear target acceleration (0,0,0) for unknown
|
||||
* @param attitude_q (1 0 0 0 for unknown)
|
||||
* @param rates (0 0 0 for unknown)
|
||||
* @param position_cov eph epv
|
||||
* @param custom_state button states or switches of a tracker device
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t timestamp,uint8_t est_capabilities,int32_t lat,int32_t lon,float alt,const float *vel,const float *acc,const float *attitude_q,const float *rates,const float *position_cov,uint64_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
#else
|
||||
mavlink_follow_target_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.custom_state = custom_state;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a follow_target struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param follow_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
|
||||
{
|
||||
return mavlink_msg_follow_target_pack(system_id, component_id, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a follow_target struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param follow_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
|
||||
{
|
||||
return mavlink_msg_follow_target_pack_chan(system_id, component_id, chan, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a follow_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param timestamp [ms] Timestamp (time since system boot).
|
||||
* @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [m] Altitude (AMSL)
|
||||
* @param vel [m/s] target velocity (0,0,0) for unknown
|
||||
* @param acc [m/s/s] linear target acceleration (0,0,0) for unknown
|
||||
* @param attitude_q (1 0 0 0 for unknown)
|
||||
* @param rates (0 0 0 for unknown)
|
||||
* @param position_cov eph epv
|
||||
* @param custom_state button states or switches of a tracker device
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_follow_target_send(mavlink_channel_t chan, uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#else
|
||||
mavlink_follow_target_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.custom_state = custom_state;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)&packet, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a follow_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_follow_target_send_struct(mavlink_channel_t chan, const mavlink_follow_target_t* follow_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_follow_target_send(chan, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)follow_target, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_FOLLOW_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_follow_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#else
|
||||
mavlink_follow_target_t *packet = (mavlink_follow_target_t *)msgbuf;
|
||||
packet->timestamp = timestamp;
|
||||
packet->custom_state = custom_state;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet->vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet->acc, acc, sizeof(float)*3);
|
||||
mav_array_memcpy(packet->attitude_q, attitude_q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet->rates, rates, sizeof(float)*3);
|
||||
mav_array_memcpy(packet->position_cov, position_cov, sizeof(float)*3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)packet, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE FOLLOW_TARGET UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field timestamp from follow_target message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_follow_target_get_timestamp(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field est_capabilities from follow_target message
|
||||
*
|
||||
* @return bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_follow_target_get_est_capabilities(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 92);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from follow_target message
|
||||
*
|
||||
* @return [degE7] Latitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_follow_target_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from follow_target message
|
||||
*
|
||||
* @return [degE7] Longitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_follow_target_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from follow_target message
|
||||
*
|
||||
* @return [m] Altitude (AMSL)
|
||||
*/
|
||||
static inline float mavlink_msg_follow_target_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel from follow_target message
|
||||
*
|
||||
* @return [m/s] target velocity (0,0,0) for unknown
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_vel(const mavlink_message_t* msg, float *vel)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, vel, 3, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field acc from follow_target message
|
||||
*
|
||||
* @return [m/s/s] linear target acceleration (0,0,0) for unknown
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_acc(const mavlink_message_t* msg, float *acc)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, acc, 3, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field attitude_q from follow_target message
|
||||
*
|
||||
* @return (1 0 0 0 for unknown)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_attitude_q(const mavlink_message_t* msg, float *attitude_q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, attitude_q, 4, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rates from follow_target message
|
||||
*
|
||||
* @return (0 0 0 for unknown)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_rates(const mavlink_message_t* msg, float *rates)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, rates, 3, 68);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field position_cov from follow_target message
|
||||
*
|
||||
* @return eph epv
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_position_cov(const mavlink_message_t* msg, float *position_cov)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, position_cov, 3, 80);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field custom_state from follow_target message
|
||||
*
|
||||
* @return button states or switches of a tracker device
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_follow_target_get_custom_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a follow_target message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param follow_target C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_follow_target_decode(const mavlink_message_t* msg, mavlink_follow_target_t* follow_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
follow_target->timestamp = mavlink_msg_follow_target_get_timestamp(msg);
|
||||
follow_target->custom_state = mavlink_msg_follow_target_get_custom_state(msg);
|
||||
follow_target->lat = mavlink_msg_follow_target_get_lat(msg);
|
||||
follow_target->lon = mavlink_msg_follow_target_get_lon(msg);
|
||||
follow_target->alt = mavlink_msg_follow_target_get_alt(msg);
|
||||
mavlink_msg_follow_target_get_vel(msg, follow_target->vel);
|
||||
mavlink_msg_follow_target_get_acc(msg, follow_target->acc);
|
||||
mavlink_msg_follow_target_get_attitude_q(msg, follow_target->attitude_q);
|
||||
mavlink_msg_follow_target_get_rates(msg, follow_target->rates);
|
||||
mavlink_msg_follow_target_get_position_cov(msg, follow_target->position_cov);
|
||||
follow_target->est_capabilities = mavlink_msg_follow_target_get_est_capabilities(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_FOLLOW_TARGET_LEN? msg->len : MAVLINK_MSG_ID_FOLLOW_TARGET_LEN;
|
||||
memset(follow_target, 0, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
memcpy(follow_target, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,413 @@
|
||||
#pragma once
|
||||
// MESSAGE GLOBAL_POSITION_INT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT 33
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_global_position_int_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
int32_t lat; /*< [degE7] Latitude, expressed*/
|
||||
int32_t lon; /*< [degE7] Longitude, expressed*/
|
||||
int32_t alt; /*< [mm] Altitude (AMSL). Note that virtually all GPS modules provide both WGS84 and AMSL.*/
|
||||
int32_t relative_alt; /*< [mm] Altitude above ground*/
|
||||
int16_t vx; /*< [cm/s] Ground X Speed (Latitude, positive north)*/
|
||||
int16_t vy; /*< [cm/s] Ground Y Speed (Longitude, positive east)*/
|
||||
int16_t vz; /*< [cm/s] Ground Z Speed (Altitude, positive down)*/
|
||||
uint16_t hdg; /*< [cdeg] Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/
|
||||
}) mavlink_global_position_int_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN 28
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN 28
|
||||
#define MAVLINK_MSG_ID_33_LEN 28
|
||||
#define MAVLINK_MSG_ID_33_MIN_LEN 28
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC 104
|
||||
#define MAVLINK_MSG_ID_33_CRC 104
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT { \
|
||||
33, \
|
||||
"GLOBAL_POSITION_INT", \
|
||||
9, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_global_position_int_t, time_boot_ms) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_global_position_int_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_t, alt) }, \
|
||||
{ "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_t, relative_alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_global_position_int_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_global_position_int_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_global_position_int_t, vz) }, \
|
||||
{ "hdg", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_global_position_int_t, hdg) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT { \
|
||||
"GLOBAL_POSITION_INT", \
|
||||
9, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_global_position_int_t, time_boot_ms) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_global_position_int_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_t, alt) }, \
|
||||
{ "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_t, relative_alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_global_position_int_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_global_position_int_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_global_position_int_t, vz) }, \
|
||||
{ "hdg", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_global_position_int_t, hdg) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a global_position_int message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param lat [degE7] Latitude, expressed
|
||||
* @param lon [degE7] Longitude, expressed
|
||||
* @param alt [mm] Altitude (AMSL). Note that virtually all GPS modules provide both WGS84 and AMSL.
|
||||
* @param relative_alt [mm] Altitude above ground
|
||||
* @param vx [cm/s] Ground X Speed (Latitude, positive north)
|
||||
* @param vy [cm/s] Ground Y Speed (Longitude, positive east)
|
||||
* @param vz [cm/s] Ground Z Speed (Altitude, positive down)
|
||||
* @param hdg [cdeg] Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, alt);
|
||||
_mav_put_int32_t(buf, 16, relative_alt);
|
||||
_mav_put_int16_t(buf, 20, vx);
|
||||
_mav_put_int16_t(buf, 22, vy);
|
||||
_mav_put_int16_t(buf, 24, vz);
|
||||
_mav_put_uint16_t(buf, 26, hdg);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
|
||||
#else
|
||||
mavlink_global_position_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.hdg = hdg;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a global_position_int message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param lat [degE7] Latitude, expressed
|
||||
* @param lon [degE7] Longitude, expressed
|
||||
* @param alt [mm] Altitude (AMSL). Note that virtually all GPS modules provide both WGS84 and AMSL.
|
||||
* @param relative_alt [mm] Altitude above ground
|
||||
* @param vx [cm/s] Ground X Speed (Latitude, positive north)
|
||||
* @param vy [cm/s] Ground Y Speed (Longitude, positive east)
|
||||
* @param vz [cm/s] Ground Z Speed (Altitude, positive down)
|
||||
* @param hdg [cdeg] Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,int16_t vx,int16_t vy,int16_t vz,uint16_t hdg)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, alt);
|
||||
_mav_put_int32_t(buf, 16, relative_alt);
|
||||
_mav_put_int16_t(buf, 20, vx);
|
||||
_mav_put_int16_t(buf, 22, vy);
|
||||
_mav_put_int16_t(buf, 24, vz);
|
||||
_mav_put_uint16_t(buf, 26, hdg);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
|
||||
#else
|
||||
mavlink_global_position_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.hdg = hdg;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_position_int struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_position_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_int_t* global_position_int)
|
||||
{
|
||||
return mavlink_msg_global_position_int_pack(system_id, component_id, msg, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_position_int struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_position_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_position_int_t* global_position_int)
|
||||
{
|
||||
return mavlink_msg_global_position_int_pack_chan(system_id, component_id, chan, msg, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_position_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param lat [degE7] Latitude, expressed
|
||||
* @param lon [degE7] Longitude, expressed
|
||||
* @param alt [mm] Altitude (AMSL). Note that virtually all GPS modules provide both WGS84 and AMSL.
|
||||
* @param relative_alt [mm] Altitude above ground
|
||||
* @param vx [cm/s] Ground X Speed (Latitude, positive north)
|
||||
* @param vy [cm/s] Ground Y Speed (Longitude, positive east)
|
||||
* @param vz [cm/s] Ground Z Speed (Altitude, positive down)
|
||||
* @param hdg [cdeg] Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_global_position_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, alt);
|
||||
_mav_put_int32_t(buf, 16, relative_alt);
|
||||
_mav_put_int16_t(buf, 20, vx);
|
||||
_mav_put_int16_t(buf, 22, vy);
|
||||
_mav_put_int16_t(buf, 24, vz);
|
||||
_mav_put_uint16_t(buf, 26, hdg);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
#else
|
||||
mavlink_global_position_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.hdg = hdg;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_position_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_send_struct(mavlink_channel_t chan, const mavlink_global_position_int_t* global_position_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_global_position_int_send(chan, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)global_position_int, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, alt);
|
||||
_mav_put_int32_t(buf, 16, relative_alt);
|
||||
_mav_put_int16_t(buf, 20, vx);
|
||||
_mav_put_int16_t(buf, 22, vy);
|
||||
_mav_put_int16_t(buf, 24, vz);
|
||||
_mav_put_uint16_t(buf, 26, hdg);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
#else
|
||||
mavlink_global_position_int_t *packet = (mavlink_global_position_int_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->relative_alt = relative_alt;
|
||||
packet->vx = vx;
|
||||
packet->vy = vy;
|
||||
packet->vz = vz;
|
||||
packet->hdg = hdg;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GLOBAL_POSITION_INT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from global_position_int message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_global_position_int_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from global_position_int message
|
||||
*
|
||||
* @return [degE7] Latitude, expressed
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from global_position_int message
|
||||
*
|
||||
* @return [degE7] Longitude, expressed
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from global_position_int message
|
||||
*
|
||||
* @return [mm] Altitude (AMSL). Note that virtually all GPS modules provide both WGS84 and AMSL.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field relative_alt from global_position_int message
|
||||
*
|
||||
* @return [mm] Altitude above ground
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_get_relative_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vx from global_position_int message
|
||||
*
|
||||
* @return [cm/s] Ground X Speed (Latitude, positive north)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_global_position_int_get_vx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vy from global_position_int message
|
||||
*
|
||||
* @return [cm/s] Ground Y Speed (Longitude, positive east)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_global_position_int_get_vy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vz from global_position_int message
|
||||
*
|
||||
* @return [cm/s] Ground Z Speed (Altitude, positive down)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_global_position_int_get_vz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field hdg from global_position_int message
|
||||
*
|
||||
* @return [cdeg] Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_get_hdg(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a global_position_int message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param global_position_int C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_decode(const mavlink_message_t* msg, mavlink_global_position_int_t* global_position_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
global_position_int->time_boot_ms = mavlink_msg_global_position_int_get_time_boot_ms(msg);
|
||||
global_position_int->lat = mavlink_msg_global_position_int_get_lat(msg);
|
||||
global_position_int->lon = mavlink_msg_global_position_int_get_lon(msg);
|
||||
global_position_int->alt = mavlink_msg_global_position_int_get_alt(msg);
|
||||
global_position_int->relative_alt = mavlink_msg_global_position_int_get_relative_alt(msg);
|
||||
global_position_int->vx = mavlink_msg_global_position_int_get_vx(msg);
|
||||
global_position_int->vy = mavlink_msg_global_position_int_get_vy(msg);
|
||||
global_position_int->vz = mavlink_msg_global_position_int_get_vz(msg);
|
||||
global_position_int->hdg = mavlink_msg_global_position_int_get_hdg(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN;
|
||||
memset(global_position_int, 0, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
|
||||
memcpy(global_position_int, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,430 @@
|
||||
#pragma once
|
||||
// MESSAGE GLOBAL_POSITION_INT_COV PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV 63
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_global_position_int_cov_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
int32_t lat; /*< [degE7] Latitude*/
|
||||
int32_t lon; /*< [degE7] Longitude*/
|
||||
int32_t alt; /*< [mm] Altitude in meters above MSL*/
|
||||
int32_t relative_alt; /*< [mm] Altitude above ground*/
|
||||
float vx; /*< [m/s] Ground X Speed (Latitude)*/
|
||||
float vy; /*< [m/s] Ground Y Speed (Longitude)*/
|
||||
float vz; /*< [m/s] Ground Z Speed (Altitude)*/
|
||||
float covariance[36]; /*< Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)*/
|
||||
uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/
|
||||
}) mavlink_global_position_int_cov_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN 181
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN 181
|
||||
#define MAVLINK_MSG_ID_63_LEN 181
|
||||
#define MAVLINK_MSG_ID_63_MIN_LEN 181
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC 119
|
||||
#define MAVLINK_MSG_ID_63_CRC 119
|
||||
|
||||
#define MAVLINK_MSG_GLOBAL_POSITION_INT_COV_FIELD_COVARIANCE_LEN 36
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV { \
|
||||
63, \
|
||||
"GLOBAL_POSITION_INT_COV", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_usec) }, \
|
||||
{ "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, alt) }, \
|
||||
{ "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_global_position_int_cov_t, relative_alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_int_cov_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vz) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 36, offsetof(mavlink_global_position_int_cov_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV { \
|
||||
"GLOBAL_POSITION_INT_COV", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_usec) }, \
|
||||
{ "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, alt) }, \
|
||||
{ "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_global_position_int_cov_t, relative_alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_int_cov_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vz) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 36, offsetof(mavlink_global_position_int_cov_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a global_position_int_cov message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param estimator_type Class id of the estimator this estimate originated from.
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param alt [mm] Altitude in meters above MSL
|
||||
* @param relative_alt [mm] Altitude above ground
|
||||
* @param vx [m/s] Ground X Speed (Latitude)
|
||||
* @param vy [m/s] Ground Y Speed (Longitude)
|
||||
* @param vz [m/s] Ground Z Speed (Altitude)
|
||||
* @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_int32_t(buf, 20, relative_alt);
|
||||
_mav_put_float(buf, 24, vx);
|
||||
_mav_put_float(buf, 28, vy);
|
||||
_mav_put_float(buf, 32, vz);
|
||||
_mav_put_uint8_t(buf, 180, estimator_type);
|
||||
_mav_put_float_array(buf, 36, covariance, 36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
|
||||
#else
|
||||
mavlink_global_position_int_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a global_position_int_cov message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param estimator_type Class id of the estimator this estimate originated from.
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param alt [mm] Altitude in meters above MSL
|
||||
* @param relative_alt [mm] Altitude above ground
|
||||
* @param vx [m/s] Ground X Speed (Latitude)
|
||||
* @param vy [m/s] Ground Y Speed (Longitude)
|
||||
* @param vz [m/s] Ground Z Speed (Altitude)
|
||||
* @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t estimator_type,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,float vx,float vy,float vz,const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_int32_t(buf, 20, relative_alt);
|
||||
_mav_put_float(buf, 24, vx);
|
||||
_mav_put_float(buf, 28, vy);
|
||||
_mav_put_float(buf, 32, vz);
|
||||
_mav_put_uint8_t(buf, 180, estimator_type);
|
||||
_mav_put_float_array(buf, 36, covariance, 36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
|
||||
#else
|
||||
mavlink_global_position_int_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_position_int_cov struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_position_int_cov C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_int_cov_t* global_position_int_cov)
|
||||
{
|
||||
return mavlink_msg_global_position_int_cov_pack(system_id, component_id, msg, global_position_int_cov->time_usec, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_position_int_cov struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_position_int_cov C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_position_int_cov_t* global_position_int_cov)
|
||||
{
|
||||
return mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, chan, msg, global_position_int_cov->time_usec, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_position_int_cov message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param estimator_type Class id of the estimator this estimate originated from.
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param alt [mm] Altitude in meters above MSL
|
||||
* @param relative_alt [mm] Altitude above ground
|
||||
* @param vx [m/s] Ground X Speed (Latitude)
|
||||
* @param vy [m/s] Ground Y Speed (Longitude)
|
||||
* @param vz [m/s] Ground Z Speed (Altitude)
|
||||
* @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_global_position_int_cov_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_int32_t(buf, 20, relative_alt);
|
||||
_mav_put_float(buf, 24, vx);
|
||||
_mav_put_float(buf, 28, vy);
|
||||
_mav_put_float(buf, 32, vz);
|
||||
_mav_put_uint8_t(buf, 180, estimator_type);
|
||||
_mav_put_float_array(buf, 36, covariance, 36);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
#else
|
||||
mavlink_global_position_int_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_position_int_cov message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_cov_send_struct(mavlink_channel_t chan, const mavlink_global_position_int_cov_t* global_position_int_cov)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_global_position_int_cov_send(chan, global_position_int_cov->time_usec, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)global_position_int_cov, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_int32_t(buf, 20, relative_alt);
|
||||
_mav_put_float(buf, 24, vx);
|
||||
_mav_put_float(buf, 28, vy);
|
||||
_mav_put_float(buf, 32, vz);
|
||||
_mav_put_uint8_t(buf, 180, estimator_type);
|
||||
_mav_put_float_array(buf, 36, covariance, 36);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
#else
|
||||
mavlink_global_position_int_cov_t *packet = (mavlink_global_position_int_cov_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->relative_alt = relative_alt;
|
||||
packet->vx = vx;
|
||||
packet->vy = vy;
|
||||
packet->vz = vz;
|
||||
packet->estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet->covariance, covariance, sizeof(float)*36);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GLOBAL_POSITION_INT_COV UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from global_position_int_cov message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_global_position_int_cov_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field estimator_type from global_position_int_cov message
|
||||
*
|
||||
* @return Class id of the estimator this estimate originated from.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_global_position_int_cov_get_estimator_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 180);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from global_position_int_cov message
|
||||
*
|
||||
* @return [degE7] Latitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_cov_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from global_position_int_cov message
|
||||
*
|
||||
* @return [degE7] Longitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_cov_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from global_position_int_cov message
|
||||
*
|
||||
* @return [mm] Altitude in meters above MSL
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_cov_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field relative_alt from global_position_int_cov message
|
||||
*
|
||||
* @return [mm] Altitude above ground
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_cov_get_relative_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vx from global_position_int_cov message
|
||||
*
|
||||
* @return [m/s] Ground X Speed (Latitude)
|
||||
*/
|
||||
static inline float mavlink_msg_global_position_int_cov_get_vx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vy from global_position_int_cov message
|
||||
*
|
||||
* @return [m/s] Ground Y Speed (Longitude)
|
||||
*/
|
||||
static inline float mavlink_msg_global_position_int_cov_get_vy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vz from global_position_int_cov message
|
||||
*
|
||||
* @return [m/s] Ground Z Speed (Altitude)
|
||||
*/
|
||||
static inline float mavlink_msg_global_position_int_cov_get_vz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field covariance from global_position_int_cov message
|
||||
*
|
||||
* @return Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, covariance, 36, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a global_position_int_cov message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param global_position_int_cov C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_cov_decode(const mavlink_message_t* msg, mavlink_global_position_int_cov_t* global_position_int_cov)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
global_position_int_cov->time_usec = mavlink_msg_global_position_int_cov_get_time_usec(msg);
|
||||
global_position_int_cov->lat = mavlink_msg_global_position_int_cov_get_lat(msg);
|
||||
global_position_int_cov->lon = mavlink_msg_global_position_int_cov_get_lon(msg);
|
||||
global_position_int_cov->alt = mavlink_msg_global_position_int_cov_get_alt(msg);
|
||||
global_position_int_cov->relative_alt = mavlink_msg_global_position_int_cov_get_relative_alt(msg);
|
||||
global_position_int_cov->vx = mavlink_msg_global_position_int_cov_get_vx(msg);
|
||||
global_position_int_cov->vy = mavlink_msg_global_position_int_cov_get_vy(msg);
|
||||
global_position_int_cov->vz = mavlink_msg_global_position_int_cov_get_vz(msg);
|
||||
mavlink_msg_global_position_int_cov_get_covariance(msg, global_position_int_cov->covariance);
|
||||
global_position_int_cov->estimator_type = mavlink_msg_global_position_int_cov_get_estimator_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN;
|
||||
memset(global_position_int_cov, 0, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
|
||||
memcpy(global_position_int_cov, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,380 @@
|
||||
#pragma once
|
||||
// MESSAGE GLOBAL_VISION_POSITION_ESTIMATE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE 101
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_global_vision_position_estimate_t {
|
||||
uint64_t usec; /*< [us] Timestamp (UNIX time or since system boot)*/
|
||||
float x; /*< [m] Global X position*/
|
||||
float y; /*< [m] Global Y position*/
|
||||
float z; /*< [m] Global Z position*/
|
||||
float roll; /*< [rad] Roll angle*/
|
||||
float pitch; /*< [rad] Pitch angle*/
|
||||
float yaw; /*< [rad] Yaw angle*/
|
||||
float covariance[21]; /*< Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)*/
|
||||
}) mavlink_global_vision_position_estimate_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN 116
|
||||
#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN 32
|
||||
#define MAVLINK_MSG_ID_101_LEN 116
|
||||
#define MAVLINK_MSG_ID_101_MIN_LEN 32
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC 102
|
||||
#define MAVLINK_MSG_ID_101_CRC 102
|
||||
|
||||
#define MAVLINK_MSG_GLOBAL_VISION_POSITION_ESTIMATE_FIELD_COVARIANCE_LEN 21
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \
|
||||
101, \
|
||||
"GLOBAL_VISION_POSITION_ESTIMATE", \
|
||||
8, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_vision_position_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_vision_position_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_vision_position_estimate_t, z) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_vision_position_estimate_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_vision_position_estimate_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_vision_position_estimate_t, yaw) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 32, offsetof(mavlink_global_vision_position_estimate_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \
|
||||
"GLOBAL_VISION_POSITION_ESTIMATE", \
|
||||
8, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_vision_position_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_vision_position_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_vision_position_estimate_t, z) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_vision_position_estimate_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_vision_position_estimate_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_vision_position_estimate_t, yaw) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 32, offsetof(mavlink_global_vision_position_estimate_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a global_vision_position_estimate message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param usec [us] Timestamp (UNIX time or since system boot)
|
||||
* @param x [m] Global X position
|
||||
* @param y [m] Global Y position
|
||||
* @param z [m] Global Z position
|
||||
* @param roll [rad] Roll angle
|
||||
* @param pitch [rad] Pitch angle
|
||||
* @param yaw [rad] Yaw angle
|
||||
* @param covariance Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
_mav_put_float_array(buf, 32, covariance, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
|
||||
#else
|
||||
mavlink_global_vision_position_estimate_t packet;
|
||||
packet.usec = usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a global_vision_position_estimate message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param usec [us] Timestamp (UNIX time or since system boot)
|
||||
* @param x [m] Global X position
|
||||
* @param y [m] Global Y position
|
||||
* @param z [m] Global Z position
|
||||
* @param roll [rad] Roll angle
|
||||
* @param pitch [rad] Pitch angle
|
||||
* @param yaw [rad] Yaw angle
|
||||
* @param covariance Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw,const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
_mav_put_float_array(buf, 32, covariance, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
|
||||
#else
|
||||
mavlink_global_vision_position_estimate_t packet;
|
||||
packet.usec = usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_vision_position_estimate struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_vision_position_estimate C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_vision_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
|
||||
{
|
||||
return mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw, global_vision_position_estimate->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_vision_position_estimate struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_vision_position_estimate C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_vision_position_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
|
||||
{
|
||||
return mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, chan, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw, global_vision_position_estimate->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_vision_position_estimate message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param usec [us] Timestamp (UNIX time or since system boot)
|
||||
* @param x [m] Global X position
|
||||
* @param y [m] Global Y position
|
||||
* @param z [m] Global Z position
|
||||
* @param roll [rad] Roll angle
|
||||
* @param pitch [rad] Pitch angle
|
||||
* @param yaw [rad] Yaw angle
|
||||
* @param covariance Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
_mav_put_float_array(buf, 32, covariance, 21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
#else
|
||||
mavlink_global_vision_position_estimate_t packet;
|
||||
packet.usec = usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_vision_position_estimate message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_global_vision_position_estimate_send_struct(mavlink_channel_t chan, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_global_vision_position_estimate_send(chan, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw, global_vision_position_estimate->covariance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)global_vision_position_estimate, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_global_vision_position_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
_mav_put_float_array(buf, 32, covariance, 21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
#else
|
||||
mavlink_global_vision_position_estimate_t *packet = (mavlink_global_vision_position_estimate_t *)msgbuf;
|
||||
packet->usec = usec;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->roll = roll;
|
||||
packet->pitch = pitch;
|
||||
packet->yaw = yaw;
|
||||
mav_array_memcpy(packet->covariance, covariance, sizeof(float)*21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GLOBAL_VISION_POSITION_ESTIMATE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field usec from global_vision_position_estimate message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX time or since system boot)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from global_vision_position_estimate message
|
||||
*
|
||||
* @return [m] Global X position
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from global_vision_position_estimate message
|
||||
*
|
||||
* @return [m] Global Y position
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from global_vision_position_estimate message
|
||||
*
|
||||
* @return [m] Global Z position
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from global_vision_position_estimate message
|
||||
*
|
||||
* @return [rad] Roll angle
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from global_vision_position_estimate message
|
||||
*
|
||||
* @return [rad] Pitch angle
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from global_vision_position_estimate message
|
||||
*
|
||||
* @return [rad] Yaw angle
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field covariance from global_vision_position_estimate message
|
||||
*
|
||||
* @return Pose covariance matrix upper right triangular (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_vision_position_estimate_get_covariance(const mavlink_message_t* msg, float *covariance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, covariance, 21, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a global_vision_position_estimate message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param global_vision_position_estimate C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_global_vision_position_estimate_decode(const mavlink_message_t* msg, mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
global_vision_position_estimate->usec = mavlink_msg_global_vision_position_estimate_get_usec(msg);
|
||||
global_vision_position_estimate->x = mavlink_msg_global_vision_position_estimate_get_x(msg);
|
||||
global_vision_position_estimate->y = mavlink_msg_global_vision_position_estimate_get_y(msg);
|
||||
global_vision_position_estimate->z = mavlink_msg_global_vision_position_estimate_get_z(msg);
|
||||
global_vision_position_estimate->roll = mavlink_msg_global_vision_position_estimate_get_roll(msg);
|
||||
global_vision_position_estimate->pitch = mavlink_msg_global_vision_position_estimate_get_pitch(msg);
|
||||
global_vision_position_estimate->yaw = mavlink_msg_global_vision_position_estimate_get_yaw(msg);
|
||||
mavlink_msg_global_vision_position_estimate_get_covariance(msg, global_vision_position_estimate->covariance);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN;
|
||||
memset(global_vision_position_estimate, 0, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
|
||||
memcpy(global_vision_position_estimate, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,488 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS2_RAW PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RAW 124
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps2_raw_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
int32_t lat; /*< [degE7] Latitude (WGS84)*/
|
||||
int32_t lon; /*< [degE7] Longitude (WGS84)*/
|
||||
int32_t alt; /*< [mm] Altitude (AMSL). Positive for up.*/
|
||||
uint32_t dgps_age; /*< [ms] Age of DGPS info*/
|
||||
uint16_t eph; /*< [cm] GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX*/
|
||||
uint16_t epv; /*< [cm] GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX*/
|
||||
uint16_t vel; /*< [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX*/
|
||||
uint16_t cog; /*< [cdeg] Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/
|
||||
uint8_t fix_type; /*< GPS fix type.*/
|
||||
uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/
|
||||
uint8_t dgps_numch; /*< Number of DGPS satellites*/
|
||||
}) mavlink_gps2_raw_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RAW_LEN 35
|
||||
#define MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN 35
|
||||
#define MAVLINK_MSG_ID_124_LEN 35
|
||||
#define MAVLINK_MSG_ID_124_MIN_LEN 35
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RAW_CRC 87
|
||||
#define MAVLINK_MSG_ID_124_CRC 87
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS2_RAW { \
|
||||
124, \
|
||||
"GPS2_RAW", \
|
||||
12, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_raw_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_raw_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, alt) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps2_raw_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps2_raw_t, epv) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_raw_t, vel) }, \
|
||||
{ "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_gps2_raw_t, cog) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \
|
||||
{ "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \
|
||||
{ "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS2_RAW { \
|
||||
"GPS2_RAW", \
|
||||
12, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_raw_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_raw_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, alt) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps2_raw_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps2_raw_t, epv) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_raw_t, vel) }, \
|
||||
{ "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_gps2_raw_t, cog) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \
|
||||
{ "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \
|
||||
{ "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps2_raw message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param fix_type GPS fix type.
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [mm] Altitude (AMSL). Positive for up.
|
||||
* @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX
|
||||
* @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX
|
||||
* @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX
|
||||
* @param cog [cdeg] Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @param dgps_numch Number of DGPS satellites
|
||||
* @param dgps_age [ms] Age of DGPS info
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint32_t(buf, 20, dgps_age);
|
||||
_mav_put_uint16_t(buf, 24, eph);
|
||||
_mav_put_uint16_t(buf, 26, epv);
|
||||
_mav_put_uint16_t(buf, 28, vel);
|
||||
_mav_put_uint16_t(buf, 30, cog);
|
||||
_mav_put_uint8_t(buf, 32, fix_type);
|
||||
_mav_put_uint8_t(buf, 33, satellites_visible);
|
||||
_mav_put_uint8_t(buf, 34, dgps_numch);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
|
||||
#else
|
||||
mavlink_gps2_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.dgps_age = dgps_age;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
packet.dgps_numch = dgps_numch;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS2_RAW;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps2_raw message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param fix_type GPS fix type.
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [mm] Altitude (AMSL). Positive for up.
|
||||
* @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX
|
||||
* @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX
|
||||
* @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX
|
||||
* @param cog [cdeg] Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @param dgps_numch Number of DGPS satellites
|
||||
* @param dgps_age [ms] Age of DGPS info
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible,uint8_t dgps_numch,uint32_t dgps_age)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint32_t(buf, 20, dgps_age);
|
||||
_mav_put_uint16_t(buf, 24, eph);
|
||||
_mav_put_uint16_t(buf, 26, epv);
|
||||
_mav_put_uint16_t(buf, 28, vel);
|
||||
_mav_put_uint16_t(buf, 30, cog);
|
||||
_mav_put_uint8_t(buf, 32, fix_type);
|
||||
_mav_put_uint8_t(buf, 33, satellites_visible);
|
||||
_mav_put_uint8_t(buf, 34, dgps_numch);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
|
||||
#else
|
||||
mavlink_gps2_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.dgps_age = dgps_age;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
packet.dgps_numch = dgps_numch;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS2_RAW;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps2_raw struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps2_raw C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw)
|
||||
{
|
||||
return mavlink_msg_gps2_raw_pack(system_id, component_id, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps2_raw struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps2_raw C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw)
|
||||
{
|
||||
return mavlink_msg_gps2_raw_pack_chan(system_id, component_id, chan, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps2_raw message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param fix_type GPS fix type.
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [mm] Altitude (AMSL). Positive for up.
|
||||
* @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX
|
||||
* @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX
|
||||
* @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX
|
||||
* @param cog [cdeg] Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @param dgps_numch Number of DGPS satellites
|
||||
* @param dgps_age [ms] Age of DGPS info
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps2_raw_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint32_t(buf, 20, dgps_age);
|
||||
_mav_put_uint16_t(buf, 24, eph);
|
||||
_mav_put_uint16_t(buf, 26, epv);
|
||||
_mav_put_uint16_t(buf, 28, vel);
|
||||
_mav_put_uint16_t(buf, 30, cog);
|
||||
_mav_put_uint8_t(buf, 32, fix_type);
|
||||
_mav_put_uint8_t(buf, 33, satellites_visible);
|
||||
_mav_put_uint8_t(buf, 34, dgps_numch);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
#else
|
||||
mavlink_gps2_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.dgps_age = dgps_age;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
packet.dgps_numch = dgps_numch;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps2_raw message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_raw_send_struct(mavlink_channel_t chan, const mavlink_gps2_raw_t* gps2_raw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps2_raw_send(chan, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)gps2_raw, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS2_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint32_t(buf, 20, dgps_age);
|
||||
_mav_put_uint16_t(buf, 24, eph);
|
||||
_mav_put_uint16_t(buf, 26, epv);
|
||||
_mav_put_uint16_t(buf, 28, vel);
|
||||
_mav_put_uint16_t(buf, 30, cog);
|
||||
_mav_put_uint8_t(buf, 32, fix_type);
|
||||
_mav_put_uint8_t(buf, 33, satellites_visible);
|
||||
_mav_put_uint8_t(buf, 34, dgps_numch);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
#else
|
||||
mavlink_gps2_raw_t *packet = (mavlink_gps2_raw_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->dgps_age = dgps_age;
|
||||
packet->eph = eph;
|
||||
packet->epv = epv;
|
||||
packet->vel = vel;
|
||||
packet->cog = cog;
|
||||
packet->fix_type = fix_type;
|
||||
packet->satellites_visible = satellites_visible;
|
||||
packet->dgps_numch = dgps_numch;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)packet, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS2_RAW UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from gps2_raw message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_gps2_raw_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fix_type from gps2_raw message
|
||||
*
|
||||
* @return GPS fix type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_raw_get_fix_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from gps2_raw message
|
||||
*
|
||||
* @return [degE7] Latitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_raw_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from gps2_raw message
|
||||
*
|
||||
* @return [degE7] Longitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_raw_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from gps2_raw message
|
||||
*
|
||||
* @return [mm] Altitude (AMSL). Positive for up.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_raw_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field eph from gps2_raw message
|
||||
*
|
||||
* @return [cm] GPS HDOP horizontal dilution of position. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_get_eph(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field epv from gps2_raw message
|
||||
*
|
||||
* @return [cm] GPS VDOP vertical dilution of position. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_get_epv(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel from gps2_raw message
|
||||
*
|
||||
* @return [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_get_vel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cog from gps2_raw message
|
||||
*
|
||||
* @return [cdeg] Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_get_cog(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellites_visible from gps2_raw message
|
||||
*
|
||||
* @return Number of satellites visible. If unknown, set to 255
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_raw_get_satellites_visible(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field dgps_numch from gps2_raw message
|
||||
*
|
||||
* @return Number of DGPS satellites
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_raw_get_dgps_numch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field dgps_age from gps2_raw message
|
||||
*
|
||||
* @return [ms] Age of DGPS info
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps2_raw_get_dgps_age(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps2_raw message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps2_raw C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_raw_decode(const mavlink_message_t* msg, mavlink_gps2_raw_t* gps2_raw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps2_raw->time_usec = mavlink_msg_gps2_raw_get_time_usec(msg);
|
||||
gps2_raw->lat = mavlink_msg_gps2_raw_get_lat(msg);
|
||||
gps2_raw->lon = mavlink_msg_gps2_raw_get_lon(msg);
|
||||
gps2_raw->alt = mavlink_msg_gps2_raw_get_alt(msg);
|
||||
gps2_raw->dgps_age = mavlink_msg_gps2_raw_get_dgps_age(msg);
|
||||
gps2_raw->eph = mavlink_msg_gps2_raw_get_eph(msg);
|
||||
gps2_raw->epv = mavlink_msg_gps2_raw_get_epv(msg);
|
||||
gps2_raw->vel = mavlink_msg_gps2_raw_get_vel(msg);
|
||||
gps2_raw->cog = mavlink_msg_gps2_raw_get_cog(msg);
|
||||
gps2_raw->fix_type = mavlink_msg_gps2_raw_get_fix_type(msg);
|
||||
gps2_raw->satellites_visible = mavlink_msg_gps2_raw_get_satellites_visible(msg);
|
||||
gps2_raw->dgps_numch = mavlink_msg_gps2_raw_get_dgps_numch(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS2_RAW_LEN? msg->len : MAVLINK_MSG_ID_GPS2_RAW_LEN;
|
||||
memset(gps2_raw, 0, MAVLINK_MSG_ID_GPS2_RAW_LEN);
|
||||
memcpy(gps2_raw, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,513 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS2_RTK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RTK 128
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps2_rtk_t {
|
||||
uint32_t time_last_baseline_ms; /*< [ms] Time since boot of last baseline message received.*/
|
||||
uint32_t tow; /*< [ms] GPS Time of Week of last baseline*/
|
||||
int32_t baseline_a_mm; /*< [mm] Current baseline in ECEF x or NED north component.*/
|
||||
int32_t baseline_b_mm; /*< [mm] Current baseline in ECEF y or NED east component.*/
|
||||
int32_t baseline_c_mm; /*< [mm] Current baseline in ECEF z or NED down component.*/
|
||||
uint32_t accuracy; /*< Current estimate of baseline accuracy.*/
|
||||
int32_t iar_num_hypotheses; /*< Current number of integer ambiguity hypotheses.*/
|
||||
uint16_t wn; /*< GPS Week Number of last baseline*/
|
||||
uint8_t rtk_receiver_id; /*< Identification of connected RTK receiver.*/
|
||||
uint8_t rtk_health; /*< GPS-specific health report for RTK data.*/
|
||||
uint8_t rtk_rate; /*< [Hz] Rate of baseline messages being received by GPS*/
|
||||
uint8_t nsats; /*< Current number of sats used for RTK calculation.*/
|
||||
uint8_t baseline_coords_type; /*< Coordinate system of baseline*/
|
||||
}) mavlink_gps2_rtk_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RTK_LEN 35
|
||||
#define MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN 35
|
||||
#define MAVLINK_MSG_ID_128_LEN 35
|
||||
#define MAVLINK_MSG_ID_128_MIN_LEN 35
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RTK_CRC 226
|
||||
#define MAVLINK_MSG_ID_128_CRC 226
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS2_RTK { \
|
||||
128, \
|
||||
"GPS2_RTK", \
|
||||
13, \
|
||||
{ { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_rtk_t, time_last_baseline_ms) }, \
|
||||
{ "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_rtk_t, rtk_receiver_id) }, \
|
||||
{ "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_rtk_t, wn) }, \
|
||||
{ "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps2_rtk_t, tow) }, \
|
||||
{ "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps2_rtk_t, rtk_health) }, \
|
||||
{ "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_rtk_t, rtk_rate) }, \
|
||||
{ "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_rtk_t, nsats) }, \
|
||||
{ "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \
|
||||
{ "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_rtk_t, baseline_a_mm) }, \
|
||||
{ "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_rtk_t, baseline_b_mm) }, \
|
||||
{ "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_rtk_t, baseline_c_mm) }, \
|
||||
{ "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_rtk_t, accuracy) }, \
|
||||
{ "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps2_rtk_t, iar_num_hypotheses) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS2_RTK { \
|
||||
"GPS2_RTK", \
|
||||
13, \
|
||||
{ { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_rtk_t, time_last_baseline_ms) }, \
|
||||
{ "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_rtk_t, rtk_receiver_id) }, \
|
||||
{ "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_rtk_t, wn) }, \
|
||||
{ "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps2_rtk_t, tow) }, \
|
||||
{ "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps2_rtk_t, rtk_health) }, \
|
||||
{ "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_rtk_t, rtk_rate) }, \
|
||||
{ "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_rtk_t, nsats) }, \
|
||||
{ "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \
|
||||
{ "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_rtk_t, baseline_a_mm) }, \
|
||||
{ "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_rtk_t, baseline_b_mm) }, \
|
||||
{ "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_rtk_t, baseline_c_mm) }, \
|
||||
{ "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_rtk_t, accuracy) }, \
|
||||
{ "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps2_rtk_t, iar_num_hypotheses) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps2_rtk message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_last_baseline_ms [ms] Time since boot of last baseline message received.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow [ms] GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate [Hz] Rate of baseline messages being received by GPS
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline
|
||||
* @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component.
|
||||
* @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component.
|
||||
* @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_rtk_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RTK_LEN);
|
||||
#else
|
||||
mavlink_gps2_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RTK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS2_RTK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps2_rtk message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_last_baseline_ms [ms] Time since boot of last baseline message received.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow [ms] GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate [Hz] Rate of baseline messages being received by GPS
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline
|
||||
* @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component.
|
||||
* @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component.
|
||||
* @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_rtk_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_last_baseline_ms,uint8_t rtk_receiver_id,uint16_t wn,uint32_t tow,uint8_t rtk_health,uint8_t rtk_rate,uint8_t nsats,uint8_t baseline_coords_type,int32_t baseline_a_mm,int32_t baseline_b_mm,int32_t baseline_c_mm,uint32_t accuracy,int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RTK_LEN);
|
||||
#else
|
||||
mavlink_gps2_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RTK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS2_RTK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps2_rtk struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps2_rtk C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_rtk_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps2_rtk_t* gps2_rtk)
|
||||
{
|
||||
return mavlink_msg_gps2_rtk_pack(system_id, component_id, msg, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps2_rtk struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps2_rtk C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_rtk_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps2_rtk_t* gps2_rtk)
|
||||
{
|
||||
return mavlink_msg_gps2_rtk_pack_chan(system_id, component_id, chan, msg, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps2_rtk message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_last_baseline_ms [ms] Time since boot of last baseline message received.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow [ms] GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate [Hz] Rate of baseline messages being received by GPS
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline
|
||||
* @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component.
|
||||
* @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component.
|
||||
* @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps2_rtk_send(mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
#else
|
||||
mavlink_gps2_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps2_rtk message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_rtk_send_struct(mavlink_channel_t chan, const mavlink_gps2_rtk_t* gps2_rtk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps2_rtk_send(chan, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)gps2_rtk, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS2_RTK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_rtk_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
#else
|
||||
mavlink_gps2_rtk_t *packet = (mavlink_gps2_rtk_t *)msgbuf;
|
||||
packet->time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet->tow = tow;
|
||||
packet->baseline_a_mm = baseline_a_mm;
|
||||
packet->baseline_b_mm = baseline_b_mm;
|
||||
packet->baseline_c_mm = baseline_c_mm;
|
||||
packet->accuracy = accuracy;
|
||||
packet->iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet->wn = wn;
|
||||
packet->rtk_receiver_id = rtk_receiver_id;
|
||||
packet->rtk_health = rtk_health;
|
||||
packet->rtk_rate = rtk_rate;
|
||||
packet->nsats = nsats;
|
||||
packet->baseline_coords_type = baseline_coords_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS2_RTK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_last_baseline_ms from gps2_rtk message
|
||||
*
|
||||
* @return [ms] Time since boot of last baseline message received.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps2_rtk_get_time_last_baseline_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_receiver_id from gps2_rtk message
|
||||
*
|
||||
* @return Identification of connected RTK receiver.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_receiver_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field wn from gps2_rtk message
|
||||
*
|
||||
* @return GPS Week Number of last baseline
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_rtk_get_wn(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field tow from gps2_rtk message
|
||||
*
|
||||
* @return [ms] GPS Time of Week of last baseline
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps2_rtk_get_tow(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_health from gps2_rtk message
|
||||
*
|
||||
* @return GPS-specific health report for RTK data.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_health(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_rate from gps2_rtk message
|
||||
*
|
||||
* @return [Hz] Rate of baseline messages being received by GPS
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field nsats from gps2_rtk message
|
||||
*
|
||||
* @return Current number of sats used for RTK calculation.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_rtk_get_nsats(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_coords_type from gps2_rtk message
|
||||
*
|
||||
* @return Coordinate system of baseline
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_rtk_get_baseline_coords_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_a_mm from gps2_rtk message
|
||||
*
|
||||
* @return [mm] Current baseline in ECEF x or NED north component.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_rtk_get_baseline_a_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_b_mm from gps2_rtk message
|
||||
*
|
||||
* @return [mm] Current baseline in ECEF y or NED east component.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_rtk_get_baseline_b_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_c_mm from gps2_rtk message
|
||||
*
|
||||
* @return [mm] Current baseline in ECEF z or NED down component.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_rtk_get_baseline_c_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field accuracy from gps2_rtk message
|
||||
*
|
||||
* @return Current estimate of baseline accuracy.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps2_rtk_get_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field iar_num_hypotheses from gps2_rtk message
|
||||
*
|
||||
* @return Current number of integer ambiguity hypotheses.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_rtk_get_iar_num_hypotheses(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps2_rtk message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps2_rtk C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_rtk_decode(const mavlink_message_t* msg, mavlink_gps2_rtk_t* gps2_rtk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps2_rtk->time_last_baseline_ms = mavlink_msg_gps2_rtk_get_time_last_baseline_ms(msg);
|
||||
gps2_rtk->tow = mavlink_msg_gps2_rtk_get_tow(msg);
|
||||
gps2_rtk->baseline_a_mm = mavlink_msg_gps2_rtk_get_baseline_a_mm(msg);
|
||||
gps2_rtk->baseline_b_mm = mavlink_msg_gps2_rtk_get_baseline_b_mm(msg);
|
||||
gps2_rtk->baseline_c_mm = mavlink_msg_gps2_rtk_get_baseline_c_mm(msg);
|
||||
gps2_rtk->accuracy = mavlink_msg_gps2_rtk_get_accuracy(msg);
|
||||
gps2_rtk->iar_num_hypotheses = mavlink_msg_gps2_rtk_get_iar_num_hypotheses(msg);
|
||||
gps2_rtk->wn = mavlink_msg_gps2_rtk_get_wn(msg);
|
||||
gps2_rtk->rtk_receiver_id = mavlink_msg_gps2_rtk_get_rtk_receiver_id(msg);
|
||||
gps2_rtk->rtk_health = mavlink_msg_gps2_rtk_get_rtk_health(msg);
|
||||
gps2_rtk->rtk_rate = mavlink_msg_gps2_rtk_get_rtk_rate(msg);
|
||||
gps2_rtk->nsats = mavlink_msg_gps2_rtk_get_nsats(msg);
|
||||
gps2_rtk->baseline_coords_type = mavlink_msg_gps2_rtk_get_baseline_coords_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS2_RTK_LEN? msg->len : MAVLINK_MSG_ID_GPS2_RTK_LEN;
|
||||
memset(gps2_rtk, 0, MAVLINK_MSG_ID_GPS2_RTK_LEN);
|
||||
memcpy(gps2_rtk, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_GLOBAL_ORIGIN PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN 49
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_global_origin_t {
|
||||
int32_t latitude; /*< [degE7] Latitude (WGS84)*/
|
||||
int32_t longitude; /*< [degE7] Longitude (WGS84)*/
|
||||
int32_t altitude; /*< [mm] Altitude (AMSL). Positive for up.*/
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
}) mavlink_gps_global_origin_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN 20
|
||||
#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN 12
|
||||
#define MAVLINK_MSG_ID_49_LEN 20
|
||||
#define MAVLINK_MSG_ID_49_MIN_LEN 12
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC 39
|
||||
#define MAVLINK_MSG_ID_49_CRC 39
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN { \
|
||||
49, \
|
||||
"GPS_GLOBAL_ORIGIN", \
|
||||
4, \
|
||||
{ { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_global_origin_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_global_origin_t, longitude) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_global_origin_t, altitude) }, \
|
||||
{ "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 12, offsetof(mavlink_gps_global_origin_t, time_usec) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN { \
|
||||
"GPS_GLOBAL_ORIGIN", \
|
||||
4, \
|
||||
{ { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_global_origin_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_global_origin_t, longitude) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_global_origin_t, altitude) }, \
|
||||
{ "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 12, offsetof(mavlink_gps_global_origin_t, time_usec) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_global_origin message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param latitude [degE7] Latitude (WGS84)
|
||||
* @param longitude [degE7] Longitude (WGS84)
|
||||
* @param altitude [mm] Altitude (AMSL). Positive for up.
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
int32_t latitude, int32_t longitude, int32_t altitude, uint64_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN];
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
_mav_put_uint64_t(buf, 12, time_usec);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
|
||||
#else
|
||||
mavlink_gps_global_origin_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
packet.time_usec = time_usec;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_global_origin message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param latitude [degE7] Latitude (WGS84)
|
||||
* @param longitude [degE7] Longitude (WGS84)
|
||||
* @param altitude [mm] Altitude (AMSL). Positive for up.
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
int32_t latitude,int32_t longitude,int32_t altitude,uint64_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN];
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
_mav_put_uint64_t(buf, 12, time_usec);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
|
||||
#else
|
||||
mavlink_gps_global_origin_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
packet.time_usec = time_usec;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_global_origin struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_global_origin C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_global_origin_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_global_origin_t* gps_global_origin)
|
||||
{
|
||||
return mavlink_msg_gps_global_origin_pack(system_id, component_id, msg, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude, gps_global_origin->time_usec);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_global_origin struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_global_origin C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_global_origin_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_global_origin_t* gps_global_origin)
|
||||
{
|
||||
return mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, chan, msg, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude, gps_global_origin->time_usec);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_global_origin message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param latitude [degE7] Latitude (WGS84)
|
||||
* @param longitude [degE7] Longitude (WGS84)
|
||||
* @param altitude [mm] Altitude (AMSL). Positive for up.
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_global_origin_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude, uint64_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN];
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
_mav_put_uint64_t(buf, 12, time_usec);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
#else
|
||||
mavlink_gps_global_origin_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
packet.time_usec = time_usec;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_global_origin message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_global_origin_send_struct(mavlink_channel_t chan, const mavlink_gps_global_origin_t* gps_global_origin)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_global_origin_send(chan, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude, gps_global_origin->time_usec);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)gps_global_origin, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_global_origin_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude, uint64_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
_mav_put_uint64_t(buf, 12, time_usec);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
#else
|
||||
mavlink_gps_global_origin_t *packet = (mavlink_gps_global_origin_t *)msgbuf;
|
||||
packet->latitude = latitude;
|
||||
packet->longitude = longitude;
|
||||
packet->altitude = altitude;
|
||||
packet->time_usec = time_usec;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_GLOBAL_ORIGIN UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field latitude from gps_global_origin message
|
||||
*
|
||||
* @return [degE7] Latitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_global_origin_get_latitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field longitude from gps_global_origin message
|
||||
*
|
||||
* @return [degE7] Longitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_global_origin_get_longitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude from gps_global_origin message
|
||||
*
|
||||
* @return [mm] Altitude (AMSL). Positive for up.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_global_origin_get_altitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from gps_global_origin message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_gps_global_origin_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_global_origin message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_global_origin C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_global_origin_decode(const mavlink_message_t* msg, mavlink_gps_global_origin_t* gps_global_origin)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_global_origin->latitude = mavlink_msg_gps_global_origin_get_latitude(msg);
|
||||
gps_global_origin->longitude = mavlink_msg_gps_global_origin_get_longitude(msg);
|
||||
gps_global_origin->altitude = mavlink_msg_gps_global_origin_get_altitude(msg);
|
||||
gps_global_origin->time_usec = mavlink_msg_gps_global_origin_get_time_usec(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN? msg->len : MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN;
|
||||
memset(gps_global_origin, 0, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
|
||||
memcpy(gps_global_origin, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_INJECT_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INJECT_DATA 123
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_inject_data_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t len; /*< [bytes] data length*/
|
||||
uint8_t data[110]; /*< raw data (110 is enough for 12 satellites of RTCMv2)*/
|
||||
}) mavlink_gps_inject_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN 113
|
||||
#define MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN 113
|
||||
#define MAVLINK_MSG_ID_123_LEN 113
|
||||
#define MAVLINK_MSG_ID_123_MIN_LEN 113
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC 250
|
||||
#define MAVLINK_MSG_ID_123_CRC 250
|
||||
|
||||
#define MAVLINK_MSG_GPS_INJECT_DATA_FIELD_DATA_LEN 110
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA { \
|
||||
123, \
|
||||
"GPS_INJECT_DATA", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_inject_data_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_inject_data_t, target_component) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_inject_data_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 110, 3, offsetof(mavlink_gps_inject_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA { \
|
||||
"GPS_INJECT_DATA", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_inject_data_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_inject_data_t, target_component) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_inject_data_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 110, 3, offsetof(mavlink_gps_inject_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_inject_data message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param len [bytes] data length
|
||||
* @param data raw data (110 is enough for 12 satellites of RTCMv2)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_inject_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, len);
|
||||
_mav_put_uint8_t_array(buf, 3, data, 110);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
|
||||
#else
|
||||
mavlink_gps_inject_data_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_INJECT_DATA;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_inject_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param len [bytes] data length
|
||||
* @param data raw data (110 is enough for 12 satellites of RTCMv2)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_inject_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, len);
|
||||
_mav_put_uint8_t_array(buf, 3, data, 110);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
|
||||
#else
|
||||
mavlink_gps_inject_data_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_INJECT_DATA;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_inject_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_inject_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_inject_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_inject_data_t* gps_inject_data)
|
||||
{
|
||||
return mavlink_msg_gps_inject_data_pack(system_id, component_id, msg, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_inject_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_inject_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_inject_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_inject_data_t* gps_inject_data)
|
||||
{
|
||||
return mavlink_msg_gps_inject_data_pack_chan(system_id, component_id, chan, msg, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_inject_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param len [bytes] data length
|
||||
* @param data raw data (110 is enough for 12 satellites of RTCMv2)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_inject_data_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, len);
|
||||
_mav_put_uint8_t_array(buf, 3, data, 110);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
#else
|
||||
mavlink_gps_inject_data_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)&packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_inject_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_inject_data_send_struct(mavlink_channel_t chan, const mavlink_gps_inject_data_t* gps_inject_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_inject_data_send(chan, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)gps_inject_data, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_inject_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, len);
|
||||
_mav_put_uint8_t_array(buf, 3, data, 110);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
#else
|
||||
mavlink_gps_inject_data_t *packet = (mavlink_gps_inject_data_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->len = len;
|
||||
mav_array_memcpy(packet->data, data, sizeof(uint8_t)*110);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_INJECT_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from gps_inject_data message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_inject_data_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from gps_inject_data message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_inject_data_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from gps_inject_data message
|
||||
*
|
||||
* @return [bytes] data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_inject_data_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from gps_inject_data message
|
||||
*
|
||||
* @return raw data (110 is enough for 12 satellites of RTCMv2)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_inject_data_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 110, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_inject_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_inject_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_inject_data_decode(const mavlink_message_t* msg, mavlink_gps_inject_data_t* gps_inject_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_inject_data->target_system = mavlink_msg_gps_inject_data_get_target_system(msg);
|
||||
gps_inject_data->target_component = mavlink_msg_gps_inject_data_get_target_component(msg);
|
||||
gps_inject_data->len = mavlink_msg_gps_inject_data_get_len(msg);
|
||||
mavlink_msg_gps_inject_data_get_data(msg, gps_inject_data->data);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN? msg->len : MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN;
|
||||
memset(gps_inject_data, 0, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
|
||||
memcpy(gps_inject_data, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,638 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_INPUT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INPUT 232
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_input_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
uint32_t time_week_ms; /*< [ms] GPS time (from start of GPS week)*/
|
||||
int32_t lat; /*< [degE7] Latitude (WGS84)*/
|
||||
int32_t lon; /*< [degE7] Longitude (WGS84)*/
|
||||
float alt; /*< [m] Altitude (AMSL). Positive for up.*/
|
||||
float hdop; /*< [m] GPS HDOP horizontal dilution of position*/
|
||||
float vdop; /*< [m] GPS VDOP vertical dilution of position*/
|
||||
float vn; /*< [m/s] GPS velocity in NORTH direction in earth-fixed NED frame*/
|
||||
float ve; /*< [m/s] GPS velocity in EAST direction in earth-fixed NED frame*/
|
||||
float vd; /*< [m/s] GPS velocity in DOWN direction in earth-fixed NED frame*/
|
||||
float speed_accuracy; /*< [m/s] GPS speed accuracy*/
|
||||
float horiz_accuracy; /*< [m] GPS horizontal accuracy*/
|
||||
float vert_accuracy; /*< [m] GPS vertical accuracy*/
|
||||
uint16_t ignore_flags; /*< Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.*/
|
||||
uint16_t time_week; /*< GPS week number*/
|
||||
uint8_t gps_id; /*< ID of the GPS for multiple GPS inputs*/
|
||||
uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK*/
|
||||
uint8_t satellites_visible; /*< Number of satellites visible.*/
|
||||
}) mavlink_gps_input_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INPUT_LEN 63
|
||||
#define MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN 63
|
||||
#define MAVLINK_MSG_ID_232_LEN 63
|
||||
#define MAVLINK_MSG_ID_232_MIN_LEN 63
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INPUT_CRC 151
|
||||
#define MAVLINK_MSG_ID_232_CRC 151
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_INPUT { \
|
||||
232, \
|
||||
"GPS_INPUT", \
|
||||
18, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_input_t, time_usec) }, \
|
||||
{ "gps_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 60, offsetof(mavlink_gps_input_t, gps_id) }, \
|
||||
{ "ignore_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_gps_input_t, ignore_flags) }, \
|
||||
{ "time_week_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gps_input_t, time_week_ms) }, \
|
||||
{ "time_week", NULL, MAVLINK_TYPE_UINT16_T, 0, 58, offsetof(mavlink_gps_input_t, time_week) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 61, offsetof(mavlink_gps_input_t, fix_type) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_input_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_input_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gps_input_t, alt) }, \
|
||||
{ "hdop", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gps_input_t, hdop) }, \
|
||||
{ "vdop", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gps_input_t, vdop) }, \
|
||||
{ "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gps_input_t, vn) }, \
|
||||
{ "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gps_input_t, ve) }, \
|
||||
{ "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_gps_input_t, vd) }, \
|
||||
{ "speed_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_gps_input_t, speed_accuracy) }, \
|
||||
{ "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_gps_input_t, horiz_accuracy) }, \
|
||||
{ "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_gps_input_t, vert_accuracy) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 62, offsetof(mavlink_gps_input_t, satellites_visible) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_INPUT { \
|
||||
"GPS_INPUT", \
|
||||
18, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_input_t, time_usec) }, \
|
||||
{ "gps_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 60, offsetof(mavlink_gps_input_t, gps_id) }, \
|
||||
{ "ignore_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_gps_input_t, ignore_flags) }, \
|
||||
{ "time_week_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gps_input_t, time_week_ms) }, \
|
||||
{ "time_week", NULL, MAVLINK_TYPE_UINT16_T, 0, 58, offsetof(mavlink_gps_input_t, time_week) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 61, offsetof(mavlink_gps_input_t, fix_type) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_input_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_input_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gps_input_t, alt) }, \
|
||||
{ "hdop", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gps_input_t, hdop) }, \
|
||||
{ "vdop", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gps_input_t, vdop) }, \
|
||||
{ "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gps_input_t, vn) }, \
|
||||
{ "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gps_input_t, ve) }, \
|
||||
{ "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_gps_input_t, vd) }, \
|
||||
{ "speed_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_gps_input_t, speed_accuracy) }, \
|
||||
{ "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_gps_input_t, horiz_accuracy) }, \
|
||||
{ "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_gps_input_t, vert_accuracy) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 62, offsetof(mavlink_gps_input_t, satellites_visible) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_input message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param gps_id ID of the GPS for multiple GPS inputs
|
||||
* @param ignore_flags Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.
|
||||
* @param time_week_ms [ms] GPS time (from start of GPS week)
|
||||
* @param time_week GPS week number
|
||||
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [m] Altitude (AMSL). Positive for up.
|
||||
* @param hdop [m] GPS HDOP horizontal dilution of position
|
||||
* @param vdop [m] GPS VDOP vertical dilution of position
|
||||
* @param vn [m/s] GPS velocity in NORTH direction in earth-fixed NED frame
|
||||
* @param ve [m/s] GPS velocity in EAST direction in earth-fixed NED frame
|
||||
* @param vd [m/s] GPS velocity in DOWN direction in earth-fixed NED frame
|
||||
* @param speed_accuracy [m/s] GPS speed accuracy
|
||||
* @param horiz_accuracy [m] GPS horizontal accuracy
|
||||
* @param vert_accuracy [m] GPS vertical accuracy
|
||||
* @param satellites_visible Number of satellites visible.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t gps_id, uint16_t ignore_flags, uint32_t time_week_ms, uint16_t time_week, uint8_t fix_type, int32_t lat, int32_t lon, float alt, float hdop, float vdop, float vn, float ve, float vd, float speed_accuracy, float horiz_accuracy, float vert_accuracy, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INPUT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, time_week_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_float(buf, 20, alt);
|
||||
_mav_put_float(buf, 24, hdop);
|
||||
_mav_put_float(buf, 28, vdop);
|
||||
_mav_put_float(buf, 32, vn);
|
||||
_mav_put_float(buf, 36, ve);
|
||||
_mav_put_float(buf, 40, vd);
|
||||
_mav_put_float(buf, 44, speed_accuracy);
|
||||
_mav_put_float(buf, 48, horiz_accuracy);
|
||||
_mav_put_float(buf, 52, vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 56, ignore_flags);
|
||||
_mav_put_uint16_t(buf, 58, time_week);
|
||||
_mav_put_uint8_t(buf, 60, gps_id);
|
||||
_mav_put_uint8_t(buf, 61, fix_type);
|
||||
_mav_put_uint8_t(buf, 62, satellites_visible);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INPUT_LEN);
|
||||
#else
|
||||
mavlink_gps_input_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.time_week_ms = time_week_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.hdop = hdop;
|
||||
packet.vdop = vdop;
|
||||
packet.vn = vn;
|
||||
packet.ve = ve;
|
||||
packet.vd = vd;
|
||||
packet.speed_accuracy = speed_accuracy;
|
||||
packet.horiz_accuracy = horiz_accuracy;
|
||||
packet.vert_accuracy = vert_accuracy;
|
||||
packet.ignore_flags = ignore_flags;
|
||||
packet.time_week = time_week;
|
||||
packet.gps_id = gps_id;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INPUT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_INPUT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_input message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param gps_id ID of the GPS for multiple GPS inputs
|
||||
* @param ignore_flags Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.
|
||||
* @param time_week_ms [ms] GPS time (from start of GPS week)
|
||||
* @param time_week GPS week number
|
||||
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [m] Altitude (AMSL). Positive for up.
|
||||
* @param hdop [m] GPS HDOP horizontal dilution of position
|
||||
* @param vdop [m] GPS VDOP vertical dilution of position
|
||||
* @param vn [m/s] GPS velocity in NORTH direction in earth-fixed NED frame
|
||||
* @param ve [m/s] GPS velocity in EAST direction in earth-fixed NED frame
|
||||
* @param vd [m/s] GPS velocity in DOWN direction in earth-fixed NED frame
|
||||
* @param speed_accuracy [m/s] GPS speed accuracy
|
||||
* @param horiz_accuracy [m] GPS horizontal accuracy
|
||||
* @param vert_accuracy [m] GPS vertical accuracy
|
||||
* @param satellites_visible Number of satellites visible.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t gps_id,uint16_t ignore_flags,uint32_t time_week_ms,uint16_t time_week,uint8_t fix_type,int32_t lat,int32_t lon,float alt,float hdop,float vdop,float vn,float ve,float vd,float speed_accuracy,float horiz_accuracy,float vert_accuracy,uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INPUT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, time_week_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_float(buf, 20, alt);
|
||||
_mav_put_float(buf, 24, hdop);
|
||||
_mav_put_float(buf, 28, vdop);
|
||||
_mav_put_float(buf, 32, vn);
|
||||
_mav_put_float(buf, 36, ve);
|
||||
_mav_put_float(buf, 40, vd);
|
||||
_mav_put_float(buf, 44, speed_accuracy);
|
||||
_mav_put_float(buf, 48, horiz_accuracy);
|
||||
_mav_put_float(buf, 52, vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 56, ignore_flags);
|
||||
_mav_put_uint16_t(buf, 58, time_week);
|
||||
_mav_put_uint8_t(buf, 60, gps_id);
|
||||
_mav_put_uint8_t(buf, 61, fix_type);
|
||||
_mav_put_uint8_t(buf, 62, satellites_visible);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INPUT_LEN);
|
||||
#else
|
||||
mavlink_gps_input_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.time_week_ms = time_week_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.hdop = hdop;
|
||||
packet.vdop = vdop;
|
||||
packet.vn = vn;
|
||||
packet.ve = ve;
|
||||
packet.vd = vd;
|
||||
packet.speed_accuracy = speed_accuracy;
|
||||
packet.horiz_accuracy = horiz_accuracy;
|
||||
packet.vert_accuracy = vert_accuracy;
|
||||
packet.ignore_flags = ignore_flags;
|
||||
packet.time_week = time_week;
|
||||
packet.gps_id = gps_id;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INPUT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_INPUT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_input struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_input C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_input_t* gps_input)
|
||||
{
|
||||
return mavlink_msg_gps_input_pack(system_id, component_id, msg, gps_input->time_usec, gps_input->gps_id, gps_input->ignore_flags, gps_input->time_week_ms, gps_input->time_week, gps_input->fix_type, gps_input->lat, gps_input->lon, gps_input->alt, gps_input->hdop, gps_input->vdop, gps_input->vn, gps_input->ve, gps_input->vd, gps_input->speed_accuracy, gps_input->horiz_accuracy, gps_input->vert_accuracy, gps_input->satellites_visible);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_input struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_input C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_input_t* gps_input)
|
||||
{
|
||||
return mavlink_msg_gps_input_pack_chan(system_id, component_id, chan, msg, gps_input->time_usec, gps_input->gps_id, gps_input->ignore_flags, gps_input->time_week_ms, gps_input->time_week, gps_input->fix_type, gps_input->lat, gps_input->lon, gps_input->alt, gps_input->hdop, gps_input->vdop, gps_input->vn, gps_input->ve, gps_input->vd, gps_input->speed_accuracy, gps_input->horiz_accuracy, gps_input->vert_accuracy, gps_input->satellites_visible);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_input message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param gps_id ID of the GPS for multiple GPS inputs
|
||||
* @param ignore_flags Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.
|
||||
* @param time_week_ms [ms] GPS time (from start of GPS week)
|
||||
* @param time_week GPS week number
|
||||
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [m] Altitude (AMSL). Positive for up.
|
||||
* @param hdop [m] GPS HDOP horizontal dilution of position
|
||||
* @param vdop [m] GPS VDOP vertical dilution of position
|
||||
* @param vn [m/s] GPS velocity in NORTH direction in earth-fixed NED frame
|
||||
* @param ve [m/s] GPS velocity in EAST direction in earth-fixed NED frame
|
||||
* @param vd [m/s] GPS velocity in DOWN direction in earth-fixed NED frame
|
||||
* @param speed_accuracy [m/s] GPS speed accuracy
|
||||
* @param horiz_accuracy [m] GPS horizontal accuracy
|
||||
* @param vert_accuracy [m] GPS vertical accuracy
|
||||
* @param satellites_visible Number of satellites visible.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_input_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t gps_id, uint16_t ignore_flags, uint32_t time_week_ms, uint16_t time_week, uint8_t fix_type, int32_t lat, int32_t lon, float alt, float hdop, float vdop, float vn, float ve, float vd, float speed_accuracy, float horiz_accuracy, float vert_accuracy, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INPUT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, time_week_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_float(buf, 20, alt);
|
||||
_mav_put_float(buf, 24, hdop);
|
||||
_mav_put_float(buf, 28, vdop);
|
||||
_mav_put_float(buf, 32, vn);
|
||||
_mav_put_float(buf, 36, ve);
|
||||
_mav_put_float(buf, 40, vd);
|
||||
_mav_put_float(buf, 44, speed_accuracy);
|
||||
_mav_put_float(buf, 48, horiz_accuracy);
|
||||
_mav_put_float(buf, 52, vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 56, ignore_flags);
|
||||
_mav_put_uint16_t(buf, 58, time_week);
|
||||
_mav_put_uint8_t(buf, 60, gps_id);
|
||||
_mav_put_uint8_t(buf, 61, fix_type);
|
||||
_mav_put_uint8_t(buf, 62, satellites_visible);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, buf, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
#else
|
||||
mavlink_gps_input_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.time_week_ms = time_week_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.hdop = hdop;
|
||||
packet.vdop = vdop;
|
||||
packet.vn = vn;
|
||||
packet.ve = ve;
|
||||
packet.vd = vd;
|
||||
packet.speed_accuracy = speed_accuracy;
|
||||
packet.horiz_accuracy = horiz_accuracy;
|
||||
packet.vert_accuracy = vert_accuracy;
|
||||
packet.ignore_flags = ignore_flags;
|
||||
packet.time_week = time_week;
|
||||
packet.gps_id = gps_id;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, (const char *)&packet, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_input message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_input_send_struct(mavlink_channel_t chan, const mavlink_gps_input_t* gps_input)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_input_send(chan, gps_input->time_usec, gps_input->gps_id, gps_input->ignore_flags, gps_input->time_week_ms, gps_input->time_week, gps_input->fix_type, gps_input->lat, gps_input->lon, gps_input->alt, gps_input->hdop, gps_input->vdop, gps_input->vn, gps_input->ve, gps_input->vd, gps_input->speed_accuracy, gps_input->horiz_accuracy, gps_input->vert_accuracy, gps_input->satellites_visible);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, (const char *)gps_input, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_INPUT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_input_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t gps_id, uint16_t ignore_flags, uint32_t time_week_ms, uint16_t time_week, uint8_t fix_type, int32_t lat, int32_t lon, float alt, float hdop, float vdop, float vn, float ve, float vd, float speed_accuracy, float horiz_accuracy, float vert_accuracy, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, time_week_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_float(buf, 20, alt);
|
||||
_mav_put_float(buf, 24, hdop);
|
||||
_mav_put_float(buf, 28, vdop);
|
||||
_mav_put_float(buf, 32, vn);
|
||||
_mav_put_float(buf, 36, ve);
|
||||
_mav_put_float(buf, 40, vd);
|
||||
_mav_put_float(buf, 44, speed_accuracy);
|
||||
_mav_put_float(buf, 48, horiz_accuracy);
|
||||
_mav_put_float(buf, 52, vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 56, ignore_flags);
|
||||
_mav_put_uint16_t(buf, 58, time_week);
|
||||
_mav_put_uint8_t(buf, 60, gps_id);
|
||||
_mav_put_uint8_t(buf, 61, fix_type);
|
||||
_mav_put_uint8_t(buf, 62, satellites_visible);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, buf, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
#else
|
||||
mavlink_gps_input_t *packet = (mavlink_gps_input_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->time_week_ms = time_week_ms;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->hdop = hdop;
|
||||
packet->vdop = vdop;
|
||||
packet->vn = vn;
|
||||
packet->ve = ve;
|
||||
packet->vd = vd;
|
||||
packet->speed_accuracy = speed_accuracy;
|
||||
packet->horiz_accuracy = horiz_accuracy;
|
||||
packet->vert_accuracy = vert_accuracy;
|
||||
packet->ignore_flags = ignore_flags;
|
||||
packet->time_week = time_week;
|
||||
packet->gps_id = gps_id;
|
||||
packet->fix_type = fix_type;
|
||||
packet->satellites_visible = satellites_visible;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, (const char *)packet, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_INPUT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from gps_input message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_gps_input_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gps_id from gps_input message
|
||||
*
|
||||
* @return ID of the GPS for multiple GPS inputs
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_input_get_gps_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ignore_flags from gps_input message
|
||||
*
|
||||
* @return Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_get_ignore_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 56);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_week_ms from gps_input message
|
||||
*
|
||||
* @return [ms] GPS time (from start of GPS week)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_input_get_time_week_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_week from gps_input message
|
||||
*
|
||||
* @return GPS week number
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_get_time_week(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 58);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fix_type from gps_input message
|
||||
*
|
||||
* @return 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_input_get_fix_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 61);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from gps_input message
|
||||
*
|
||||
* @return [degE7] Latitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_input_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from gps_input message
|
||||
*
|
||||
* @return [degE7] Longitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_input_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from gps_input message
|
||||
*
|
||||
* @return [m] Altitude (AMSL). Positive for up.
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field hdop from gps_input message
|
||||
*
|
||||
* @return [m] GPS HDOP horizontal dilution of position
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_hdop(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vdop from gps_input message
|
||||
*
|
||||
* @return [m] GPS VDOP vertical dilution of position
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_vdop(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vn from gps_input message
|
||||
*
|
||||
* @return [m/s] GPS velocity in NORTH direction in earth-fixed NED frame
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_vn(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ve from gps_input message
|
||||
*
|
||||
* @return [m/s] GPS velocity in EAST direction in earth-fixed NED frame
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_ve(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vd from gps_input message
|
||||
*
|
||||
* @return [m/s] GPS velocity in DOWN direction in earth-fixed NED frame
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_vd(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field speed_accuracy from gps_input message
|
||||
*
|
||||
* @return [m/s] GPS speed accuracy
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_speed_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field horiz_accuracy from gps_input message
|
||||
*
|
||||
* @return [m] GPS horizontal accuracy
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_horiz_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vert_accuracy from gps_input message
|
||||
*
|
||||
* @return [m] GPS vertical accuracy
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_vert_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellites_visible from gps_input message
|
||||
*
|
||||
* @return Number of satellites visible.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_input_get_satellites_visible(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 62);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_input message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_input C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_input_decode(const mavlink_message_t* msg, mavlink_gps_input_t* gps_input)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_input->time_usec = mavlink_msg_gps_input_get_time_usec(msg);
|
||||
gps_input->time_week_ms = mavlink_msg_gps_input_get_time_week_ms(msg);
|
||||
gps_input->lat = mavlink_msg_gps_input_get_lat(msg);
|
||||
gps_input->lon = mavlink_msg_gps_input_get_lon(msg);
|
||||
gps_input->alt = mavlink_msg_gps_input_get_alt(msg);
|
||||
gps_input->hdop = mavlink_msg_gps_input_get_hdop(msg);
|
||||
gps_input->vdop = mavlink_msg_gps_input_get_vdop(msg);
|
||||
gps_input->vn = mavlink_msg_gps_input_get_vn(msg);
|
||||
gps_input->ve = mavlink_msg_gps_input_get_ve(msg);
|
||||
gps_input->vd = mavlink_msg_gps_input_get_vd(msg);
|
||||
gps_input->speed_accuracy = mavlink_msg_gps_input_get_speed_accuracy(msg);
|
||||
gps_input->horiz_accuracy = mavlink_msg_gps_input_get_horiz_accuracy(msg);
|
||||
gps_input->vert_accuracy = mavlink_msg_gps_input_get_vert_accuracy(msg);
|
||||
gps_input->ignore_flags = mavlink_msg_gps_input_get_ignore_flags(msg);
|
||||
gps_input->time_week = mavlink_msg_gps_input_get_time_week(msg);
|
||||
gps_input->gps_id = mavlink_msg_gps_input_get_gps_id(msg);
|
||||
gps_input->fix_type = mavlink_msg_gps_input_get_fix_type(msg);
|
||||
gps_input->satellites_visible = mavlink_msg_gps_input_get_satellites_visible(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_INPUT_LEN? msg->len : MAVLINK_MSG_ID_GPS_INPUT_LEN;
|
||||
memset(gps_input, 0, MAVLINK_MSG_ID_GPS_INPUT_LEN);
|
||||
memcpy(gps_input, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,563 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_RAW_INT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RAW_INT 24
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_raw_int_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
int32_t lat; /*< [degE7] Latitude (WGS84, EGM96 ellipsoid)*/
|
||||
int32_t lon; /*< [degE7] Longitude (WGS84, EGM96 ellipsoid)*/
|
||||
int32_t alt; /*< [mm] Altitude (AMSL). Positive for up. Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.*/
|
||||
uint16_t eph; /*< GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX*/
|
||||
uint16_t epv; /*< GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX*/
|
||||
uint16_t vel; /*< [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX*/
|
||||
uint16_t cog; /*< [cdeg] Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/
|
||||
uint8_t fix_type; /*< GPS fix type.*/
|
||||
uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/
|
||||
int32_t alt_ellipsoid; /*< [mm] Altitude (above WGS84, EGM96 ellipsoid). Positive for up.*/
|
||||
uint32_t h_acc; /*< [mm] Position uncertainty. Positive for up.*/
|
||||
uint32_t v_acc; /*< [mm] Altitude uncertainty. Positive for up.*/
|
||||
uint32_t vel_acc; /*< [mm] Speed uncertainty. Positive for up.*/
|
||||
uint32_t hdg_acc; /*< [degE5] Heading / track uncertainty*/
|
||||
}) mavlink_gps_raw_int_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RAW_INT_LEN 50
|
||||
#define MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN 30
|
||||
#define MAVLINK_MSG_ID_24_LEN 50
|
||||
#define MAVLINK_MSG_ID_24_MIN_LEN 30
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RAW_INT_CRC 24
|
||||
#define MAVLINK_MSG_ID_24_CRC 24
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \
|
||||
24, \
|
||||
"GPS_RAW_INT", \
|
||||
15, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_gps_raw_int_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_gps_raw_int_t, epv) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps_raw_int_t, vel) }, \
|
||||
{ "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps_raw_int_t, cog) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \
|
||||
{ "alt_ellipsoid", NULL, MAVLINK_TYPE_INT32_T, 0, 30, offsetof(mavlink_gps_raw_int_t, alt_ellipsoid) }, \
|
||||
{ "h_acc", NULL, MAVLINK_TYPE_UINT32_T, 0, 34, offsetof(mavlink_gps_raw_int_t, h_acc) }, \
|
||||
{ "v_acc", NULL, MAVLINK_TYPE_UINT32_T, 0, 38, offsetof(mavlink_gps_raw_int_t, v_acc) }, \
|
||||
{ "vel_acc", NULL, MAVLINK_TYPE_UINT32_T, 0, 42, offsetof(mavlink_gps_raw_int_t, vel_acc) }, \
|
||||
{ "hdg_acc", NULL, MAVLINK_TYPE_UINT32_T, 0, 46, offsetof(mavlink_gps_raw_int_t, hdg_acc) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \
|
||||
"GPS_RAW_INT", \
|
||||
15, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_gps_raw_int_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_gps_raw_int_t, epv) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps_raw_int_t, vel) }, \
|
||||
{ "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps_raw_int_t, cog) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \
|
||||
{ "alt_ellipsoid", NULL, MAVLINK_TYPE_INT32_T, 0, 30, offsetof(mavlink_gps_raw_int_t, alt_ellipsoid) }, \
|
||||
{ "h_acc", NULL, MAVLINK_TYPE_UINT32_T, 0, 34, offsetof(mavlink_gps_raw_int_t, h_acc) }, \
|
||||
{ "v_acc", NULL, MAVLINK_TYPE_UINT32_T, 0, 38, offsetof(mavlink_gps_raw_int_t, v_acc) }, \
|
||||
{ "vel_acc", NULL, MAVLINK_TYPE_UINT32_T, 0, 42, offsetof(mavlink_gps_raw_int_t, vel_acc) }, \
|
||||
{ "hdg_acc", NULL, MAVLINK_TYPE_UINT32_T, 0, 46, offsetof(mavlink_gps_raw_int_t, hdg_acc) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_raw_int message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param fix_type GPS fix type.
|
||||
* @param lat [degE7] Latitude (WGS84, EGM96 ellipsoid)
|
||||
* @param lon [degE7] Longitude (WGS84, EGM96 ellipsoid)
|
||||
* @param alt [mm] Altitude (AMSL). Positive for up. Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
|
||||
* @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX
|
||||
* @param cog [cdeg] Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @param alt_ellipsoid [mm] Altitude (above WGS84, EGM96 ellipsoid). Positive for up.
|
||||
* @param h_acc [mm] Position uncertainty. Positive for up.
|
||||
* @param v_acc [mm] Altitude uncertainty. Positive for up.
|
||||
* @param vel_acc [mm] Speed uncertainty. Positive for up.
|
||||
* @param hdg_acc [degE5] Heading / track uncertainty
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, int32_t alt_ellipsoid, uint32_t h_acc, uint32_t v_acc, uint32_t vel_acc, uint32_t hdg_acc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_uint16_t(buf, 26, cog);
|
||||
_mav_put_uint8_t(buf, 28, fix_type);
|
||||
_mav_put_uint8_t(buf, 29, satellites_visible);
|
||||
_mav_put_int32_t(buf, 30, alt_ellipsoid);
|
||||
_mav_put_uint32_t(buf, 34, h_acc);
|
||||
_mav_put_uint32_t(buf, 38, v_acc);
|
||||
_mav_put_uint32_t(buf, 42, vel_acc);
|
||||
_mav_put_uint32_t(buf, 46, hdg_acc);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
|
||||
#else
|
||||
mavlink_gps_raw_int_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
packet.alt_ellipsoid = alt_ellipsoid;
|
||||
packet.h_acc = h_acc;
|
||||
packet.v_acc = v_acc;
|
||||
packet.vel_acc = vel_acc;
|
||||
packet.hdg_acc = hdg_acc;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_raw_int message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param fix_type GPS fix type.
|
||||
* @param lat [degE7] Latitude (WGS84, EGM96 ellipsoid)
|
||||
* @param lon [degE7] Longitude (WGS84, EGM96 ellipsoid)
|
||||
* @param alt [mm] Altitude (AMSL). Positive for up. Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
|
||||
* @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX
|
||||
* @param cog [cdeg] Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @param alt_ellipsoid [mm] Altitude (above WGS84, EGM96 ellipsoid). Positive for up.
|
||||
* @param h_acc [mm] Position uncertainty. Positive for up.
|
||||
* @param v_acc [mm] Altitude uncertainty. Positive for up.
|
||||
* @param vel_acc [mm] Speed uncertainty. Positive for up.
|
||||
* @param hdg_acc [degE5] Heading / track uncertainty
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible,int32_t alt_ellipsoid,uint32_t h_acc,uint32_t v_acc,uint32_t vel_acc,uint32_t hdg_acc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_uint16_t(buf, 26, cog);
|
||||
_mav_put_uint8_t(buf, 28, fix_type);
|
||||
_mav_put_uint8_t(buf, 29, satellites_visible);
|
||||
_mav_put_int32_t(buf, 30, alt_ellipsoid);
|
||||
_mav_put_uint32_t(buf, 34, h_acc);
|
||||
_mav_put_uint32_t(buf, 38, v_acc);
|
||||
_mav_put_uint32_t(buf, 42, vel_acc);
|
||||
_mav_put_uint32_t(buf, 46, hdg_acc);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
|
||||
#else
|
||||
mavlink_gps_raw_int_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
packet.alt_ellipsoid = alt_ellipsoid;
|
||||
packet.h_acc = h_acc;
|
||||
packet.v_acc = v_acc;
|
||||
packet.vel_acc = vel_acc;
|
||||
packet.hdg_acc = hdg_acc;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_raw_int struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_raw_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_raw_int_t* gps_raw_int)
|
||||
{
|
||||
return mavlink_msg_gps_raw_int_pack(system_id, component_id, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible, gps_raw_int->alt_ellipsoid, gps_raw_int->h_acc, gps_raw_int->v_acc, gps_raw_int->vel_acc, gps_raw_int->hdg_acc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_raw_int struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_raw_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_raw_int_t* gps_raw_int)
|
||||
{
|
||||
return mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, chan, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible, gps_raw_int->alt_ellipsoid, gps_raw_int->h_acc, gps_raw_int->v_acc, gps_raw_int->vel_acc, gps_raw_int->hdg_acc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_raw_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param fix_type GPS fix type.
|
||||
* @param lat [degE7] Latitude (WGS84, EGM96 ellipsoid)
|
||||
* @param lon [degE7] Longitude (WGS84, EGM96 ellipsoid)
|
||||
* @param alt [mm] Altitude (AMSL). Positive for up. Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
|
||||
* @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param vel [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX
|
||||
* @param cog [cdeg] Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @param alt_ellipsoid [mm] Altitude (above WGS84, EGM96 ellipsoid). Positive for up.
|
||||
* @param h_acc [mm] Position uncertainty. Positive for up.
|
||||
* @param v_acc [mm] Altitude uncertainty. Positive for up.
|
||||
* @param vel_acc [mm] Speed uncertainty. Positive for up.
|
||||
* @param hdg_acc [degE5] Heading / track uncertainty
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_raw_int_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, int32_t alt_ellipsoid, uint32_t h_acc, uint32_t v_acc, uint32_t vel_acc, uint32_t hdg_acc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_uint16_t(buf, 26, cog);
|
||||
_mav_put_uint8_t(buf, 28, fix_type);
|
||||
_mav_put_uint8_t(buf, 29, satellites_visible);
|
||||
_mav_put_int32_t(buf, 30, alt_ellipsoid);
|
||||
_mav_put_uint32_t(buf, 34, h_acc);
|
||||
_mav_put_uint32_t(buf, 38, v_acc);
|
||||
_mav_put_uint32_t(buf, 42, vel_acc);
|
||||
_mav_put_uint32_t(buf, 46, hdg_acc);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
#else
|
||||
mavlink_gps_raw_int_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
packet.alt_ellipsoid = alt_ellipsoid;
|
||||
packet.h_acc = h_acc;
|
||||
packet.v_acc = v_acc;
|
||||
packet.vel_acc = vel_acc;
|
||||
packet.hdg_acc = hdg_acc;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)&packet, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_raw_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_raw_int_send_struct(mavlink_channel_t chan, const mavlink_gps_raw_int_t* gps_raw_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_raw_int_send(chan, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible, gps_raw_int->alt_ellipsoid, gps_raw_int->h_acc, gps_raw_int->v_acc, gps_raw_int->vel_acc, gps_raw_int->hdg_acc);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)gps_raw_int, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_RAW_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_raw_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, int32_t alt_ellipsoid, uint32_t h_acc, uint32_t v_acc, uint32_t vel_acc, uint32_t hdg_acc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_uint16_t(buf, 26, cog);
|
||||
_mav_put_uint8_t(buf, 28, fix_type);
|
||||
_mav_put_uint8_t(buf, 29, satellites_visible);
|
||||
_mav_put_int32_t(buf, 30, alt_ellipsoid);
|
||||
_mav_put_uint32_t(buf, 34, h_acc);
|
||||
_mav_put_uint32_t(buf, 38, v_acc);
|
||||
_mav_put_uint32_t(buf, 42, vel_acc);
|
||||
_mav_put_uint32_t(buf, 46, hdg_acc);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
#else
|
||||
mavlink_gps_raw_int_t *packet = (mavlink_gps_raw_int_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->eph = eph;
|
||||
packet->epv = epv;
|
||||
packet->vel = vel;
|
||||
packet->cog = cog;
|
||||
packet->fix_type = fix_type;
|
||||
packet->satellites_visible = satellites_visible;
|
||||
packet->alt_ellipsoid = alt_ellipsoid;
|
||||
packet->h_acc = h_acc;
|
||||
packet->v_acc = v_acc;
|
||||
packet->vel_acc = vel_acc;
|
||||
packet->hdg_acc = hdg_acc;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)packet, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_RAW_INT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from gps_raw_int message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_gps_raw_int_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fix_type from gps_raw_int message
|
||||
*
|
||||
* @return GPS fix type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_raw_int_get_fix_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from gps_raw_int message
|
||||
*
|
||||
* @return [degE7] Latitude (WGS84, EGM96 ellipsoid)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_raw_int_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from gps_raw_int message
|
||||
*
|
||||
* @return [degE7] Longitude (WGS84, EGM96 ellipsoid)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from gps_raw_int message
|
||||
*
|
||||
* @return [mm] Altitude (AMSL). Positive for up. Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_raw_int_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field eph from gps_raw_int message
|
||||
*
|
||||
* @return GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_get_eph(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field epv from gps_raw_int message
|
||||
*
|
||||
* @return GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_get_epv(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel from gps_raw_int message
|
||||
*
|
||||
* @return [cm/s] GPS ground speed. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_get_vel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cog from gps_raw_int message
|
||||
*
|
||||
* @return [cdeg] Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_get_cog(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellites_visible from gps_raw_int message
|
||||
*
|
||||
* @return Number of satellites visible. If unknown, set to 255
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_raw_int_get_satellites_visible(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 29);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt_ellipsoid from gps_raw_int message
|
||||
*
|
||||
* @return [mm] Altitude (above WGS84, EGM96 ellipsoid). Positive for up.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_raw_int_get_alt_ellipsoid(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field h_acc from gps_raw_int message
|
||||
*
|
||||
* @return [mm] Position uncertainty. Positive for up.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_raw_int_get_h_acc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field v_acc from gps_raw_int message
|
||||
*
|
||||
* @return [mm] Altitude uncertainty. Positive for up.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_raw_int_get_v_acc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 38);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel_acc from gps_raw_int message
|
||||
*
|
||||
* @return [mm] Speed uncertainty. Positive for up.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_raw_int_get_vel_acc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 42);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field hdg_acc from gps_raw_int message
|
||||
*
|
||||
* @return [degE5] Heading / track uncertainty
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_raw_int_get_hdg_acc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 46);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_raw_int message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_raw_int C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_raw_int_decode(const mavlink_message_t* msg, mavlink_gps_raw_int_t* gps_raw_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_raw_int->time_usec = mavlink_msg_gps_raw_int_get_time_usec(msg);
|
||||
gps_raw_int->lat = mavlink_msg_gps_raw_int_get_lat(msg);
|
||||
gps_raw_int->lon = mavlink_msg_gps_raw_int_get_lon(msg);
|
||||
gps_raw_int->alt = mavlink_msg_gps_raw_int_get_alt(msg);
|
||||
gps_raw_int->eph = mavlink_msg_gps_raw_int_get_eph(msg);
|
||||
gps_raw_int->epv = mavlink_msg_gps_raw_int_get_epv(msg);
|
||||
gps_raw_int->vel = mavlink_msg_gps_raw_int_get_vel(msg);
|
||||
gps_raw_int->cog = mavlink_msg_gps_raw_int_get_cog(msg);
|
||||
gps_raw_int->fix_type = mavlink_msg_gps_raw_int_get_fix_type(msg);
|
||||
gps_raw_int->satellites_visible = mavlink_msg_gps_raw_int_get_satellites_visible(msg);
|
||||
gps_raw_int->alt_ellipsoid = mavlink_msg_gps_raw_int_get_alt_ellipsoid(msg);
|
||||
gps_raw_int->h_acc = mavlink_msg_gps_raw_int_get_h_acc(msg);
|
||||
gps_raw_int->v_acc = mavlink_msg_gps_raw_int_get_v_acc(msg);
|
||||
gps_raw_int->vel_acc = mavlink_msg_gps_raw_int_get_vel_acc(msg);
|
||||
gps_raw_int->hdg_acc = mavlink_msg_gps_raw_int_get_hdg_acc(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RAW_INT_LEN? msg->len : MAVLINK_MSG_ID_GPS_RAW_INT_LEN;
|
||||
memset(gps_raw_int, 0, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
|
||||
memcpy(gps_raw_int, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_RTCM_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTCM_DATA 233
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_rtcm_data_t {
|
||||
uint8_t flags; /*< LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order.*/
|
||||
uint8_t len; /*< [bytes] data length*/
|
||||
uint8_t data[180]; /*< RTCM message (may be fragmented)*/
|
||||
}) mavlink_gps_rtcm_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN 182
|
||||
#define MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN 182
|
||||
#define MAVLINK_MSG_ID_233_LEN 182
|
||||
#define MAVLINK_MSG_ID_233_MIN_LEN 182
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC 35
|
||||
#define MAVLINK_MSG_ID_233_CRC 35
|
||||
|
||||
#define MAVLINK_MSG_GPS_RTCM_DATA_FIELD_DATA_LEN 180
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RTCM_DATA { \
|
||||
233, \
|
||||
"GPS_RTCM_DATA", \
|
||||
3, \
|
||||
{ { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_rtcm_data_t, flags) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_rtcm_data_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 180, 2, offsetof(mavlink_gps_rtcm_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RTCM_DATA { \
|
||||
"GPS_RTCM_DATA", \
|
||||
3, \
|
||||
{ { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_rtcm_data_t, flags) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_rtcm_data_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 180, 2, offsetof(mavlink_gps_rtcm_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_rtcm_data message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param flags LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order.
|
||||
* @param len [bytes] data length
|
||||
* @param data RTCM message (may be fragmented)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtcm_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t flags, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, flags);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 180);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
|
||||
#else
|
||||
mavlink_gps_rtcm_data_t packet;
|
||||
packet.flags = flags;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*180);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RTCM_DATA;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_rtcm_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param flags LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order.
|
||||
* @param len [bytes] data length
|
||||
* @param data RTCM message (may be fragmented)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtcm_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t flags,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, flags);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 180);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
|
||||
#else
|
||||
mavlink_gps_rtcm_data_t packet;
|
||||
packet.flags = flags;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*180);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RTCM_DATA;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_rtcm_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_rtcm_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtcm_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_rtcm_data_t* gps_rtcm_data)
|
||||
{
|
||||
return mavlink_msg_gps_rtcm_data_pack(system_id, component_id, msg, gps_rtcm_data->flags, gps_rtcm_data->len, gps_rtcm_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_rtcm_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_rtcm_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtcm_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_rtcm_data_t* gps_rtcm_data)
|
||||
{
|
||||
return mavlink_msg_gps_rtcm_data_pack_chan(system_id, component_id, chan, msg, gps_rtcm_data->flags, gps_rtcm_data->len, gps_rtcm_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_rtcm_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param flags LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order.
|
||||
* @param len [bytes] data length
|
||||
* @param data RTCM message (may be fragmented)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_rtcm_data_send(mavlink_channel_t chan, uint8_t flags, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, flags);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 180);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
#else
|
||||
mavlink_gps_rtcm_data_t packet;
|
||||
packet.flags = flags;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*180);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, (const char *)&packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_rtcm_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtcm_data_send_struct(mavlink_channel_t chan, const mavlink_gps_rtcm_data_t* gps_rtcm_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_rtcm_data_send(chan, gps_rtcm_data->flags, gps_rtcm_data->len, gps_rtcm_data->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, (const char *)gps_rtcm_data, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtcm_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t flags, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, flags);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 180);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
#else
|
||||
mavlink_gps_rtcm_data_t *packet = (mavlink_gps_rtcm_data_t *)msgbuf;
|
||||
packet->flags = flags;
|
||||
packet->len = len;
|
||||
mav_array_memcpy(packet->data, data, sizeof(uint8_t)*180);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, (const char *)packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_RTCM_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field flags from gps_rtcm_data message
|
||||
*
|
||||
* @return LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtcm_data_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from gps_rtcm_data message
|
||||
*
|
||||
* @return [bytes] data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtcm_data_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from gps_rtcm_data message
|
||||
*
|
||||
* @return RTCM message (may be fragmented)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtcm_data_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 180, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_rtcm_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_rtcm_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtcm_data_decode(const mavlink_message_t* msg, mavlink_gps_rtcm_data_t* gps_rtcm_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_rtcm_data->flags = mavlink_msg_gps_rtcm_data_get_flags(msg);
|
||||
gps_rtcm_data->len = mavlink_msg_gps_rtcm_data_get_len(msg);
|
||||
mavlink_msg_gps_rtcm_data_get_data(msg, gps_rtcm_data->data);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN? msg->len : MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN;
|
||||
memset(gps_rtcm_data, 0, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
|
||||
memcpy(gps_rtcm_data, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,513 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_RTK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTK 127
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_rtk_t {
|
||||
uint32_t time_last_baseline_ms; /*< [ms] Time since boot of last baseline message received.*/
|
||||
uint32_t tow; /*< [ms] GPS Time of Week of last baseline*/
|
||||
int32_t baseline_a_mm; /*< [mm] Current baseline in ECEF x or NED north component.*/
|
||||
int32_t baseline_b_mm; /*< [mm] Current baseline in ECEF y or NED east component.*/
|
||||
int32_t baseline_c_mm; /*< [mm] Current baseline in ECEF z or NED down component.*/
|
||||
uint32_t accuracy; /*< Current estimate of baseline accuracy.*/
|
||||
int32_t iar_num_hypotheses; /*< Current number of integer ambiguity hypotheses.*/
|
||||
uint16_t wn; /*< GPS Week Number of last baseline*/
|
||||
uint8_t rtk_receiver_id; /*< Identification of connected RTK receiver.*/
|
||||
uint8_t rtk_health; /*< GPS-specific health report for RTK data.*/
|
||||
uint8_t rtk_rate; /*< [Hz] Rate of baseline messages being received by GPS*/
|
||||
uint8_t nsats; /*< Current number of sats used for RTK calculation.*/
|
||||
uint8_t baseline_coords_type; /*< Coordinate system of baseline*/
|
||||
}) mavlink_gps_rtk_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTK_LEN 35
|
||||
#define MAVLINK_MSG_ID_GPS_RTK_MIN_LEN 35
|
||||
#define MAVLINK_MSG_ID_127_LEN 35
|
||||
#define MAVLINK_MSG_ID_127_MIN_LEN 35
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTK_CRC 25
|
||||
#define MAVLINK_MSG_ID_127_CRC 25
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RTK { \
|
||||
127, \
|
||||
"GPS_RTK", \
|
||||
13, \
|
||||
{ { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \
|
||||
{ "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \
|
||||
{ "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \
|
||||
{ "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \
|
||||
{ "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \
|
||||
{ "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \
|
||||
{ "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \
|
||||
{ "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \
|
||||
{ "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \
|
||||
{ "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \
|
||||
{ "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_rtk_t, baseline_c_mm) }, \
|
||||
{ "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps_rtk_t, accuracy) }, \
|
||||
{ "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps_rtk_t, iar_num_hypotheses) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RTK { \
|
||||
"GPS_RTK", \
|
||||
13, \
|
||||
{ { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \
|
||||
{ "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \
|
||||
{ "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \
|
||||
{ "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \
|
||||
{ "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \
|
||||
{ "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \
|
||||
{ "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \
|
||||
{ "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \
|
||||
{ "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \
|
||||
{ "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \
|
||||
{ "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_rtk_t, baseline_c_mm) }, \
|
||||
{ "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps_rtk_t, accuracy) }, \
|
||||
{ "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps_rtk_t, iar_num_hypotheses) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_rtk message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_last_baseline_ms [ms] Time since boot of last baseline message received.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow [ms] GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate [Hz] Rate of baseline messages being received by GPS
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline
|
||||
* @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component.
|
||||
* @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component.
|
||||
* @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtk_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTK_LEN);
|
||||
#else
|
||||
mavlink_gps_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RTK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_rtk message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_last_baseline_ms [ms] Time since boot of last baseline message received.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow [ms] GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate [Hz] Rate of baseline messages being received by GPS
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline
|
||||
* @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component.
|
||||
* @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component.
|
||||
* @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtk_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_last_baseline_ms,uint8_t rtk_receiver_id,uint16_t wn,uint32_t tow,uint8_t rtk_health,uint8_t rtk_rate,uint8_t nsats,uint8_t baseline_coords_type,int32_t baseline_a_mm,int32_t baseline_b_mm,int32_t baseline_c_mm,uint32_t accuracy,int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTK_LEN);
|
||||
#else
|
||||
mavlink_gps_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RTK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_rtk struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_rtk C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtk_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_rtk_t* gps_rtk)
|
||||
{
|
||||
return mavlink_msg_gps_rtk_pack(system_id, component_id, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_rtk struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_rtk C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtk_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_rtk_t* gps_rtk)
|
||||
{
|
||||
return mavlink_msg_gps_rtk_pack_chan(system_id, component_id, chan, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_rtk message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_last_baseline_ms [ms] Time since boot of last baseline message received.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow [ms] GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate [Hz] Rate of baseline messages being received by GPS
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline
|
||||
* @param baseline_a_mm [mm] Current baseline in ECEF x or NED north component.
|
||||
* @param baseline_b_mm [mm] Current baseline in ECEF y or NED east component.
|
||||
* @param baseline_c_mm [mm] Current baseline in ECEF z or NED down component.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_rtk_send(mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
#else
|
||||
mavlink_gps_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_rtk message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtk_send_struct(mavlink_channel_t chan, const mavlink_gps_rtk_t* gps_rtk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_rtk_send(chan, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)gps_rtk, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_RTK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtk_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
#else
|
||||
mavlink_gps_rtk_t *packet = (mavlink_gps_rtk_t *)msgbuf;
|
||||
packet->time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet->tow = tow;
|
||||
packet->baseline_a_mm = baseline_a_mm;
|
||||
packet->baseline_b_mm = baseline_b_mm;
|
||||
packet->baseline_c_mm = baseline_c_mm;
|
||||
packet->accuracy = accuracy;
|
||||
packet->iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet->wn = wn;
|
||||
packet->rtk_receiver_id = rtk_receiver_id;
|
||||
packet->rtk_health = rtk_health;
|
||||
packet->rtk_rate = rtk_rate;
|
||||
packet->nsats = nsats;
|
||||
packet->baseline_coords_type = baseline_coords_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_RTK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_last_baseline_ms from gps_rtk message
|
||||
*
|
||||
* @return [ms] Time since boot of last baseline message received.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_rtk_get_time_last_baseline_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_receiver_id from gps_rtk message
|
||||
*
|
||||
* @return Identification of connected RTK receiver.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtk_get_rtk_receiver_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field wn from gps_rtk message
|
||||
*
|
||||
* @return GPS Week Number of last baseline
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtk_get_wn(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field tow from gps_rtk message
|
||||
*
|
||||
* @return [ms] GPS Time of Week of last baseline
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_rtk_get_tow(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_health from gps_rtk message
|
||||
*
|
||||
* @return GPS-specific health report for RTK data.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtk_get_rtk_health(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_rate from gps_rtk message
|
||||
*
|
||||
* @return [Hz] Rate of baseline messages being received by GPS
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtk_get_rtk_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field nsats from gps_rtk message
|
||||
*
|
||||
* @return Current number of sats used for RTK calculation.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtk_get_nsats(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_coords_type from gps_rtk message
|
||||
*
|
||||
* @return Coordinate system of baseline
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtk_get_baseline_coords_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_a_mm from gps_rtk message
|
||||
*
|
||||
* @return [mm] Current baseline in ECEF x or NED north component.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_rtk_get_baseline_a_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_b_mm from gps_rtk message
|
||||
*
|
||||
* @return [mm] Current baseline in ECEF y or NED east component.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_rtk_get_baseline_b_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_c_mm from gps_rtk message
|
||||
*
|
||||
* @return [mm] Current baseline in ECEF z or NED down component.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_rtk_get_baseline_c_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field accuracy from gps_rtk message
|
||||
*
|
||||
* @return Current estimate of baseline accuracy.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_rtk_get_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field iar_num_hypotheses from gps_rtk message
|
||||
*
|
||||
* @return Current number of integer ambiguity hypotheses.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_rtk_get_iar_num_hypotheses(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_rtk message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_rtk C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtk_decode(const mavlink_message_t* msg, mavlink_gps_rtk_t* gps_rtk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_rtk->time_last_baseline_ms = mavlink_msg_gps_rtk_get_time_last_baseline_ms(msg);
|
||||
gps_rtk->tow = mavlink_msg_gps_rtk_get_tow(msg);
|
||||
gps_rtk->baseline_a_mm = mavlink_msg_gps_rtk_get_baseline_a_mm(msg);
|
||||
gps_rtk->baseline_b_mm = mavlink_msg_gps_rtk_get_baseline_b_mm(msg);
|
||||
gps_rtk->baseline_c_mm = mavlink_msg_gps_rtk_get_baseline_c_mm(msg);
|
||||
gps_rtk->accuracy = mavlink_msg_gps_rtk_get_accuracy(msg);
|
||||
gps_rtk->iar_num_hypotheses = mavlink_msg_gps_rtk_get_iar_num_hypotheses(msg);
|
||||
gps_rtk->wn = mavlink_msg_gps_rtk_get_wn(msg);
|
||||
gps_rtk->rtk_receiver_id = mavlink_msg_gps_rtk_get_rtk_receiver_id(msg);
|
||||
gps_rtk->rtk_health = mavlink_msg_gps_rtk_get_rtk_health(msg);
|
||||
gps_rtk->rtk_rate = mavlink_msg_gps_rtk_get_rtk_rate(msg);
|
||||
gps_rtk->nsats = mavlink_msg_gps_rtk_get_nsats(msg);
|
||||
gps_rtk->baseline_coords_type = mavlink_msg_gps_rtk_get_baseline_coords_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RTK_LEN? msg->len : MAVLINK_MSG_ID_GPS_RTK_LEN;
|
||||
memset(gps_rtk, 0, MAVLINK_MSG_ID_GPS_RTK_LEN);
|
||||
memcpy(gps_rtk, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_STATUS 25
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_status_t {
|
||||
uint8_t satellites_visible; /*< Number of satellites visible*/
|
||||
uint8_t satellite_prn[20]; /*< Global satellite ID*/
|
||||
uint8_t satellite_used[20]; /*< 0: Satellite not used, 1: used for localization*/
|
||||
uint8_t satellite_elevation[20]; /*< [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite*/
|
||||
uint8_t satellite_azimuth[20]; /*< [deg] Direction of satellite, 0: 0 deg, 255: 360 deg.*/
|
||||
uint8_t satellite_snr[20]; /*< [dB] Signal to noise ratio of satellite*/
|
||||
}) mavlink_gps_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_STATUS_LEN 101
|
||||
#define MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN 101
|
||||
#define MAVLINK_MSG_ID_25_LEN 101
|
||||
#define MAVLINK_MSG_ID_25_MIN_LEN 101
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_STATUS_CRC 23
|
||||
#define MAVLINK_MSG_ID_25_CRC 23
|
||||
|
||||
#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_PRN_LEN 20
|
||||
#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_USED_LEN 20
|
||||
#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_ELEVATION_LEN 20
|
||||
#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_AZIMUTH_LEN 20
|
||||
#define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_SNR_LEN 20
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_STATUS { \
|
||||
25, \
|
||||
"GPS_STATUS", \
|
||||
6, \
|
||||
{ { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_status_t, satellites_visible) }, \
|
||||
{ "satellite_prn", NULL, MAVLINK_TYPE_UINT8_T, 20, 1, offsetof(mavlink_gps_status_t, satellite_prn) }, \
|
||||
{ "satellite_used", NULL, MAVLINK_TYPE_UINT8_T, 20, 21, offsetof(mavlink_gps_status_t, satellite_used) }, \
|
||||
{ "satellite_elevation", NULL, MAVLINK_TYPE_UINT8_T, 20, 41, offsetof(mavlink_gps_status_t, satellite_elevation) }, \
|
||||
{ "satellite_azimuth", NULL, MAVLINK_TYPE_UINT8_T, 20, 61, offsetof(mavlink_gps_status_t, satellite_azimuth) }, \
|
||||
{ "satellite_snr", NULL, MAVLINK_TYPE_UINT8_T, 20, 81, offsetof(mavlink_gps_status_t, satellite_snr) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_STATUS { \
|
||||
"GPS_STATUS", \
|
||||
6, \
|
||||
{ { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_status_t, satellites_visible) }, \
|
||||
{ "satellite_prn", NULL, MAVLINK_TYPE_UINT8_T, 20, 1, offsetof(mavlink_gps_status_t, satellite_prn) }, \
|
||||
{ "satellite_used", NULL, MAVLINK_TYPE_UINT8_T, 20, 21, offsetof(mavlink_gps_status_t, satellite_used) }, \
|
||||
{ "satellite_elevation", NULL, MAVLINK_TYPE_UINT8_T, 20, 41, offsetof(mavlink_gps_status_t, satellite_elevation) }, \
|
||||
{ "satellite_azimuth", NULL, MAVLINK_TYPE_UINT8_T, 20, 61, offsetof(mavlink_gps_status_t, satellite_azimuth) }, \
|
||||
{ "satellite_snr", NULL, MAVLINK_TYPE_UINT8_T, 20, 81, offsetof(mavlink_gps_status_t, satellite_snr) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_status message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param satellites_visible Number of satellites visible
|
||||
* @param satellite_prn Global satellite ID
|
||||
* @param satellite_used 0: Satellite not used, 1: used for localization
|
||||
* @param satellite_elevation [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite
|
||||
* @param satellite_azimuth [deg] Direction of satellite, 0: 0 deg, 255: 360 deg.
|
||||
* @param satellite_snr [dB] Signal to noise ratio of satellite
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN];
|
||||
_mav_put_uint8_t(buf, 0, satellites_visible);
|
||||
_mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
|
||||
_mav_put_uint8_t_array(buf, 21, satellite_used, 20);
|
||||
_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
|
||||
_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
|
||||
_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_STATUS_LEN);
|
||||
#else
|
||||
mavlink_gps_status_t packet;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_status message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param satellites_visible Number of satellites visible
|
||||
* @param satellite_prn Global satellite ID
|
||||
* @param satellite_used 0: Satellite not used, 1: used for localization
|
||||
* @param satellite_elevation [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite
|
||||
* @param satellite_azimuth [deg] Direction of satellite, 0: 0 deg, 255: 360 deg.
|
||||
* @param satellite_snr [dB] Signal to noise ratio of satellite
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t satellites_visible,const uint8_t *satellite_prn,const uint8_t *satellite_used,const uint8_t *satellite_elevation,const uint8_t *satellite_azimuth,const uint8_t *satellite_snr)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN];
|
||||
_mav_put_uint8_t(buf, 0, satellites_visible);
|
||||
_mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
|
||||
_mav_put_uint8_t_array(buf, 21, satellite_used, 20);
|
||||
_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
|
||||
_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
|
||||
_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_STATUS_LEN);
|
||||
#else
|
||||
mavlink_gps_status_t packet;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_status_t* gps_status)
|
||||
{
|
||||
return mavlink_msg_gps_status_pack(system_id, component_id, msg, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_status_t* gps_status)
|
||||
{
|
||||
return mavlink_msg_gps_status_pack_chan(system_id, component_id, chan, msg, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param satellites_visible Number of satellites visible
|
||||
* @param satellite_prn Global satellite ID
|
||||
* @param satellite_used 0: Satellite not used, 1: used for localization
|
||||
* @param satellite_elevation [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite
|
||||
* @param satellite_azimuth [deg] Direction of satellite, 0: 0 deg, 255: 360 deg.
|
||||
* @param satellite_snr [dB] Signal to noise ratio of satellite
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_status_send(mavlink_channel_t chan, uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN];
|
||||
_mav_put_uint8_t(buf, 0, satellites_visible);
|
||||
_mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
|
||||
_mav_put_uint8_t_array(buf, 21, satellite_used, 20);
|
||||
_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
|
||||
_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
|
||||
_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
|
||||
#else
|
||||
mavlink_gps_status_t packet;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_status_send_struct(mavlink_channel_t chan, const mavlink_gps_status_t* gps_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_status_send(chan, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)gps_status, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, satellites_visible);
|
||||
_mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
|
||||
_mav_put_uint8_t_array(buf, 21, satellite_used, 20);
|
||||
_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
|
||||
_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
|
||||
_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
|
||||
#else
|
||||
mavlink_gps_status_t *packet = (mavlink_gps_status_t *)msgbuf;
|
||||
packet->satellites_visible = satellites_visible;
|
||||
mav_array_memcpy(packet->satellite_prn, satellite_prn, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet->satellite_used, satellite_used, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet->satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet->satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet->satellite_snr, satellite_snr, sizeof(uint8_t)*20);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)packet, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field satellites_visible from gps_status message
|
||||
*
|
||||
* @return Number of satellites visible
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_status_get_satellites_visible(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellite_prn from gps_status message
|
||||
*
|
||||
* @return Global satellite ID
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_status_get_satellite_prn(const mavlink_message_t* msg, uint8_t *satellite_prn)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, satellite_prn, 20, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellite_used from gps_status message
|
||||
*
|
||||
* @return 0: Satellite not used, 1: used for localization
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_status_get_satellite_used(const mavlink_message_t* msg, uint8_t *satellite_used)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, satellite_used, 20, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellite_elevation from gps_status message
|
||||
*
|
||||
* @return [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_status_get_satellite_elevation(const mavlink_message_t* msg, uint8_t *satellite_elevation)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, satellite_elevation, 20, 41);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellite_azimuth from gps_status message
|
||||
*
|
||||
* @return [deg] Direction of satellite, 0: 0 deg, 255: 360 deg.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_status_get_satellite_azimuth(const mavlink_message_t* msg, uint8_t *satellite_azimuth)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, satellite_azimuth, 20, 61);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellite_snr from gps_status message
|
||||
*
|
||||
* @return [dB] Signal to noise ratio of satellite
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_status_get_satellite_snr(const mavlink_message_t* msg, uint8_t *satellite_snr)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, satellite_snr, 20, 81);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_status_decode(const mavlink_message_t* msg, mavlink_gps_status_t* gps_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_status->satellites_visible = mavlink_msg_gps_status_get_satellites_visible(msg);
|
||||
mavlink_msg_gps_status_get_satellite_prn(msg, gps_status->satellite_prn);
|
||||
mavlink_msg_gps_status_get_satellite_used(msg, gps_status->satellite_used);
|
||||
mavlink_msg_gps_status_get_satellite_elevation(msg, gps_status->satellite_elevation);
|
||||
mavlink_msg_gps_status_get_satellite_azimuth(msg, gps_status->satellite_azimuth);
|
||||
mavlink_msg_gps_status_get_satellite_snr(msg, gps_status->satellite_snr);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_STATUS_LEN? msg->len : MAVLINK_MSG_ID_GPS_STATUS_LEN;
|
||||
memset(gps_status, 0, MAVLINK_MSG_ID_GPS_STATUS_LEN);
|
||||
memcpy(gps_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,335 @@
|
||||
#pragma once
|
||||
// MESSAGE HEARTBEAT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HEARTBEAT 0
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_heartbeat_t {
|
||||
uint32_t custom_mode; /*< A bitfield for use for autopilot-specific flags*/
|
||||
uint8_t type; /*< Type of the MAV (quadrotor, helicopter, etc.)*/
|
||||
uint8_t autopilot; /*< Autopilot type / class.*/
|
||||
uint8_t base_mode; /*< System mode bitmap.*/
|
||||
uint8_t system_status; /*< System status flag.*/
|
||||
uint8_t mavlink_version; /*< MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version*/
|
||||
}) mavlink_heartbeat_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HEARTBEAT_LEN 9
|
||||
#define MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN 9
|
||||
#define MAVLINK_MSG_ID_0_LEN 9
|
||||
#define MAVLINK_MSG_ID_0_MIN_LEN 9
|
||||
|
||||
#define MAVLINK_MSG_ID_HEARTBEAT_CRC 50
|
||||
#define MAVLINK_MSG_ID_0_CRC 50
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HEARTBEAT { \
|
||||
0, \
|
||||
"HEARTBEAT", \
|
||||
6, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \
|
||||
{ "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, autopilot) }, \
|
||||
{ "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, base_mode) }, \
|
||||
{ "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \
|
||||
{ "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, system_status) }, \
|
||||
{ "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, mavlink_version) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HEARTBEAT { \
|
||||
"HEARTBEAT", \
|
||||
6, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \
|
||||
{ "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, autopilot) }, \
|
||||
{ "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, base_mode) }, \
|
||||
{ "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \
|
||||
{ "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, system_status) }, \
|
||||
{ "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, mavlink_version) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a heartbeat message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param type Type of the MAV (quadrotor, helicopter, etc.)
|
||||
* @param autopilot Autopilot type / class.
|
||||
* @param base_mode System mode bitmap.
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags
|
||||
* @param system_status System status flag.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, custom_mode);
|
||||
_mav_put_uint8_t(buf, 4, type);
|
||||
_mav_put_uint8_t(buf, 5, autopilot);
|
||||
_mav_put_uint8_t(buf, 6, base_mode);
|
||||
_mav_put_uint8_t(buf, 7, system_status);
|
||||
_mav_put_uint8_t(buf, 8, 3);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN);
|
||||
#else
|
||||
mavlink_heartbeat_t packet;
|
||||
packet.custom_mode = custom_mode;
|
||||
packet.type = type;
|
||||
packet.autopilot = autopilot;
|
||||
packet.base_mode = base_mode;
|
||||
packet.system_status = system_status;
|
||||
packet.mavlink_version = 3;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a heartbeat message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param type Type of the MAV (quadrotor, helicopter, etc.)
|
||||
* @param autopilot Autopilot type / class.
|
||||
* @param base_mode System mode bitmap.
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags
|
||||
* @param system_status System status flag.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t type,uint8_t autopilot,uint8_t base_mode,uint32_t custom_mode,uint8_t system_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, custom_mode);
|
||||
_mav_put_uint8_t(buf, 4, type);
|
||||
_mav_put_uint8_t(buf, 5, autopilot);
|
||||
_mav_put_uint8_t(buf, 6, base_mode);
|
||||
_mav_put_uint8_t(buf, 7, system_status);
|
||||
_mav_put_uint8_t(buf, 8, 3);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN);
|
||||
#else
|
||||
mavlink_heartbeat_t packet;
|
||||
packet.custom_mode = custom_mode;
|
||||
packet.type = type;
|
||||
packet.autopilot = autopilot;
|
||||
packet.base_mode = base_mode;
|
||||
packet.system_status = system_status;
|
||||
packet.mavlink_version = 3;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a heartbeat struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param heartbeat C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat)
|
||||
{
|
||||
return mavlink_msg_heartbeat_pack(system_id, component_id, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a heartbeat struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param heartbeat C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_heartbeat_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat)
|
||||
{
|
||||
return mavlink_msg_heartbeat_pack_chan(system_id, component_id, chan, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a heartbeat message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type Type of the MAV (quadrotor, helicopter, etc.)
|
||||
* @param autopilot Autopilot type / class.
|
||||
* @param base_mode System mode bitmap.
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags
|
||||
* @param system_status System status flag.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, custom_mode);
|
||||
_mav_put_uint8_t(buf, 4, type);
|
||||
_mav_put_uint8_t(buf, 5, autopilot);
|
||||
_mav_put_uint8_t(buf, 6, base_mode);
|
||||
_mav_put_uint8_t(buf, 7, system_status);
|
||||
_mav_put_uint8_t(buf, 8, 3);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
|
||||
#else
|
||||
mavlink_heartbeat_t packet;
|
||||
packet.custom_mode = custom_mode;
|
||||
packet.type = type;
|
||||
packet.autopilot = autopilot;
|
||||
packet.base_mode = base_mode;
|
||||
packet.system_status = system_status;
|
||||
packet.mavlink_version = 3;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a heartbeat message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_heartbeat_send_struct(mavlink_channel_t chan, const mavlink_heartbeat_t* heartbeat)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_heartbeat_send(chan, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)heartbeat, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HEARTBEAT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_heartbeat_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, custom_mode);
|
||||
_mav_put_uint8_t(buf, 4, type);
|
||||
_mav_put_uint8_t(buf, 5, autopilot);
|
||||
_mav_put_uint8_t(buf, 6, base_mode);
|
||||
_mav_put_uint8_t(buf, 7, system_status);
|
||||
_mav_put_uint8_t(buf, 8, 3);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
|
||||
#else
|
||||
mavlink_heartbeat_t *packet = (mavlink_heartbeat_t *)msgbuf;
|
||||
packet->custom_mode = custom_mode;
|
||||
packet->type = type;
|
||||
packet->autopilot = autopilot;
|
||||
packet->base_mode = base_mode;
|
||||
packet->system_status = system_status;
|
||||
packet->mavlink_version = 3;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)packet, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HEARTBEAT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field type from heartbeat message
|
||||
*
|
||||
* @return Type of the MAV (quadrotor, helicopter, etc.)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_heartbeat_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field autopilot from heartbeat message
|
||||
*
|
||||
* @return Autopilot type / class.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field base_mode from heartbeat message
|
||||
*
|
||||
* @return System mode bitmap.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field custom_mode from heartbeat message
|
||||
*
|
||||
* @return A bitfield for use for autopilot-specific flags
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field system_status from heartbeat message
|
||||
*
|
||||
* @return System status flag.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mavlink_version from heartbeat message
|
||||
*
|
||||
* @return MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_heartbeat_get_mavlink_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a heartbeat message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param heartbeat C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_heartbeat_decode(const mavlink_message_t* msg, mavlink_heartbeat_t* heartbeat)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
heartbeat->custom_mode = mavlink_msg_heartbeat_get_custom_mode(msg);
|
||||
heartbeat->type = mavlink_msg_heartbeat_get_type(msg);
|
||||
heartbeat->autopilot = mavlink_msg_heartbeat_get_autopilot(msg);
|
||||
heartbeat->base_mode = mavlink_msg_heartbeat_get_base_mode(msg);
|
||||
heartbeat->system_status = mavlink_msg_heartbeat_get_system_status(msg);
|
||||
heartbeat->mavlink_version = mavlink_msg_heartbeat_get_mavlink_version(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HEARTBEAT_LEN? msg->len : MAVLINK_MSG_ID_HEARTBEAT_LEN;
|
||||
memset(heartbeat, 0, MAVLINK_MSG_ID_HEARTBEAT_LEN);
|
||||
memcpy(heartbeat, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,788 @@
|
||||
#pragma once
|
||||
// MESSAGE HIGH_LATENCY PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIGH_LATENCY 234
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_high_latency_t {
|
||||
uint32_t custom_mode; /*< A bitfield for use for autopilot-specific flags.*/
|
||||
int32_t latitude; /*< [degE7] Latitude*/
|
||||
int32_t longitude; /*< [degE7] Longitude*/
|
||||
int16_t roll; /*< [cdeg] roll*/
|
||||
int16_t pitch; /*< [cdeg] pitch*/
|
||||
uint16_t heading; /*< [cdeg] heading*/
|
||||
int16_t heading_sp; /*< [cdeg] heading setpoint*/
|
||||
int16_t altitude_amsl; /*< [m] Altitude above mean sea level*/
|
||||
int16_t altitude_sp; /*< [m] Altitude setpoint relative to the home position*/
|
||||
uint16_t wp_distance; /*< [m] distance to target*/
|
||||
uint8_t base_mode; /*< Bitmap of enabled system modes.*/
|
||||
uint8_t landed_state; /*< The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.*/
|
||||
int8_t throttle; /*< [%] throttle (percentage)*/
|
||||
uint8_t airspeed; /*< [m/s] airspeed*/
|
||||
uint8_t airspeed_sp; /*< [m/s] airspeed setpoint*/
|
||||
uint8_t groundspeed; /*< [m/s] groundspeed*/
|
||||
int8_t climb_rate; /*< [m/s] climb rate*/
|
||||
uint8_t gps_nsat; /*< Number of satellites visible. If unknown, set to 255*/
|
||||
uint8_t gps_fix_type; /*< GPS Fix type.*/
|
||||
uint8_t battery_remaining; /*< [%] Remaining battery (percentage)*/
|
||||
int8_t temperature; /*< [degC] Autopilot temperature (degrees C)*/
|
||||
int8_t temperature_air; /*< [degC] Air temperature (degrees C) from airspeed sensor*/
|
||||
uint8_t failsafe; /*< failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)*/
|
||||
uint8_t wp_num; /*< current waypoint number*/
|
||||
}) mavlink_high_latency_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIGH_LATENCY_LEN 40
|
||||
#define MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN 40
|
||||
#define MAVLINK_MSG_ID_234_LEN 40
|
||||
#define MAVLINK_MSG_ID_234_MIN_LEN 40
|
||||
|
||||
#define MAVLINK_MSG_ID_HIGH_LATENCY_CRC 150
|
||||
#define MAVLINK_MSG_ID_234_CRC 150
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HIGH_LATENCY { \
|
||||
234, \
|
||||
"HIGH_LATENCY", \
|
||||
24, \
|
||||
{ { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency_t, base_mode) }, \
|
||||
{ "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency_t, custom_mode) }, \
|
||||
{ "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency_t, landed_state) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_high_latency_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_high_latency_t, pitch) }, \
|
||||
{ "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_high_latency_t, heading) }, \
|
||||
{ "throttle", NULL, MAVLINK_TYPE_INT8_T, 0, 28, offsetof(mavlink_high_latency_t, throttle) }, \
|
||||
{ "heading_sp", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_high_latency_t, heading_sp) }, \
|
||||
{ "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency_t, longitude) }, \
|
||||
{ "altitude_amsl", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_high_latency_t, altitude_amsl) }, \
|
||||
{ "altitude_sp", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_high_latency_t, altitude_sp) }, \
|
||||
{ "airspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_high_latency_t, airspeed) }, \
|
||||
{ "airspeed_sp", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_high_latency_t, airspeed_sp) }, \
|
||||
{ "groundspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_high_latency_t, groundspeed) }, \
|
||||
{ "climb_rate", NULL, MAVLINK_TYPE_INT8_T, 0, 32, offsetof(mavlink_high_latency_t, climb_rate) }, \
|
||||
{ "gps_nsat", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_high_latency_t, gps_nsat) }, \
|
||||
{ "gps_fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_high_latency_t, gps_fix_type) }, \
|
||||
{ "battery_remaining", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_high_latency_t, battery_remaining) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_INT8_T, 0, 36, offsetof(mavlink_high_latency_t, temperature) }, \
|
||||
{ "temperature_air", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_high_latency_t, temperature_air) }, \
|
||||
{ "failsafe", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_high_latency_t, failsafe) }, \
|
||||
{ "wp_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_high_latency_t, wp_num) }, \
|
||||
{ "wp_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_high_latency_t, wp_distance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HIGH_LATENCY { \
|
||||
"HIGH_LATENCY", \
|
||||
24, \
|
||||
{ { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency_t, base_mode) }, \
|
||||
{ "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency_t, custom_mode) }, \
|
||||
{ "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency_t, landed_state) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_high_latency_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_high_latency_t, pitch) }, \
|
||||
{ "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_high_latency_t, heading) }, \
|
||||
{ "throttle", NULL, MAVLINK_TYPE_INT8_T, 0, 28, offsetof(mavlink_high_latency_t, throttle) }, \
|
||||
{ "heading_sp", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_high_latency_t, heading_sp) }, \
|
||||
{ "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency_t, longitude) }, \
|
||||
{ "altitude_amsl", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_high_latency_t, altitude_amsl) }, \
|
||||
{ "altitude_sp", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_high_latency_t, altitude_sp) }, \
|
||||
{ "airspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_high_latency_t, airspeed) }, \
|
||||
{ "airspeed_sp", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_high_latency_t, airspeed_sp) }, \
|
||||
{ "groundspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_high_latency_t, groundspeed) }, \
|
||||
{ "climb_rate", NULL, MAVLINK_TYPE_INT8_T, 0, 32, offsetof(mavlink_high_latency_t, climb_rate) }, \
|
||||
{ "gps_nsat", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_high_latency_t, gps_nsat) }, \
|
||||
{ "gps_fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_high_latency_t, gps_fix_type) }, \
|
||||
{ "battery_remaining", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_high_latency_t, battery_remaining) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_INT8_T, 0, 36, offsetof(mavlink_high_latency_t, temperature) }, \
|
||||
{ "temperature_air", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_high_latency_t, temperature_air) }, \
|
||||
{ "failsafe", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_high_latency_t, failsafe) }, \
|
||||
{ "wp_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_high_latency_t, wp_num) }, \
|
||||
{ "wp_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_high_latency_t, wp_distance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a high_latency message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param base_mode Bitmap of enabled system modes.
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags.
|
||||
* @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
* @param roll [cdeg] roll
|
||||
* @param pitch [cdeg] pitch
|
||||
* @param heading [cdeg] heading
|
||||
* @param throttle [%] throttle (percentage)
|
||||
* @param heading_sp [cdeg] heading setpoint
|
||||
* @param latitude [degE7] Latitude
|
||||
* @param longitude [degE7] Longitude
|
||||
* @param altitude_amsl [m] Altitude above mean sea level
|
||||
* @param altitude_sp [m] Altitude setpoint relative to the home position
|
||||
* @param airspeed [m/s] airspeed
|
||||
* @param airspeed_sp [m/s] airspeed setpoint
|
||||
* @param groundspeed [m/s] groundspeed
|
||||
* @param climb_rate [m/s] climb rate
|
||||
* @param gps_nsat Number of satellites visible. If unknown, set to 255
|
||||
* @param gps_fix_type GPS Fix type.
|
||||
* @param battery_remaining [%] Remaining battery (percentage)
|
||||
* @param temperature [degC] Autopilot temperature (degrees C)
|
||||
* @param temperature_air [degC] Air temperature (degrees C) from airspeed sensor
|
||||
* @param failsafe failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)
|
||||
* @param wp_num current waypoint number
|
||||
* @param wp_distance [m] distance to target
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t base_mode, uint32_t custom_mode, uint8_t landed_state, int16_t roll, int16_t pitch, uint16_t heading, int8_t throttle, int16_t heading_sp, int32_t latitude, int32_t longitude, int16_t altitude_amsl, int16_t altitude_sp, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, int8_t climb_rate, uint8_t gps_nsat, uint8_t gps_fix_type, uint8_t battery_remaining, int8_t temperature, int8_t temperature_air, uint8_t failsafe, uint8_t wp_num, uint16_t wp_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIGH_LATENCY_LEN];
|
||||
_mav_put_uint32_t(buf, 0, custom_mode);
|
||||
_mav_put_int32_t(buf, 4, latitude);
|
||||
_mav_put_int32_t(buf, 8, longitude);
|
||||
_mav_put_int16_t(buf, 12, roll);
|
||||
_mav_put_int16_t(buf, 14, pitch);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_int16_t(buf, 18, heading_sp);
|
||||
_mav_put_int16_t(buf, 20, altitude_amsl);
|
||||
_mav_put_int16_t(buf, 22, altitude_sp);
|
||||
_mav_put_uint16_t(buf, 24, wp_distance);
|
||||
_mav_put_uint8_t(buf, 26, base_mode);
|
||||
_mav_put_uint8_t(buf, 27, landed_state);
|
||||
_mav_put_int8_t(buf, 28, throttle);
|
||||
_mav_put_uint8_t(buf, 29, airspeed);
|
||||
_mav_put_uint8_t(buf, 30, airspeed_sp);
|
||||
_mav_put_uint8_t(buf, 31, groundspeed);
|
||||
_mav_put_int8_t(buf, 32, climb_rate);
|
||||
_mav_put_uint8_t(buf, 33, gps_nsat);
|
||||
_mav_put_uint8_t(buf, 34, gps_fix_type);
|
||||
_mav_put_uint8_t(buf, 35, battery_remaining);
|
||||
_mav_put_int8_t(buf, 36, temperature);
|
||||
_mav_put_int8_t(buf, 37, temperature_air);
|
||||
_mav_put_uint8_t(buf, 38, failsafe);
|
||||
_mav_put_uint8_t(buf, 39, wp_num);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGH_LATENCY_LEN);
|
||||
#else
|
||||
mavlink_high_latency_t packet;
|
||||
packet.custom_mode = custom_mode;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.heading = heading;
|
||||
packet.heading_sp = heading_sp;
|
||||
packet.altitude_amsl = altitude_amsl;
|
||||
packet.altitude_sp = altitude_sp;
|
||||
packet.wp_distance = wp_distance;
|
||||
packet.base_mode = base_mode;
|
||||
packet.landed_state = landed_state;
|
||||
packet.throttle = throttle;
|
||||
packet.airspeed = airspeed;
|
||||
packet.airspeed_sp = airspeed_sp;
|
||||
packet.groundspeed = groundspeed;
|
||||
packet.climb_rate = climb_rate;
|
||||
packet.gps_nsat = gps_nsat;
|
||||
packet.gps_fix_type = gps_fix_type;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
packet.temperature = temperature;
|
||||
packet.temperature_air = temperature_air;
|
||||
packet.failsafe = failsafe;
|
||||
packet.wp_num = wp_num;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGH_LATENCY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIGH_LATENCY;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a high_latency message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param base_mode Bitmap of enabled system modes.
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags.
|
||||
* @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
* @param roll [cdeg] roll
|
||||
* @param pitch [cdeg] pitch
|
||||
* @param heading [cdeg] heading
|
||||
* @param throttle [%] throttle (percentage)
|
||||
* @param heading_sp [cdeg] heading setpoint
|
||||
* @param latitude [degE7] Latitude
|
||||
* @param longitude [degE7] Longitude
|
||||
* @param altitude_amsl [m] Altitude above mean sea level
|
||||
* @param altitude_sp [m] Altitude setpoint relative to the home position
|
||||
* @param airspeed [m/s] airspeed
|
||||
* @param airspeed_sp [m/s] airspeed setpoint
|
||||
* @param groundspeed [m/s] groundspeed
|
||||
* @param climb_rate [m/s] climb rate
|
||||
* @param gps_nsat Number of satellites visible. If unknown, set to 255
|
||||
* @param gps_fix_type GPS Fix type.
|
||||
* @param battery_remaining [%] Remaining battery (percentage)
|
||||
* @param temperature [degC] Autopilot temperature (degrees C)
|
||||
* @param temperature_air [degC] Air temperature (degrees C) from airspeed sensor
|
||||
* @param failsafe failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)
|
||||
* @param wp_num current waypoint number
|
||||
* @param wp_distance [m] distance to target
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t base_mode,uint32_t custom_mode,uint8_t landed_state,int16_t roll,int16_t pitch,uint16_t heading,int8_t throttle,int16_t heading_sp,int32_t latitude,int32_t longitude,int16_t altitude_amsl,int16_t altitude_sp,uint8_t airspeed,uint8_t airspeed_sp,uint8_t groundspeed,int8_t climb_rate,uint8_t gps_nsat,uint8_t gps_fix_type,uint8_t battery_remaining,int8_t temperature,int8_t temperature_air,uint8_t failsafe,uint8_t wp_num,uint16_t wp_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIGH_LATENCY_LEN];
|
||||
_mav_put_uint32_t(buf, 0, custom_mode);
|
||||
_mav_put_int32_t(buf, 4, latitude);
|
||||
_mav_put_int32_t(buf, 8, longitude);
|
||||
_mav_put_int16_t(buf, 12, roll);
|
||||
_mav_put_int16_t(buf, 14, pitch);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_int16_t(buf, 18, heading_sp);
|
||||
_mav_put_int16_t(buf, 20, altitude_amsl);
|
||||
_mav_put_int16_t(buf, 22, altitude_sp);
|
||||
_mav_put_uint16_t(buf, 24, wp_distance);
|
||||
_mav_put_uint8_t(buf, 26, base_mode);
|
||||
_mav_put_uint8_t(buf, 27, landed_state);
|
||||
_mav_put_int8_t(buf, 28, throttle);
|
||||
_mav_put_uint8_t(buf, 29, airspeed);
|
||||
_mav_put_uint8_t(buf, 30, airspeed_sp);
|
||||
_mav_put_uint8_t(buf, 31, groundspeed);
|
||||
_mav_put_int8_t(buf, 32, climb_rate);
|
||||
_mav_put_uint8_t(buf, 33, gps_nsat);
|
||||
_mav_put_uint8_t(buf, 34, gps_fix_type);
|
||||
_mav_put_uint8_t(buf, 35, battery_remaining);
|
||||
_mav_put_int8_t(buf, 36, temperature);
|
||||
_mav_put_int8_t(buf, 37, temperature_air);
|
||||
_mav_put_uint8_t(buf, 38, failsafe);
|
||||
_mav_put_uint8_t(buf, 39, wp_num);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGH_LATENCY_LEN);
|
||||
#else
|
||||
mavlink_high_latency_t packet;
|
||||
packet.custom_mode = custom_mode;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.heading = heading;
|
||||
packet.heading_sp = heading_sp;
|
||||
packet.altitude_amsl = altitude_amsl;
|
||||
packet.altitude_sp = altitude_sp;
|
||||
packet.wp_distance = wp_distance;
|
||||
packet.base_mode = base_mode;
|
||||
packet.landed_state = landed_state;
|
||||
packet.throttle = throttle;
|
||||
packet.airspeed = airspeed;
|
||||
packet.airspeed_sp = airspeed_sp;
|
||||
packet.groundspeed = groundspeed;
|
||||
packet.climb_rate = climb_rate;
|
||||
packet.gps_nsat = gps_nsat;
|
||||
packet.gps_fix_type = gps_fix_type;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
packet.temperature = temperature;
|
||||
packet.temperature_air = temperature_air;
|
||||
packet.failsafe = failsafe;
|
||||
packet.wp_num = wp_num;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGH_LATENCY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIGH_LATENCY;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a high_latency struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param high_latency C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_high_latency_t* high_latency)
|
||||
{
|
||||
return mavlink_msg_high_latency_pack(system_id, component_id, msg, high_latency->base_mode, high_latency->custom_mode, high_latency->landed_state, high_latency->roll, high_latency->pitch, high_latency->heading, high_latency->throttle, high_latency->heading_sp, high_latency->latitude, high_latency->longitude, high_latency->altitude_amsl, high_latency->altitude_sp, high_latency->airspeed, high_latency->airspeed_sp, high_latency->groundspeed, high_latency->climb_rate, high_latency->gps_nsat, high_latency->gps_fix_type, high_latency->battery_remaining, high_latency->temperature, high_latency->temperature_air, high_latency->failsafe, high_latency->wp_num, high_latency->wp_distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a high_latency struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param high_latency C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_high_latency_t* high_latency)
|
||||
{
|
||||
return mavlink_msg_high_latency_pack_chan(system_id, component_id, chan, msg, high_latency->base_mode, high_latency->custom_mode, high_latency->landed_state, high_latency->roll, high_latency->pitch, high_latency->heading, high_latency->throttle, high_latency->heading_sp, high_latency->latitude, high_latency->longitude, high_latency->altitude_amsl, high_latency->altitude_sp, high_latency->airspeed, high_latency->airspeed_sp, high_latency->groundspeed, high_latency->climb_rate, high_latency->gps_nsat, high_latency->gps_fix_type, high_latency->battery_remaining, high_latency->temperature, high_latency->temperature_air, high_latency->failsafe, high_latency->wp_num, high_latency->wp_distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a high_latency message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param base_mode Bitmap of enabled system modes.
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags.
|
||||
* @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
* @param roll [cdeg] roll
|
||||
* @param pitch [cdeg] pitch
|
||||
* @param heading [cdeg] heading
|
||||
* @param throttle [%] throttle (percentage)
|
||||
* @param heading_sp [cdeg] heading setpoint
|
||||
* @param latitude [degE7] Latitude
|
||||
* @param longitude [degE7] Longitude
|
||||
* @param altitude_amsl [m] Altitude above mean sea level
|
||||
* @param altitude_sp [m] Altitude setpoint relative to the home position
|
||||
* @param airspeed [m/s] airspeed
|
||||
* @param airspeed_sp [m/s] airspeed setpoint
|
||||
* @param groundspeed [m/s] groundspeed
|
||||
* @param climb_rate [m/s] climb rate
|
||||
* @param gps_nsat Number of satellites visible. If unknown, set to 255
|
||||
* @param gps_fix_type GPS Fix type.
|
||||
* @param battery_remaining [%] Remaining battery (percentage)
|
||||
* @param temperature [degC] Autopilot temperature (degrees C)
|
||||
* @param temperature_air [degC] Air temperature (degrees C) from airspeed sensor
|
||||
* @param failsafe failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)
|
||||
* @param wp_num current waypoint number
|
||||
* @param wp_distance [m] distance to target
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_high_latency_send(mavlink_channel_t chan, uint8_t base_mode, uint32_t custom_mode, uint8_t landed_state, int16_t roll, int16_t pitch, uint16_t heading, int8_t throttle, int16_t heading_sp, int32_t latitude, int32_t longitude, int16_t altitude_amsl, int16_t altitude_sp, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, int8_t climb_rate, uint8_t gps_nsat, uint8_t gps_fix_type, uint8_t battery_remaining, int8_t temperature, int8_t temperature_air, uint8_t failsafe, uint8_t wp_num, uint16_t wp_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIGH_LATENCY_LEN];
|
||||
_mav_put_uint32_t(buf, 0, custom_mode);
|
||||
_mav_put_int32_t(buf, 4, latitude);
|
||||
_mav_put_int32_t(buf, 8, longitude);
|
||||
_mav_put_int16_t(buf, 12, roll);
|
||||
_mav_put_int16_t(buf, 14, pitch);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_int16_t(buf, 18, heading_sp);
|
||||
_mav_put_int16_t(buf, 20, altitude_amsl);
|
||||
_mav_put_int16_t(buf, 22, altitude_sp);
|
||||
_mav_put_uint16_t(buf, 24, wp_distance);
|
||||
_mav_put_uint8_t(buf, 26, base_mode);
|
||||
_mav_put_uint8_t(buf, 27, landed_state);
|
||||
_mav_put_int8_t(buf, 28, throttle);
|
||||
_mav_put_uint8_t(buf, 29, airspeed);
|
||||
_mav_put_uint8_t(buf, 30, airspeed_sp);
|
||||
_mav_put_uint8_t(buf, 31, groundspeed);
|
||||
_mav_put_int8_t(buf, 32, climb_rate);
|
||||
_mav_put_uint8_t(buf, 33, gps_nsat);
|
||||
_mav_put_uint8_t(buf, 34, gps_fix_type);
|
||||
_mav_put_uint8_t(buf, 35, battery_remaining);
|
||||
_mav_put_int8_t(buf, 36, temperature);
|
||||
_mav_put_int8_t(buf, 37, temperature_air);
|
||||
_mav_put_uint8_t(buf, 38, failsafe);
|
||||
_mav_put_uint8_t(buf, 39, wp_num);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY, buf, MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_CRC);
|
||||
#else
|
||||
mavlink_high_latency_t packet;
|
||||
packet.custom_mode = custom_mode;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.heading = heading;
|
||||
packet.heading_sp = heading_sp;
|
||||
packet.altitude_amsl = altitude_amsl;
|
||||
packet.altitude_sp = altitude_sp;
|
||||
packet.wp_distance = wp_distance;
|
||||
packet.base_mode = base_mode;
|
||||
packet.landed_state = landed_state;
|
||||
packet.throttle = throttle;
|
||||
packet.airspeed = airspeed;
|
||||
packet.airspeed_sp = airspeed_sp;
|
||||
packet.groundspeed = groundspeed;
|
||||
packet.climb_rate = climb_rate;
|
||||
packet.gps_nsat = gps_nsat;
|
||||
packet.gps_fix_type = gps_fix_type;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
packet.temperature = temperature;
|
||||
packet.temperature_air = temperature_air;
|
||||
packet.failsafe = failsafe;
|
||||
packet.wp_num = wp_num;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY, (const char *)&packet, MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a high_latency message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_high_latency_send_struct(mavlink_channel_t chan, const mavlink_high_latency_t* high_latency)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_high_latency_send(chan, high_latency->base_mode, high_latency->custom_mode, high_latency->landed_state, high_latency->roll, high_latency->pitch, high_latency->heading, high_latency->throttle, high_latency->heading_sp, high_latency->latitude, high_latency->longitude, high_latency->altitude_amsl, high_latency->altitude_sp, high_latency->airspeed, high_latency->airspeed_sp, high_latency->groundspeed, high_latency->climb_rate, high_latency->gps_nsat, high_latency->gps_fix_type, high_latency->battery_remaining, high_latency->temperature, high_latency->temperature_air, high_latency->failsafe, high_latency->wp_num, high_latency->wp_distance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY, (const char *)high_latency, MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HIGH_LATENCY_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_high_latency_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t base_mode, uint32_t custom_mode, uint8_t landed_state, int16_t roll, int16_t pitch, uint16_t heading, int8_t throttle, int16_t heading_sp, int32_t latitude, int32_t longitude, int16_t altitude_amsl, int16_t altitude_sp, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, int8_t climb_rate, uint8_t gps_nsat, uint8_t gps_fix_type, uint8_t battery_remaining, int8_t temperature, int8_t temperature_air, uint8_t failsafe, uint8_t wp_num, uint16_t wp_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, custom_mode);
|
||||
_mav_put_int32_t(buf, 4, latitude);
|
||||
_mav_put_int32_t(buf, 8, longitude);
|
||||
_mav_put_int16_t(buf, 12, roll);
|
||||
_mav_put_int16_t(buf, 14, pitch);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_int16_t(buf, 18, heading_sp);
|
||||
_mav_put_int16_t(buf, 20, altitude_amsl);
|
||||
_mav_put_int16_t(buf, 22, altitude_sp);
|
||||
_mav_put_uint16_t(buf, 24, wp_distance);
|
||||
_mav_put_uint8_t(buf, 26, base_mode);
|
||||
_mav_put_uint8_t(buf, 27, landed_state);
|
||||
_mav_put_int8_t(buf, 28, throttle);
|
||||
_mav_put_uint8_t(buf, 29, airspeed);
|
||||
_mav_put_uint8_t(buf, 30, airspeed_sp);
|
||||
_mav_put_uint8_t(buf, 31, groundspeed);
|
||||
_mav_put_int8_t(buf, 32, climb_rate);
|
||||
_mav_put_uint8_t(buf, 33, gps_nsat);
|
||||
_mav_put_uint8_t(buf, 34, gps_fix_type);
|
||||
_mav_put_uint8_t(buf, 35, battery_remaining);
|
||||
_mav_put_int8_t(buf, 36, temperature);
|
||||
_mav_put_int8_t(buf, 37, temperature_air);
|
||||
_mav_put_uint8_t(buf, 38, failsafe);
|
||||
_mav_put_uint8_t(buf, 39, wp_num);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY, buf, MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_CRC);
|
||||
#else
|
||||
mavlink_high_latency_t *packet = (mavlink_high_latency_t *)msgbuf;
|
||||
packet->custom_mode = custom_mode;
|
||||
packet->latitude = latitude;
|
||||
packet->longitude = longitude;
|
||||
packet->roll = roll;
|
||||
packet->pitch = pitch;
|
||||
packet->heading = heading;
|
||||
packet->heading_sp = heading_sp;
|
||||
packet->altitude_amsl = altitude_amsl;
|
||||
packet->altitude_sp = altitude_sp;
|
||||
packet->wp_distance = wp_distance;
|
||||
packet->base_mode = base_mode;
|
||||
packet->landed_state = landed_state;
|
||||
packet->throttle = throttle;
|
||||
packet->airspeed = airspeed;
|
||||
packet->airspeed_sp = airspeed_sp;
|
||||
packet->groundspeed = groundspeed;
|
||||
packet->climb_rate = climb_rate;
|
||||
packet->gps_nsat = gps_nsat;
|
||||
packet->gps_fix_type = gps_fix_type;
|
||||
packet->battery_remaining = battery_remaining;
|
||||
packet->temperature = temperature;
|
||||
packet->temperature_air = temperature_air;
|
||||
packet->failsafe = failsafe;
|
||||
packet->wp_num = wp_num;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY, (const char *)packet, MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_LEN, MAVLINK_MSG_ID_HIGH_LATENCY_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIGH_LATENCY UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field base_mode from high_latency message
|
||||
*
|
||||
* @return Bitmap of enabled system modes.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency_get_base_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field custom_mode from high_latency message
|
||||
*
|
||||
* @return A bitfield for use for autopilot-specific flags.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_high_latency_get_custom_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field landed_state from high_latency message
|
||||
*
|
||||
* @return The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency_get_landed_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 27);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from high_latency message
|
||||
*
|
||||
* @return [cdeg] roll
|
||||
*/
|
||||
static inline int16_t mavlink_msg_high_latency_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from high_latency message
|
||||
*
|
||||
* @return [cdeg] pitch
|
||||
*/
|
||||
static inline int16_t mavlink_msg_high_latency_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field heading from high_latency message
|
||||
*
|
||||
* @return [cdeg] heading
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency_get_heading(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field throttle from high_latency message
|
||||
*
|
||||
* @return [%] throttle (percentage)
|
||||
*/
|
||||
static inline int8_t mavlink_msg_high_latency_get_throttle(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field heading_sp from high_latency message
|
||||
*
|
||||
* @return [cdeg] heading setpoint
|
||||
*/
|
||||
static inline int16_t mavlink_msg_high_latency_get_heading_sp(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field latitude from high_latency message
|
||||
*
|
||||
* @return [degE7] Latitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_high_latency_get_latitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field longitude from high_latency message
|
||||
*
|
||||
* @return [degE7] Longitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_high_latency_get_longitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_amsl from high_latency message
|
||||
*
|
||||
* @return [m] Altitude above mean sea level
|
||||
*/
|
||||
static inline int16_t mavlink_msg_high_latency_get_altitude_amsl(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_sp from high_latency message
|
||||
*
|
||||
* @return [m] Altitude setpoint relative to the home position
|
||||
*/
|
||||
static inline int16_t mavlink_msg_high_latency_get_altitude_sp(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field airspeed from high_latency message
|
||||
*
|
||||
* @return [m/s] airspeed
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency_get_airspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 29);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field airspeed_sp from high_latency message
|
||||
*
|
||||
* @return [m/s] airspeed setpoint
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency_get_airspeed_sp(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field groundspeed from high_latency message
|
||||
*
|
||||
* @return [m/s] groundspeed
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency_get_groundspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field climb_rate from high_latency message
|
||||
*
|
||||
* @return [m/s] climb rate
|
||||
*/
|
||||
static inline int8_t mavlink_msg_high_latency_get_climb_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gps_nsat from high_latency message
|
||||
*
|
||||
* @return Number of satellites visible. If unknown, set to 255
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency_get_gps_nsat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gps_fix_type from high_latency message
|
||||
*
|
||||
* @return GPS Fix type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency_get_gps_fix_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field battery_remaining from high_latency message
|
||||
*
|
||||
* @return [%] Remaining battery (percentage)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency_get_battery_remaining(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 35);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field temperature from high_latency message
|
||||
*
|
||||
* @return [degC] Autopilot temperature (degrees C)
|
||||
*/
|
||||
static inline int8_t mavlink_msg_high_latency_get_temperature(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field temperature_air from high_latency message
|
||||
*
|
||||
* @return [degC] Air temperature (degrees C) from airspeed sensor
|
||||
*/
|
||||
static inline int8_t mavlink_msg_high_latency_get_temperature_air(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 37);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field failsafe from high_latency message
|
||||
*
|
||||
* @return failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency_get_failsafe(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 38);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field wp_num from high_latency message
|
||||
*
|
||||
* @return current waypoint number
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency_get_wp_num(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 39);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field wp_distance from high_latency message
|
||||
*
|
||||
* @return [m] distance to target
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency_get_wp_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a high_latency message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param high_latency C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_high_latency_decode(const mavlink_message_t* msg, mavlink_high_latency_t* high_latency)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
high_latency->custom_mode = mavlink_msg_high_latency_get_custom_mode(msg);
|
||||
high_latency->latitude = mavlink_msg_high_latency_get_latitude(msg);
|
||||
high_latency->longitude = mavlink_msg_high_latency_get_longitude(msg);
|
||||
high_latency->roll = mavlink_msg_high_latency_get_roll(msg);
|
||||
high_latency->pitch = mavlink_msg_high_latency_get_pitch(msg);
|
||||
high_latency->heading = mavlink_msg_high_latency_get_heading(msg);
|
||||
high_latency->heading_sp = mavlink_msg_high_latency_get_heading_sp(msg);
|
||||
high_latency->altitude_amsl = mavlink_msg_high_latency_get_altitude_amsl(msg);
|
||||
high_latency->altitude_sp = mavlink_msg_high_latency_get_altitude_sp(msg);
|
||||
high_latency->wp_distance = mavlink_msg_high_latency_get_wp_distance(msg);
|
||||
high_latency->base_mode = mavlink_msg_high_latency_get_base_mode(msg);
|
||||
high_latency->landed_state = mavlink_msg_high_latency_get_landed_state(msg);
|
||||
high_latency->throttle = mavlink_msg_high_latency_get_throttle(msg);
|
||||
high_latency->airspeed = mavlink_msg_high_latency_get_airspeed(msg);
|
||||
high_latency->airspeed_sp = mavlink_msg_high_latency_get_airspeed_sp(msg);
|
||||
high_latency->groundspeed = mavlink_msg_high_latency_get_groundspeed(msg);
|
||||
high_latency->climb_rate = mavlink_msg_high_latency_get_climb_rate(msg);
|
||||
high_latency->gps_nsat = mavlink_msg_high_latency_get_gps_nsat(msg);
|
||||
high_latency->gps_fix_type = mavlink_msg_high_latency_get_gps_fix_type(msg);
|
||||
high_latency->battery_remaining = mavlink_msg_high_latency_get_battery_remaining(msg);
|
||||
high_latency->temperature = mavlink_msg_high_latency_get_temperature(msg);
|
||||
high_latency->temperature_air = mavlink_msg_high_latency_get_temperature_air(msg);
|
||||
high_latency->failsafe = mavlink_msg_high_latency_get_failsafe(msg);
|
||||
high_latency->wp_num = mavlink_msg_high_latency_get_wp_num(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HIGH_LATENCY_LEN? msg->len : MAVLINK_MSG_ID_HIGH_LATENCY_LEN;
|
||||
memset(high_latency, 0, MAVLINK_MSG_ID_HIGH_LATENCY_LEN);
|
||||
memcpy(high_latency, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,863 @@
|
||||
#pragma once
|
||||
// MESSAGE HIGH_LATENCY2 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIGH_LATENCY2 235
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_high_latency2_t {
|
||||
uint32_t timestamp; /*< [ms] Timestamp (milliseconds since boot or Unix epoch)*/
|
||||
int32_t latitude; /*< [degE7] Latitude*/
|
||||
int32_t longitude; /*< [degE7] Longitude*/
|
||||
uint16_t custom_mode; /*< A bitfield for use for autopilot-specific flags (2 byte version).*/
|
||||
int16_t altitude; /*< [m] Altitude above mean sea level*/
|
||||
int16_t target_altitude; /*< [m] Altitude setpoint*/
|
||||
uint16_t target_distance; /*< [dam] Distance to target waypoint or position*/
|
||||
uint16_t wp_num; /*< Current waypoint number*/
|
||||
uint16_t failure_flags; /*< Bitmap of failure flags.*/
|
||||
uint8_t type; /*< Type of the MAV (quadrotor, helicopter, etc.)*/
|
||||
uint8_t autopilot; /*< Autopilot type / class.*/
|
||||
uint8_t heading; /*< [deg/2] Heading*/
|
||||
uint8_t target_heading; /*< [deg/2] Heading setpoint*/
|
||||
uint8_t throttle; /*< [%] Throttle*/
|
||||
uint8_t airspeed; /*< [m/s*5] Airspeed*/
|
||||
uint8_t airspeed_sp; /*< [m/s*5] Airspeed setpoint*/
|
||||
uint8_t groundspeed; /*< [m/s*5] Groundspeed*/
|
||||
uint8_t windspeed; /*< [m/s*5] Windspeed*/
|
||||
uint8_t wind_heading; /*< [deg/2] Wind heading*/
|
||||
uint8_t eph; /*< [dm] Maximum error horizontal position since last message*/
|
||||
uint8_t epv; /*< [dm] Maximum error vertical position since last message*/
|
||||
int8_t temperature_air; /*< [degC] Air temperature from airspeed sensor*/
|
||||
int8_t climb_rate; /*< [dm/s] Maximum climb rate magnitude since last message*/
|
||||
int8_t battery; /*< [%] Battery (percentage, -1 for DNU)*/
|
||||
int8_t custom0; /*< Field for custom payload.*/
|
||||
int8_t custom1; /*< Field for custom payload.*/
|
||||
int8_t custom2; /*< Field for custom payload.*/
|
||||
}) mavlink_high_latency2_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIGH_LATENCY2_LEN 42
|
||||
#define MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN 42
|
||||
#define MAVLINK_MSG_ID_235_LEN 42
|
||||
#define MAVLINK_MSG_ID_235_MIN_LEN 42
|
||||
|
||||
#define MAVLINK_MSG_ID_HIGH_LATENCY2_CRC 179
|
||||
#define MAVLINK_MSG_ID_235_CRC 179
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HIGH_LATENCY2 { \
|
||||
235, \
|
||||
"HIGH_LATENCY2", \
|
||||
27, \
|
||||
{ { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency2_t, timestamp) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_high_latency2_t, type) }, \
|
||||
{ "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_high_latency2_t, autopilot) }, \
|
||||
{ "custom_mode", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_high_latency2_t, custom_mode) }, \
|
||||
{ "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency2_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency2_t, longitude) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_high_latency2_t, altitude) }, \
|
||||
{ "target_altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_high_latency2_t, target_altitude) }, \
|
||||
{ "heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency2_t, heading) }, \
|
||||
{ "target_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency2_t, target_heading) }, \
|
||||
{ "target_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_high_latency2_t, target_distance) }, \
|
||||
{ "throttle", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_high_latency2_t, throttle) }, \
|
||||
{ "airspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_high_latency2_t, airspeed) }, \
|
||||
{ "airspeed_sp", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_high_latency2_t, airspeed_sp) }, \
|
||||
{ "groundspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_high_latency2_t, groundspeed) }, \
|
||||
{ "windspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_high_latency2_t, windspeed) }, \
|
||||
{ "wind_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_high_latency2_t, wind_heading) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_high_latency2_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_high_latency2_t, epv) }, \
|
||||
{ "temperature_air", NULL, MAVLINK_TYPE_INT8_T, 0, 36, offsetof(mavlink_high_latency2_t, temperature_air) }, \
|
||||
{ "climb_rate", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_high_latency2_t, climb_rate) }, \
|
||||
{ "battery", NULL, MAVLINK_TYPE_INT8_T, 0, 38, offsetof(mavlink_high_latency2_t, battery) }, \
|
||||
{ "wp_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_high_latency2_t, wp_num) }, \
|
||||
{ "failure_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_high_latency2_t, failure_flags) }, \
|
||||
{ "custom0", NULL, MAVLINK_TYPE_INT8_T, 0, 39, offsetof(mavlink_high_latency2_t, custom0) }, \
|
||||
{ "custom1", NULL, MAVLINK_TYPE_INT8_T, 0, 40, offsetof(mavlink_high_latency2_t, custom1) }, \
|
||||
{ "custom2", NULL, MAVLINK_TYPE_INT8_T, 0, 41, offsetof(mavlink_high_latency2_t, custom2) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HIGH_LATENCY2 { \
|
||||
"HIGH_LATENCY2", \
|
||||
27, \
|
||||
{ { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency2_t, timestamp) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_high_latency2_t, type) }, \
|
||||
{ "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_high_latency2_t, autopilot) }, \
|
||||
{ "custom_mode", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_high_latency2_t, custom_mode) }, \
|
||||
{ "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency2_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency2_t, longitude) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_high_latency2_t, altitude) }, \
|
||||
{ "target_altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_high_latency2_t, target_altitude) }, \
|
||||
{ "heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency2_t, heading) }, \
|
||||
{ "target_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency2_t, target_heading) }, \
|
||||
{ "target_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_high_latency2_t, target_distance) }, \
|
||||
{ "throttle", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_high_latency2_t, throttle) }, \
|
||||
{ "airspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_high_latency2_t, airspeed) }, \
|
||||
{ "airspeed_sp", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_high_latency2_t, airspeed_sp) }, \
|
||||
{ "groundspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_high_latency2_t, groundspeed) }, \
|
||||
{ "windspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_high_latency2_t, windspeed) }, \
|
||||
{ "wind_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_high_latency2_t, wind_heading) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_high_latency2_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_high_latency2_t, epv) }, \
|
||||
{ "temperature_air", NULL, MAVLINK_TYPE_INT8_T, 0, 36, offsetof(mavlink_high_latency2_t, temperature_air) }, \
|
||||
{ "climb_rate", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_high_latency2_t, climb_rate) }, \
|
||||
{ "battery", NULL, MAVLINK_TYPE_INT8_T, 0, 38, offsetof(mavlink_high_latency2_t, battery) }, \
|
||||
{ "wp_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_high_latency2_t, wp_num) }, \
|
||||
{ "failure_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_high_latency2_t, failure_flags) }, \
|
||||
{ "custom0", NULL, MAVLINK_TYPE_INT8_T, 0, 39, offsetof(mavlink_high_latency2_t, custom0) }, \
|
||||
{ "custom1", NULL, MAVLINK_TYPE_INT8_T, 0, 40, offsetof(mavlink_high_latency2_t, custom1) }, \
|
||||
{ "custom2", NULL, MAVLINK_TYPE_INT8_T, 0, 41, offsetof(mavlink_high_latency2_t, custom2) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a high_latency2 message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param timestamp [ms] Timestamp (milliseconds since boot or Unix epoch)
|
||||
* @param type Type of the MAV (quadrotor, helicopter, etc.)
|
||||
* @param autopilot Autopilot type / class.
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags (2 byte version).
|
||||
* @param latitude [degE7] Latitude
|
||||
* @param longitude [degE7] Longitude
|
||||
* @param altitude [m] Altitude above mean sea level
|
||||
* @param target_altitude [m] Altitude setpoint
|
||||
* @param heading [deg/2] Heading
|
||||
* @param target_heading [deg/2] Heading setpoint
|
||||
* @param target_distance [dam] Distance to target waypoint or position
|
||||
* @param throttle [%] Throttle
|
||||
* @param airspeed [m/s*5] Airspeed
|
||||
* @param airspeed_sp [m/s*5] Airspeed setpoint
|
||||
* @param groundspeed [m/s*5] Groundspeed
|
||||
* @param windspeed [m/s*5] Windspeed
|
||||
* @param wind_heading [deg/2] Wind heading
|
||||
* @param eph [dm] Maximum error horizontal position since last message
|
||||
* @param epv [dm] Maximum error vertical position since last message
|
||||
* @param temperature_air [degC] Air temperature from airspeed sensor
|
||||
* @param climb_rate [dm/s] Maximum climb rate magnitude since last message
|
||||
* @param battery [%] Battery (percentage, -1 for DNU)
|
||||
* @param wp_num Current waypoint number
|
||||
* @param failure_flags Bitmap of failure flags.
|
||||
* @param custom0 Field for custom payload.
|
||||
* @param custom1 Field for custom payload.
|
||||
* @param custom2 Field for custom payload.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t timestamp, uint8_t type, uint8_t autopilot, uint16_t custom_mode, int32_t latitude, int32_t longitude, int16_t altitude, int16_t target_altitude, uint8_t heading, uint8_t target_heading, uint16_t target_distance, uint8_t throttle, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, uint8_t windspeed, uint8_t wind_heading, uint8_t eph, uint8_t epv, int8_t temperature_air, int8_t climb_rate, int8_t battery, uint16_t wp_num, uint16_t failure_flags, int8_t custom0, int8_t custom1, int8_t custom2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIGH_LATENCY2_LEN];
|
||||
_mav_put_uint32_t(buf, 0, timestamp);
|
||||
_mav_put_int32_t(buf, 4, latitude);
|
||||
_mav_put_int32_t(buf, 8, longitude);
|
||||
_mav_put_uint16_t(buf, 12, custom_mode);
|
||||
_mav_put_int16_t(buf, 14, altitude);
|
||||
_mav_put_int16_t(buf, 16, target_altitude);
|
||||
_mav_put_uint16_t(buf, 18, target_distance);
|
||||
_mav_put_uint16_t(buf, 20, wp_num);
|
||||
_mav_put_uint16_t(buf, 22, failure_flags);
|
||||
_mav_put_uint8_t(buf, 24, type);
|
||||
_mav_put_uint8_t(buf, 25, autopilot);
|
||||
_mav_put_uint8_t(buf, 26, heading);
|
||||
_mav_put_uint8_t(buf, 27, target_heading);
|
||||
_mav_put_uint8_t(buf, 28, throttle);
|
||||
_mav_put_uint8_t(buf, 29, airspeed);
|
||||
_mav_put_uint8_t(buf, 30, airspeed_sp);
|
||||
_mav_put_uint8_t(buf, 31, groundspeed);
|
||||
_mav_put_uint8_t(buf, 32, windspeed);
|
||||
_mav_put_uint8_t(buf, 33, wind_heading);
|
||||
_mav_put_uint8_t(buf, 34, eph);
|
||||
_mav_put_uint8_t(buf, 35, epv);
|
||||
_mav_put_int8_t(buf, 36, temperature_air);
|
||||
_mav_put_int8_t(buf, 37, climb_rate);
|
||||
_mav_put_int8_t(buf, 38, battery);
|
||||
_mav_put_int8_t(buf, 39, custom0);
|
||||
_mav_put_int8_t(buf, 40, custom1);
|
||||
_mav_put_int8_t(buf, 41, custom2);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
|
||||
#else
|
||||
mavlink_high_latency2_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.custom_mode = custom_mode;
|
||||
packet.altitude = altitude;
|
||||
packet.target_altitude = target_altitude;
|
||||
packet.target_distance = target_distance;
|
||||
packet.wp_num = wp_num;
|
||||
packet.failure_flags = failure_flags;
|
||||
packet.type = type;
|
||||
packet.autopilot = autopilot;
|
||||
packet.heading = heading;
|
||||
packet.target_heading = target_heading;
|
||||
packet.throttle = throttle;
|
||||
packet.airspeed = airspeed;
|
||||
packet.airspeed_sp = airspeed_sp;
|
||||
packet.groundspeed = groundspeed;
|
||||
packet.windspeed = windspeed;
|
||||
packet.wind_heading = wind_heading;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.temperature_air = temperature_air;
|
||||
packet.climb_rate = climb_rate;
|
||||
packet.battery = battery;
|
||||
packet.custom0 = custom0;
|
||||
packet.custom1 = custom1;
|
||||
packet.custom2 = custom2;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIGH_LATENCY2;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a high_latency2 message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param timestamp [ms] Timestamp (milliseconds since boot or Unix epoch)
|
||||
* @param type Type of the MAV (quadrotor, helicopter, etc.)
|
||||
* @param autopilot Autopilot type / class.
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags (2 byte version).
|
||||
* @param latitude [degE7] Latitude
|
||||
* @param longitude [degE7] Longitude
|
||||
* @param altitude [m] Altitude above mean sea level
|
||||
* @param target_altitude [m] Altitude setpoint
|
||||
* @param heading [deg/2] Heading
|
||||
* @param target_heading [deg/2] Heading setpoint
|
||||
* @param target_distance [dam] Distance to target waypoint or position
|
||||
* @param throttle [%] Throttle
|
||||
* @param airspeed [m/s*5] Airspeed
|
||||
* @param airspeed_sp [m/s*5] Airspeed setpoint
|
||||
* @param groundspeed [m/s*5] Groundspeed
|
||||
* @param windspeed [m/s*5] Windspeed
|
||||
* @param wind_heading [deg/2] Wind heading
|
||||
* @param eph [dm] Maximum error horizontal position since last message
|
||||
* @param epv [dm] Maximum error vertical position since last message
|
||||
* @param temperature_air [degC] Air temperature from airspeed sensor
|
||||
* @param climb_rate [dm/s] Maximum climb rate magnitude since last message
|
||||
* @param battery [%] Battery (percentage, -1 for DNU)
|
||||
* @param wp_num Current waypoint number
|
||||
* @param failure_flags Bitmap of failure flags.
|
||||
* @param custom0 Field for custom payload.
|
||||
* @param custom1 Field for custom payload.
|
||||
* @param custom2 Field for custom payload.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t timestamp,uint8_t type,uint8_t autopilot,uint16_t custom_mode,int32_t latitude,int32_t longitude,int16_t altitude,int16_t target_altitude,uint8_t heading,uint8_t target_heading,uint16_t target_distance,uint8_t throttle,uint8_t airspeed,uint8_t airspeed_sp,uint8_t groundspeed,uint8_t windspeed,uint8_t wind_heading,uint8_t eph,uint8_t epv,int8_t temperature_air,int8_t climb_rate,int8_t battery,uint16_t wp_num,uint16_t failure_flags,int8_t custom0,int8_t custom1,int8_t custom2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIGH_LATENCY2_LEN];
|
||||
_mav_put_uint32_t(buf, 0, timestamp);
|
||||
_mav_put_int32_t(buf, 4, latitude);
|
||||
_mav_put_int32_t(buf, 8, longitude);
|
||||
_mav_put_uint16_t(buf, 12, custom_mode);
|
||||
_mav_put_int16_t(buf, 14, altitude);
|
||||
_mav_put_int16_t(buf, 16, target_altitude);
|
||||
_mav_put_uint16_t(buf, 18, target_distance);
|
||||
_mav_put_uint16_t(buf, 20, wp_num);
|
||||
_mav_put_uint16_t(buf, 22, failure_flags);
|
||||
_mav_put_uint8_t(buf, 24, type);
|
||||
_mav_put_uint8_t(buf, 25, autopilot);
|
||||
_mav_put_uint8_t(buf, 26, heading);
|
||||
_mav_put_uint8_t(buf, 27, target_heading);
|
||||
_mav_put_uint8_t(buf, 28, throttle);
|
||||
_mav_put_uint8_t(buf, 29, airspeed);
|
||||
_mav_put_uint8_t(buf, 30, airspeed_sp);
|
||||
_mav_put_uint8_t(buf, 31, groundspeed);
|
||||
_mav_put_uint8_t(buf, 32, windspeed);
|
||||
_mav_put_uint8_t(buf, 33, wind_heading);
|
||||
_mav_put_uint8_t(buf, 34, eph);
|
||||
_mav_put_uint8_t(buf, 35, epv);
|
||||
_mav_put_int8_t(buf, 36, temperature_air);
|
||||
_mav_put_int8_t(buf, 37, climb_rate);
|
||||
_mav_put_int8_t(buf, 38, battery);
|
||||
_mav_put_int8_t(buf, 39, custom0);
|
||||
_mav_put_int8_t(buf, 40, custom1);
|
||||
_mav_put_int8_t(buf, 41, custom2);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
|
||||
#else
|
||||
mavlink_high_latency2_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.custom_mode = custom_mode;
|
||||
packet.altitude = altitude;
|
||||
packet.target_altitude = target_altitude;
|
||||
packet.target_distance = target_distance;
|
||||
packet.wp_num = wp_num;
|
||||
packet.failure_flags = failure_flags;
|
||||
packet.type = type;
|
||||
packet.autopilot = autopilot;
|
||||
packet.heading = heading;
|
||||
packet.target_heading = target_heading;
|
||||
packet.throttle = throttle;
|
||||
packet.airspeed = airspeed;
|
||||
packet.airspeed_sp = airspeed_sp;
|
||||
packet.groundspeed = groundspeed;
|
||||
packet.windspeed = windspeed;
|
||||
packet.wind_heading = wind_heading;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.temperature_air = temperature_air;
|
||||
packet.climb_rate = climb_rate;
|
||||
packet.battery = battery;
|
||||
packet.custom0 = custom0;
|
||||
packet.custom1 = custom1;
|
||||
packet.custom2 = custom2;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIGH_LATENCY2;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a high_latency2 struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param high_latency2 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_high_latency2_t* high_latency2)
|
||||
{
|
||||
return mavlink_msg_high_latency2_pack(system_id, component_id, msg, high_latency2->timestamp, high_latency2->type, high_latency2->autopilot, high_latency2->custom_mode, high_latency2->latitude, high_latency2->longitude, high_latency2->altitude, high_latency2->target_altitude, high_latency2->heading, high_latency2->target_heading, high_latency2->target_distance, high_latency2->throttle, high_latency2->airspeed, high_latency2->airspeed_sp, high_latency2->groundspeed, high_latency2->windspeed, high_latency2->wind_heading, high_latency2->eph, high_latency2->epv, high_latency2->temperature_air, high_latency2->climb_rate, high_latency2->battery, high_latency2->wp_num, high_latency2->failure_flags, high_latency2->custom0, high_latency2->custom1, high_latency2->custom2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a high_latency2 struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param high_latency2 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_high_latency2_t* high_latency2)
|
||||
{
|
||||
return mavlink_msg_high_latency2_pack_chan(system_id, component_id, chan, msg, high_latency2->timestamp, high_latency2->type, high_latency2->autopilot, high_latency2->custom_mode, high_latency2->latitude, high_latency2->longitude, high_latency2->altitude, high_latency2->target_altitude, high_latency2->heading, high_latency2->target_heading, high_latency2->target_distance, high_latency2->throttle, high_latency2->airspeed, high_latency2->airspeed_sp, high_latency2->groundspeed, high_latency2->windspeed, high_latency2->wind_heading, high_latency2->eph, high_latency2->epv, high_latency2->temperature_air, high_latency2->climb_rate, high_latency2->battery, high_latency2->wp_num, high_latency2->failure_flags, high_latency2->custom0, high_latency2->custom1, high_latency2->custom2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a high_latency2 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param timestamp [ms] Timestamp (milliseconds since boot or Unix epoch)
|
||||
* @param type Type of the MAV (quadrotor, helicopter, etc.)
|
||||
* @param autopilot Autopilot type / class.
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags (2 byte version).
|
||||
* @param latitude [degE7] Latitude
|
||||
* @param longitude [degE7] Longitude
|
||||
* @param altitude [m] Altitude above mean sea level
|
||||
* @param target_altitude [m] Altitude setpoint
|
||||
* @param heading [deg/2] Heading
|
||||
* @param target_heading [deg/2] Heading setpoint
|
||||
* @param target_distance [dam] Distance to target waypoint or position
|
||||
* @param throttle [%] Throttle
|
||||
* @param airspeed [m/s*5] Airspeed
|
||||
* @param airspeed_sp [m/s*5] Airspeed setpoint
|
||||
* @param groundspeed [m/s*5] Groundspeed
|
||||
* @param windspeed [m/s*5] Windspeed
|
||||
* @param wind_heading [deg/2] Wind heading
|
||||
* @param eph [dm] Maximum error horizontal position since last message
|
||||
* @param epv [dm] Maximum error vertical position since last message
|
||||
* @param temperature_air [degC] Air temperature from airspeed sensor
|
||||
* @param climb_rate [dm/s] Maximum climb rate magnitude since last message
|
||||
* @param battery [%] Battery (percentage, -1 for DNU)
|
||||
* @param wp_num Current waypoint number
|
||||
* @param failure_flags Bitmap of failure flags.
|
||||
* @param custom0 Field for custom payload.
|
||||
* @param custom1 Field for custom payload.
|
||||
* @param custom2 Field for custom payload.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_high_latency2_send(mavlink_channel_t chan, uint32_t timestamp, uint8_t type, uint8_t autopilot, uint16_t custom_mode, int32_t latitude, int32_t longitude, int16_t altitude, int16_t target_altitude, uint8_t heading, uint8_t target_heading, uint16_t target_distance, uint8_t throttle, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, uint8_t windspeed, uint8_t wind_heading, uint8_t eph, uint8_t epv, int8_t temperature_air, int8_t climb_rate, int8_t battery, uint16_t wp_num, uint16_t failure_flags, int8_t custom0, int8_t custom1, int8_t custom2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIGH_LATENCY2_LEN];
|
||||
_mav_put_uint32_t(buf, 0, timestamp);
|
||||
_mav_put_int32_t(buf, 4, latitude);
|
||||
_mav_put_int32_t(buf, 8, longitude);
|
||||
_mav_put_uint16_t(buf, 12, custom_mode);
|
||||
_mav_put_int16_t(buf, 14, altitude);
|
||||
_mav_put_int16_t(buf, 16, target_altitude);
|
||||
_mav_put_uint16_t(buf, 18, target_distance);
|
||||
_mav_put_uint16_t(buf, 20, wp_num);
|
||||
_mav_put_uint16_t(buf, 22, failure_flags);
|
||||
_mav_put_uint8_t(buf, 24, type);
|
||||
_mav_put_uint8_t(buf, 25, autopilot);
|
||||
_mav_put_uint8_t(buf, 26, heading);
|
||||
_mav_put_uint8_t(buf, 27, target_heading);
|
||||
_mav_put_uint8_t(buf, 28, throttle);
|
||||
_mav_put_uint8_t(buf, 29, airspeed);
|
||||
_mav_put_uint8_t(buf, 30, airspeed_sp);
|
||||
_mav_put_uint8_t(buf, 31, groundspeed);
|
||||
_mav_put_uint8_t(buf, 32, windspeed);
|
||||
_mav_put_uint8_t(buf, 33, wind_heading);
|
||||
_mav_put_uint8_t(buf, 34, eph);
|
||||
_mav_put_uint8_t(buf, 35, epv);
|
||||
_mav_put_int8_t(buf, 36, temperature_air);
|
||||
_mav_put_int8_t(buf, 37, climb_rate);
|
||||
_mav_put_int8_t(buf, 38, battery);
|
||||
_mav_put_int8_t(buf, 39, custom0);
|
||||
_mav_put_int8_t(buf, 40, custom1);
|
||||
_mav_put_int8_t(buf, 41, custom2);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, buf, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
|
||||
#else
|
||||
mavlink_high_latency2_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.custom_mode = custom_mode;
|
||||
packet.altitude = altitude;
|
||||
packet.target_altitude = target_altitude;
|
||||
packet.target_distance = target_distance;
|
||||
packet.wp_num = wp_num;
|
||||
packet.failure_flags = failure_flags;
|
||||
packet.type = type;
|
||||
packet.autopilot = autopilot;
|
||||
packet.heading = heading;
|
||||
packet.target_heading = target_heading;
|
||||
packet.throttle = throttle;
|
||||
packet.airspeed = airspeed;
|
||||
packet.airspeed_sp = airspeed_sp;
|
||||
packet.groundspeed = groundspeed;
|
||||
packet.windspeed = windspeed;
|
||||
packet.wind_heading = wind_heading;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.temperature_air = temperature_air;
|
||||
packet.climb_rate = climb_rate;
|
||||
packet.battery = battery;
|
||||
packet.custom0 = custom0;
|
||||
packet.custom1 = custom1;
|
||||
packet.custom2 = custom2;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, (const char *)&packet, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a high_latency2 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_high_latency2_send_struct(mavlink_channel_t chan, const mavlink_high_latency2_t* high_latency2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_high_latency2_send(chan, high_latency2->timestamp, high_latency2->type, high_latency2->autopilot, high_latency2->custom_mode, high_latency2->latitude, high_latency2->longitude, high_latency2->altitude, high_latency2->target_altitude, high_latency2->heading, high_latency2->target_heading, high_latency2->target_distance, high_latency2->throttle, high_latency2->airspeed, high_latency2->airspeed_sp, high_latency2->groundspeed, high_latency2->windspeed, high_latency2->wind_heading, high_latency2->eph, high_latency2->epv, high_latency2->temperature_air, high_latency2->climb_rate, high_latency2->battery, high_latency2->wp_num, high_latency2->failure_flags, high_latency2->custom0, high_latency2->custom1, high_latency2->custom2);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, (const char *)high_latency2, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HIGH_LATENCY2_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_high_latency2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t timestamp, uint8_t type, uint8_t autopilot, uint16_t custom_mode, int32_t latitude, int32_t longitude, int16_t altitude, int16_t target_altitude, uint8_t heading, uint8_t target_heading, uint16_t target_distance, uint8_t throttle, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, uint8_t windspeed, uint8_t wind_heading, uint8_t eph, uint8_t epv, int8_t temperature_air, int8_t climb_rate, int8_t battery, uint16_t wp_num, uint16_t failure_flags, int8_t custom0, int8_t custom1, int8_t custom2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, timestamp);
|
||||
_mav_put_int32_t(buf, 4, latitude);
|
||||
_mav_put_int32_t(buf, 8, longitude);
|
||||
_mav_put_uint16_t(buf, 12, custom_mode);
|
||||
_mav_put_int16_t(buf, 14, altitude);
|
||||
_mav_put_int16_t(buf, 16, target_altitude);
|
||||
_mav_put_uint16_t(buf, 18, target_distance);
|
||||
_mav_put_uint16_t(buf, 20, wp_num);
|
||||
_mav_put_uint16_t(buf, 22, failure_flags);
|
||||
_mav_put_uint8_t(buf, 24, type);
|
||||
_mav_put_uint8_t(buf, 25, autopilot);
|
||||
_mav_put_uint8_t(buf, 26, heading);
|
||||
_mav_put_uint8_t(buf, 27, target_heading);
|
||||
_mav_put_uint8_t(buf, 28, throttle);
|
||||
_mav_put_uint8_t(buf, 29, airspeed);
|
||||
_mav_put_uint8_t(buf, 30, airspeed_sp);
|
||||
_mav_put_uint8_t(buf, 31, groundspeed);
|
||||
_mav_put_uint8_t(buf, 32, windspeed);
|
||||
_mav_put_uint8_t(buf, 33, wind_heading);
|
||||
_mav_put_uint8_t(buf, 34, eph);
|
||||
_mav_put_uint8_t(buf, 35, epv);
|
||||
_mav_put_int8_t(buf, 36, temperature_air);
|
||||
_mav_put_int8_t(buf, 37, climb_rate);
|
||||
_mav_put_int8_t(buf, 38, battery);
|
||||
_mav_put_int8_t(buf, 39, custom0);
|
||||
_mav_put_int8_t(buf, 40, custom1);
|
||||
_mav_put_int8_t(buf, 41, custom2);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, buf, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
|
||||
#else
|
||||
mavlink_high_latency2_t *packet = (mavlink_high_latency2_t *)msgbuf;
|
||||
packet->timestamp = timestamp;
|
||||
packet->latitude = latitude;
|
||||
packet->longitude = longitude;
|
||||
packet->custom_mode = custom_mode;
|
||||
packet->altitude = altitude;
|
||||
packet->target_altitude = target_altitude;
|
||||
packet->target_distance = target_distance;
|
||||
packet->wp_num = wp_num;
|
||||
packet->failure_flags = failure_flags;
|
||||
packet->type = type;
|
||||
packet->autopilot = autopilot;
|
||||
packet->heading = heading;
|
||||
packet->target_heading = target_heading;
|
||||
packet->throttle = throttle;
|
||||
packet->airspeed = airspeed;
|
||||
packet->airspeed_sp = airspeed_sp;
|
||||
packet->groundspeed = groundspeed;
|
||||
packet->windspeed = windspeed;
|
||||
packet->wind_heading = wind_heading;
|
||||
packet->eph = eph;
|
||||
packet->epv = epv;
|
||||
packet->temperature_air = temperature_air;
|
||||
packet->climb_rate = climb_rate;
|
||||
packet->battery = battery;
|
||||
packet->custom0 = custom0;
|
||||
packet->custom1 = custom1;
|
||||
packet->custom2 = custom2;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, (const char *)packet, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIGH_LATENCY2 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field timestamp from high_latency2 message
|
||||
*
|
||||
* @return [ms] Timestamp (milliseconds since boot or Unix epoch)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_high_latency2_get_timestamp(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field type from high_latency2 message
|
||||
*
|
||||
* @return Type of the MAV (quadrotor, helicopter, etc.)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field autopilot from high_latency2 message
|
||||
*
|
||||
* @return Autopilot type / class.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_autopilot(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 25);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field custom_mode from high_latency2 message
|
||||
*
|
||||
* @return A bitfield for use for autopilot-specific flags (2 byte version).
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency2_get_custom_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field latitude from high_latency2 message
|
||||
*
|
||||
* @return [degE7] Latitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_high_latency2_get_latitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field longitude from high_latency2 message
|
||||
*
|
||||
* @return [degE7] Longitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_high_latency2_get_longitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude from high_latency2 message
|
||||
*
|
||||
* @return [m] Altitude above mean sea level
|
||||
*/
|
||||
static inline int16_t mavlink_msg_high_latency2_get_altitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_altitude from high_latency2 message
|
||||
*
|
||||
* @return [m] Altitude setpoint
|
||||
*/
|
||||
static inline int16_t mavlink_msg_high_latency2_get_target_altitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field heading from high_latency2 message
|
||||
*
|
||||
* @return [deg/2] Heading
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_heading(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_heading from high_latency2 message
|
||||
*
|
||||
* @return [deg/2] Heading setpoint
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_target_heading(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 27);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_distance from high_latency2 message
|
||||
*
|
||||
* @return [dam] Distance to target waypoint or position
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency2_get_target_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field throttle from high_latency2 message
|
||||
*
|
||||
* @return [%] Throttle
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_throttle(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field airspeed from high_latency2 message
|
||||
*
|
||||
* @return [m/s*5] Airspeed
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_airspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 29);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field airspeed_sp from high_latency2 message
|
||||
*
|
||||
* @return [m/s*5] Airspeed setpoint
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_airspeed_sp(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field groundspeed from high_latency2 message
|
||||
*
|
||||
* @return [m/s*5] Groundspeed
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_groundspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field windspeed from high_latency2 message
|
||||
*
|
||||
* @return [m/s*5] Windspeed
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_windspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field wind_heading from high_latency2 message
|
||||
*
|
||||
* @return [deg/2] Wind heading
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_wind_heading(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field eph from high_latency2 message
|
||||
*
|
||||
* @return [dm] Maximum error horizontal position since last message
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_eph(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field epv from high_latency2 message
|
||||
*
|
||||
* @return [dm] Maximum error vertical position since last message
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_high_latency2_get_epv(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 35);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field temperature_air from high_latency2 message
|
||||
*
|
||||
* @return [degC] Air temperature from airspeed sensor
|
||||
*/
|
||||
static inline int8_t mavlink_msg_high_latency2_get_temperature_air(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field climb_rate from high_latency2 message
|
||||
*
|
||||
* @return [dm/s] Maximum climb rate magnitude since last message
|
||||
*/
|
||||
static inline int8_t mavlink_msg_high_latency2_get_climb_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 37);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field battery from high_latency2 message
|
||||
*
|
||||
* @return [%] Battery (percentage, -1 for DNU)
|
||||
*/
|
||||
static inline int8_t mavlink_msg_high_latency2_get_battery(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 38);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field wp_num from high_latency2 message
|
||||
*
|
||||
* @return Current waypoint number
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency2_get_wp_num(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field failure_flags from high_latency2 message
|
||||
*
|
||||
* @return Bitmap of failure flags.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_high_latency2_get_failure_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field custom0 from high_latency2 message
|
||||
*
|
||||
* @return Field for custom payload.
|
||||
*/
|
||||
static inline int8_t mavlink_msg_high_latency2_get_custom0(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 39);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field custom1 from high_latency2 message
|
||||
*
|
||||
* @return Field for custom payload.
|
||||
*/
|
||||
static inline int8_t mavlink_msg_high_latency2_get_custom1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field custom2 from high_latency2 message
|
||||
*
|
||||
* @return Field for custom payload.
|
||||
*/
|
||||
static inline int8_t mavlink_msg_high_latency2_get_custom2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 41);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a high_latency2 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param high_latency2 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_high_latency2_decode(const mavlink_message_t* msg, mavlink_high_latency2_t* high_latency2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
high_latency2->timestamp = mavlink_msg_high_latency2_get_timestamp(msg);
|
||||
high_latency2->latitude = mavlink_msg_high_latency2_get_latitude(msg);
|
||||
high_latency2->longitude = mavlink_msg_high_latency2_get_longitude(msg);
|
||||
high_latency2->custom_mode = mavlink_msg_high_latency2_get_custom_mode(msg);
|
||||
high_latency2->altitude = mavlink_msg_high_latency2_get_altitude(msg);
|
||||
high_latency2->target_altitude = mavlink_msg_high_latency2_get_target_altitude(msg);
|
||||
high_latency2->target_distance = mavlink_msg_high_latency2_get_target_distance(msg);
|
||||
high_latency2->wp_num = mavlink_msg_high_latency2_get_wp_num(msg);
|
||||
high_latency2->failure_flags = mavlink_msg_high_latency2_get_failure_flags(msg);
|
||||
high_latency2->type = mavlink_msg_high_latency2_get_type(msg);
|
||||
high_latency2->autopilot = mavlink_msg_high_latency2_get_autopilot(msg);
|
||||
high_latency2->heading = mavlink_msg_high_latency2_get_heading(msg);
|
||||
high_latency2->target_heading = mavlink_msg_high_latency2_get_target_heading(msg);
|
||||
high_latency2->throttle = mavlink_msg_high_latency2_get_throttle(msg);
|
||||
high_latency2->airspeed = mavlink_msg_high_latency2_get_airspeed(msg);
|
||||
high_latency2->airspeed_sp = mavlink_msg_high_latency2_get_airspeed_sp(msg);
|
||||
high_latency2->groundspeed = mavlink_msg_high_latency2_get_groundspeed(msg);
|
||||
high_latency2->windspeed = mavlink_msg_high_latency2_get_windspeed(msg);
|
||||
high_latency2->wind_heading = mavlink_msg_high_latency2_get_wind_heading(msg);
|
||||
high_latency2->eph = mavlink_msg_high_latency2_get_eph(msg);
|
||||
high_latency2->epv = mavlink_msg_high_latency2_get_epv(msg);
|
||||
high_latency2->temperature_air = mavlink_msg_high_latency2_get_temperature_air(msg);
|
||||
high_latency2->climb_rate = mavlink_msg_high_latency2_get_climb_rate(msg);
|
||||
high_latency2->battery = mavlink_msg_high_latency2_get_battery(msg);
|
||||
high_latency2->custom0 = mavlink_msg_high_latency2_get_custom0(msg);
|
||||
high_latency2->custom1 = mavlink_msg_high_latency2_get_custom1(msg);
|
||||
high_latency2->custom2 = mavlink_msg_high_latency2_get_custom2(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HIGH_LATENCY2_LEN? msg->len : MAVLINK_MSG_ID_HIGH_LATENCY2_LEN;
|
||||
memset(high_latency2, 0, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
|
||||
memcpy(high_latency2, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,563 @@
|
||||
#pragma once
|
||||
// MESSAGE HIGHRES_IMU PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIGHRES_IMU 105
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_highres_imu_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float xacc; /*< [m/s/s] X acceleration*/
|
||||
float yacc; /*< [m/s/s] Y acceleration*/
|
||||
float zacc; /*< [m/s/s] Z acceleration*/
|
||||
float xgyro; /*< [rad/s] Angular speed around X axis*/
|
||||
float ygyro; /*< [rad/s] Angular speed around Y axis*/
|
||||
float zgyro; /*< [rad/s] Angular speed around Z axis*/
|
||||
float xmag; /*< [gauss] X Magnetic field*/
|
||||
float ymag; /*< [gauss] Y Magnetic field*/
|
||||
float zmag; /*< [gauss] Z Magnetic field*/
|
||||
float abs_pressure; /*< [mbar] Absolute pressure*/
|
||||
float diff_pressure; /*< [mbar] Differential pressure*/
|
||||
float pressure_alt; /*< Altitude calculated from pressure*/
|
||||
float temperature; /*< [degC] Temperature*/
|
||||
uint16_t fields_updated; /*< Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature*/
|
||||
}) mavlink_highres_imu_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIGHRES_IMU_LEN 62
|
||||
#define MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN 62
|
||||
#define MAVLINK_MSG_ID_105_LEN 62
|
||||
#define MAVLINK_MSG_ID_105_MIN_LEN 62
|
||||
|
||||
#define MAVLINK_MSG_ID_HIGHRES_IMU_CRC 93
|
||||
#define MAVLINK_MSG_ID_105_CRC 93
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \
|
||||
105, \
|
||||
"HIGHRES_IMU", \
|
||||
15, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \
|
||||
{ "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_highres_imu_t, xgyro) }, \
|
||||
{ "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_highres_imu_t, ygyro) }, \
|
||||
{ "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_highres_imu_t, zgyro) }, \
|
||||
{ "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_highres_imu_t, xmag) }, \
|
||||
{ "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_highres_imu_t, ymag) }, \
|
||||
{ "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_highres_imu_t, zmag) }, \
|
||||
{ "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_highres_imu_t, abs_pressure) }, \
|
||||
{ "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_highres_imu_t, diff_pressure) }, \
|
||||
{ "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_highres_imu_t, pressure_alt) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_highres_imu_t, temperature) }, \
|
||||
{ "fields_updated", NULL, MAVLINK_TYPE_UINT16_T, 0, 60, offsetof(mavlink_highres_imu_t, fields_updated) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \
|
||||
"HIGHRES_IMU", \
|
||||
15, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \
|
||||
{ "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_highres_imu_t, xgyro) }, \
|
||||
{ "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_highres_imu_t, ygyro) }, \
|
||||
{ "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_highres_imu_t, zgyro) }, \
|
||||
{ "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_highres_imu_t, xmag) }, \
|
||||
{ "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_highres_imu_t, ymag) }, \
|
||||
{ "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_highres_imu_t, zmag) }, \
|
||||
{ "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_highres_imu_t, abs_pressure) }, \
|
||||
{ "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_highres_imu_t, diff_pressure) }, \
|
||||
{ "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_highres_imu_t, pressure_alt) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_highres_imu_t, temperature) }, \
|
||||
{ "fields_updated", NULL, MAVLINK_TYPE_UINT16_T, 0, 60, offsetof(mavlink_highres_imu_t, fields_updated) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a highres_imu message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param xacc [m/s/s] X acceleration
|
||||
* @param yacc [m/s/s] Y acceleration
|
||||
* @param zacc [m/s/s] Z acceleration
|
||||
* @param xgyro [rad/s] Angular speed around X axis
|
||||
* @param ygyro [rad/s] Angular speed around Y axis
|
||||
* @param zgyro [rad/s] Angular speed around Z axis
|
||||
* @param xmag [gauss] X Magnetic field
|
||||
* @param ymag [gauss] Y Magnetic field
|
||||
* @param zmag [gauss] Z Magnetic field
|
||||
* @param abs_pressure [mbar] Absolute pressure
|
||||
* @param diff_pressure [mbar] Differential pressure
|
||||
* @param pressure_alt Altitude calculated from pressure
|
||||
* @param temperature [degC] Temperature
|
||||
* @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, xacc);
|
||||
_mav_put_float(buf, 12, yacc);
|
||||
_mav_put_float(buf, 16, zacc);
|
||||
_mav_put_float(buf, 20, xgyro);
|
||||
_mav_put_float(buf, 24, ygyro);
|
||||
_mav_put_float(buf, 28, zgyro);
|
||||
_mav_put_float(buf, 32, xmag);
|
||||
_mav_put_float(buf, 36, ymag);
|
||||
_mav_put_float(buf, 40, zmag);
|
||||
_mav_put_float(buf, 44, abs_pressure);
|
||||
_mav_put_float(buf, 48, diff_pressure);
|
||||
_mav_put_float(buf, 52, pressure_alt);
|
||||
_mav_put_float(buf, 56, temperature);
|
||||
_mav_put_uint16_t(buf, 60, fields_updated);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
|
||||
#else
|
||||
mavlink_highres_imu_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
packet.abs_pressure = abs_pressure;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.pressure_alt = pressure_alt;
|
||||
packet.temperature = temperature;
|
||||
packet.fields_updated = fields_updated;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a highres_imu message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param xacc [m/s/s] X acceleration
|
||||
* @param yacc [m/s/s] Y acceleration
|
||||
* @param zacc [m/s/s] Z acceleration
|
||||
* @param xgyro [rad/s] Angular speed around X axis
|
||||
* @param ygyro [rad/s] Angular speed around Y axis
|
||||
* @param zgyro [rad/s] Angular speed around Z axis
|
||||
* @param xmag [gauss] X Magnetic field
|
||||
* @param ymag [gauss] Y Magnetic field
|
||||
* @param zmag [gauss] Z Magnetic field
|
||||
* @param abs_pressure [mbar] Absolute pressure
|
||||
* @param diff_pressure [mbar] Differential pressure
|
||||
* @param pressure_alt Altitude calculated from pressure
|
||||
* @param temperature [degC] Temperature
|
||||
* @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint16_t fields_updated)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, xacc);
|
||||
_mav_put_float(buf, 12, yacc);
|
||||
_mav_put_float(buf, 16, zacc);
|
||||
_mav_put_float(buf, 20, xgyro);
|
||||
_mav_put_float(buf, 24, ygyro);
|
||||
_mav_put_float(buf, 28, zgyro);
|
||||
_mav_put_float(buf, 32, xmag);
|
||||
_mav_put_float(buf, 36, ymag);
|
||||
_mav_put_float(buf, 40, zmag);
|
||||
_mav_put_float(buf, 44, abs_pressure);
|
||||
_mav_put_float(buf, 48, diff_pressure);
|
||||
_mav_put_float(buf, 52, pressure_alt);
|
||||
_mav_put_float(buf, 56, temperature);
|
||||
_mav_put_uint16_t(buf, 60, fields_updated);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
|
||||
#else
|
||||
mavlink_highres_imu_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
packet.abs_pressure = abs_pressure;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.pressure_alt = pressure_alt;
|
||||
packet.temperature = temperature;
|
||||
packet.fields_updated = fields_updated;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a highres_imu struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param highres_imu C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_highres_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu)
|
||||
{
|
||||
return mavlink_msg_highres_imu_pack(system_id, component_id, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a highres_imu struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param highres_imu C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_highres_imu_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu)
|
||||
{
|
||||
return mavlink_msg_highres_imu_pack_chan(system_id, component_id, chan, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a highres_imu message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param xacc [m/s/s] X acceleration
|
||||
* @param yacc [m/s/s] Y acceleration
|
||||
* @param zacc [m/s/s] Z acceleration
|
||||
* @param xgyro [rad/s] Angular speed around X axis
|
||||
* @param ygyro [rad/s] Angular speed around Y axis
|
||||
* @param zgyro [rad/s] Angular speed around Z axis
|
||||
* @param xmag [gauss] X Magnetic field
|
||||
* @param ymag [gauss] Y Magnetic field
|
||||
* @param zmag [gauss] Z Magnetic field
|
||||
* @param abs_pressure [mbar] Absolute pressure
|
||||
* @param diff_pressure [mbar] Differential pressure
|
||||
* @param pressure_alt Altitude calculated from pressure
|
||||
* @param temperature [degC] Temperature
|
||||
* @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, xacc);
|
||||
_mav_put_float(buf, 12, yacc);
|
||||
_mav_put_float(buf, 16, zacc);
|
||||
_mav_put_float(buf, 20, xgyro);
|
||||
_mav_put_float(buf, 24, ygyro);
|
||||
_mav_put_float(buf, 28, zgyro);
|
||||
_mav_put_float(buf, 32, xmag);
|
||||
_mav_put_float(buf, 36, ymag);
|
||||
_mav_put_float(buf, 40, zmag);
|
||||
_mav_put_float(buf, 44, abs_pressure);
|
||||
_mav_put_float(buf, 48, diff_pressure);
|
||||
_mav_put_float(buf, 52, pressure_alt);
|
||||
_mav_put_float(buf, 56, temperature);
|
||||
_mav_put_uint16_t(buf, 60, fields_updated);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
|
||||
#else
|
||||
mavlink_highres_imu_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
packet.abs_pressure = abs_pressure;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.pressure_alt = pressure_alt;
|
||||
packet.temperature = temperature;
|
||||
packet.fields_updated = fields_updated;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a highres_imu message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_highres_imu_send_struct(mavlink_channel_t chan, const mavlink_highres_imu_t* highres_imu)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_highres_imu_send(chan, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)highres_imu, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HIGHRES_IMU_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_highres_imu_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, xacc);
|
||||
_mav_put_float(buf, 12, yacc);
|
||||
_mav_put_float(buf, 16, zacc);
|
||||
_mav_put_float(buf, 20, xgyro);
|
||||
_mav_put_float(buf, 24, ygyro);
|
||||
_mav_put_float(buf, 28, zgyro);
|
||||
_mav_put_float(buf, 32, xmag);
|
||||
_mav_put_float(buf, 36, ymag);
|
||||
_mav_put_float(buf, 40, zmag);
|
||||
_mav_put_float(buf, 44, abs_pressure);
|
||||
_mav_put_float(buf, 48, diff_pressure);
|
||||
_mav_put_float(buf, 52, pressure_alt);
|
||||
_mav_put_float(buf, 56, temperature);
|
||||
_mav_put_uint16_t(buf, 60, fields_updated);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
|
||||
#else
|
||||
mavlink_highres_imu_t *packet = (mavlink_highres_imu_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->xacc = xacc;
|
||||
packet->yacc = yacc;
|
||||
packet->zacc = zacc;
|
||||
packet->xgyro = xgyro;
|
||||
packet->ygyro = ygyro;
|
||||
packet->zgyro = zgyro;
|
||||
packet->xmag = xmag;
|
||||
packet->ymag = ymag;
|
||||
packet->zmag = zmag;
|
||||
packet->abs_pressure = abs_pressure;
|
||||
packet->diff_pressure = diff_pressure;
|
||||
packet->pressure_alt = pressure_alt;
|
||||
packet->temperature = temperature;
|
||||
packet->fields_updated = fields_updated;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)packet, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIGHRES_IMU UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from highres_imu message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_highres_imu_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xacc from highres_imu message
|
||||
*
|
||||
* @return [m/s/s] X acceleration
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_xacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yacc from highres_imu message
|
||||
*
|
||||
* @return [m/s/s] Y acceleration
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_yacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zacc from highres_imu message
|
||||
*
|
||||
* @return [m/s/s] Z acceleration
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_zacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xgyro from highres_imu message
|
||||
*
|
||||
* @return [rad/s] Angular speed around X axis
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_xgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ygyro from highres_imu message
|
||||
*
|
||||
* @return [rad/s] Angular speed around Y axis
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_ygyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zgyro from highres_imu message
|
||||
*
|
||||
* @return [rad/s] Angular speed around Z axis
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_zgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xmag from highres_imu message
|
||||
*
|
||||
* @return [gauss] X Magnetic field
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_xmag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ymag from highres_imu message
|
||||
*
|
||||
* @return [gauss] Y Magnetic field
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_ymag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zmag from highres_imu message
|
||||
*
|
||||
* @return [gauss] Z Magnetic field
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_zmag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field abs_pressure from highres_imu message
|
||||
*
|
||||
* @return [mbar] Absolute pressure
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diff_pressure from highres_imu message
|
||||
*
|
||||
* @return [mbar] Differential pressure
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_diff_pressure(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pressure_alt from highres_imu message
|
||||
*
|
||||
* @return Altitude calculated from pressure
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_pressure_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field temperature from highres_imu message
|
||||
*
|
||||
* @return [degC] Temperature
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_temperature(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 56);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fields_updated from highres_imu message
|
||||
*
|
||||
* @return Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_highres_imu_get_fields_updated(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a highres_imu message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param highres_imu C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_highres_imu_decode(const mavlink_message_t* msg, mavlink_highres_imu_t* highres_imu)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
highres_imu->time_usec = mavlink_msg_highres_imu_get_time_usec(msg);
|
||||
highres_imu->xacc = mavlink_msg_highres_imu_get_xacc(msg);
|
||||
highres_imu->yacc = mavlink_msg_highres_imu_get_yacc(msg);
|
||||
highres_imu->zacc = mavlink_msg_highres_imu_get_zacc(msg);
|
||||
highres_imu->xgyro = mavlink_msg_highres_imu_get_xgyro(msg);
|
||||
highres_imu->ygyro = mavlink_msg_highres_imu_get_ygyro(msg);
|
||||
highres_imu->zgyro = mavlink_msg_highres_imu_get_zgyro(msg);
|
||||
highres_imu->xmag = mavlink_msg_highres_imu_get_xmag(msg);
|
||||
highres_imu->ymag = mavlink_msg_highres_imu_get_ymag(msg);
|
||||
highres_imu->zmag = mavlink_msg_highres_imu_get_zmag(msg);
|
||||
highres_imu->abs_pressure = mavlink_msg_highres_imu_get_abs_pressure(msg);
|
||||
highres_imu->diff_pressure = mavlink_msg_highres_imu_get_diff_pressure(msg);
|
||||
highres_imu->pressure_alt = mavlink_msg_highres_imu_get_pressure_alt(msg);
|
||||
highres_imu->temperature = mavlink_msg_highres_imu_get_temperature(msg);
|
||||
highres_imu->fields_updated = mavlink_msg_highres_imu_get_fields_updated(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HIGHRES_IMU_LEN? msg->len : MAVLINK_MSG_ID_HIGHRES_IMU_LEN;
|
||||
memset(highres_imu, 0, MAVLINK_MSG_ID_HIGHRES_IMU_LEN);
|
||||
memcpy(highres_imu, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
#pragma once
|
||||
// MESSAGE HIL_ACTUATOR_CONTROLS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS 93
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_hil_actuator_controls_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
uint64_t flags; /*< Flags as bitfield, reserved for future use.*/
|
||||
float controls[16]; /*< Control outputs -1 .. 1. Channel assignment depends on the simulated hardware.*/
|
||||
uint8_t mode; /*< System mode. Includes arming state.*/
|
||||
}) mavlink_hil_actuator_controls_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN 81
|
||||
#define MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN 81
|
||||
#define MAVLINK_MSG_ID_93_LEN 81
|
||||
#define MAVLINK_MSG_ID_93_MIN_LEN 81
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_CRC 47
|
||||
#define MAVLINK_MSG_ID_93_CRC 47
|
||||
|
||||
#define MAVLINK_MSG_HIL_ACTUATOR_CONTROLS_FIELD_CONTROLS_LEN 16
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_ACTUATOR_CONTROLS { \
|
||||
93, \
|
||||
"HIL_ACTUATOR_CONTROLS", \
|
||||
4, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_actuator_controls_t, time_usec) }, \
|
||||
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 16, 16, offsetof(mavlink_hil_actuator_controls_t, controls) }, \
|
||||
{ "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 80, offsetof(mavlink_hil_actuator_controls_t, mode) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_hil_actuator_controls_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_ACTUATOR_CONTROLS { \
|
||||
"HIL_ACTUATOR_CONTROLS", \
|
||||
4, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_actuator_controls_t, time_usec) }, \
|
||||
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 16, 16, offsetof(mavlink_hil_actuator_controls_t, controls) }, \
|
||||
{ "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 80, offsetof(mavlink_hil_actuator_controls_t, mode) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_hil_actuator_controls_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_actuator_controls message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param controls Control outputs -1 .. 1. Channel assignment depends on the simulated hardware.
|
||||
* @param mode System mode. Includes arming state.
|
||||
* @param flags Flags as bitfield, reserved for future use.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_actuator_controls_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, const float *controls, uint8_t mode, uint64_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint64_t(buf, 8, flags);
|
||||
_mav_put_uint8_t(buf, 80, mode);
|
||||
_mav_put_float_array(buf, 16, controls, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN);
|
||||
#else
|
||||
mavlink_hil_actuator_controls_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.flags = flags;
|
||||
packet.mode = mode;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_actuator_controls message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param controls Control outputs -1 .. 1. Channel assignment depends on the simulated hardware.
|
||||
* @param mode System mode. Includes arming state.
|
||||
* @param flags Flags as bitfield, reserved for future use.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_actuator_controls_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,const float *controls,uint8_t mode,uint64_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint64_t(buf, 8, flags);
|
||||
_mav_put_uint8_t(buf, 80, mode);
|
||||
_mav_put_float_array(buf, 16, controls, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN);
|
||||
#else
|
||||
mavlink_hil_actuator_controls_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.flags = flags;
|
||||
packet.mode = mode;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_actuator_controls struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_actuator_controls C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_actuator_controls_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_actuator_controls_t* hil_actuator_controls)
|
||||
{
|
||||
return mavlink_msg_hil_actuator_controls_pack(system_id, component_id, msg, hil_actuator_controls->time_usec, hil_actuator_controls->controls, hil_actuator_controls->mode, hil_actuator_controls->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_actuator_controls struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_actuator_controls C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_actuator_controls_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_actuator_controls_t* hil_actuator_controls)
|
||||
{
|
||||
return mavlink_msg_hil_actuator_controls_pack_chan(system_id, component_id, chan, msg, hil_actuator_controls->time_usec, hil_actuator_controls->controls, hil_actuator_controls->mode, hil_actuator_controls->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_actuator_controls message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param controls Control outputs -1 .. 1. Channel assignment depends on the simulated hardware.
|
||||
* @param mode System mode. Includes arming state.
|
||||
* @param flags Flags as bitfield, reserved for future use.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_hil_actuator_controls_send(mavlink_channel_t chan, uint64_t time_usec, const float *controls, uint8_t mode, uint64_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint64_t(buf, 8, flags);
|
||||
_mav_put_uint8_t(buf, 80, mode);
|
||||
_mav_put_float_array(buf, 16, controls, 16);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS, buf, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_CRC);
|
||||
#else
|
||||
mavlink_hil_actuator_controls_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.flags = flags;
|
||||
packet.mode = mode;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*16);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS, (const char *)&packet, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_actuator_controls message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_hil_actuator_controls_send_struct(mavlink_channel_t chan, const mavlink_hil_actuator_controls_t* hil_actuator_controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_hil_actuator_controls_send(chan, hil_actuator_controls->time_usec, hil_actuator_controls->controls, hil_actuator_controls->mode, hil_actuator_controls->flags);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS, (const char *)hil_actuator_controls, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_hil_actuator_controls_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, const float *controls, uint8_t mode, uint64_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint64_t(buf, 8, flags);
|
||||
_mav_put_uint8_t(buf, 80, mode);
|
||||
_mav_put_float_array(buf, 16, controls, 16);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS, buf, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_CRC);
|
||||
#else
|
||||
mavlink_hil_actuator_controls_t *packet = (mavlink_hil_actuator_controls_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->flags = flags;
|
||||
packet->mode = mode;
|
||||
mav_array_memcpy(packet->controls, controls, sizeof(float)*16);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS, (const char *)packet, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIL_ACTUATOR_CONTROLS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from hil_actuator_controls message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_hil_actuator_controls_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field controls from hil_actuator_controls message
|
||||
*
|
||||
* @return Control outputs -1 .. 1. Channel assignment depends on the simulated hardware.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_actuator_controls_get_controls(const mavlink_message_t* msg, float *controls)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, controls, 16, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mode from hil_actuator_controls message
|
||||
*
|
||||
* @return System mode. Includes arming state.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_hil_actuator_controls_get_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 80);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from hil_actuator_controls message
|
||||
*
|
||||
* @return Flags as bitfield, reserved for future use.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_hil_actuator_controls_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a hil_actuator_controls message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param hil_actuator_controls C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_hil_actuator_controls_decode(const mavlink_message_t* msg, mavlink_hil_actuator_controls_t* hil_actuator_controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
hil_actuator_controls->time_usec = mavlink_msg_hil_actuator_controls_get_time_usec(msg);
|
||||
hil_actuator_controls->flags = mavlink_msg_hil_actuator_controls_get_flags(msg);
|
||||
mavlink_msg_hil_actuator_controls_get_controls(msg, hil_actuator_controls->controls);
|
||||
hil_actuator_controls->mode = mavlink_msg_hil_actuator_controls_get_mode(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN? msg->len : MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN;
|
||||
memset(hil_actuator_controls, 0, MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_LEN);
|
||||
memcpy(hil_actuator_controls, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,463 @@
|
||||
#pragma once
|
||||
// MESSAGE HIL_CONTROLS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_CONTROLS 91
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_hil_controls_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float roll_ailerons; /*< Control output -1 .. 1*/
|
||||
float pitch_elevator; /*< Control output -1 .. 1*/
|
||||
float yaw_rudder; /*< Control output -1 .. 1*/
|
||||
float throttle; /*< Throttle 0 .. 1*/
|
||||
float aux1; /*< Aux 1, -1 .. 1*/
|
||||
float aux2; /*< Aux 2, -1 .. 1*/
|
||||
float aux3; /*< Aux 3, -1 .. 1*/
|
||||
float aux4; /*< Aux 4, -1 .. 1*/
|
||||
uint8_t mode; /*< System mode.*/
|
||||
uint8_t nav_mode; /*< Navigation mode (MAV_NAV_MODE)*/
|
||||
}) mavlink_hil_controls_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_CONTROLS_LEN 42
|
||||
#define MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN 42
|
||||
#define MAVLINK_MSG_ID_91_LEN 42
|
||||
#define MAVLINK_MSG_ID_91_MIN_LEN 42
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_CONTROLS_CRC 63
|
||||
#define MAVLINK_MSG_ID_91_CRC 63
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_CONTROLS { \
|
||||
91, \
|
||||
"HIL_CONTROLS", \
|
||||
11, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_controls_t, time_usec) }, \
|
||||
{ "roll_ailerons", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_controls_t, roll_ailerons) }, \
|
||||
{ "pitch_elevator", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_controls_t, pitch_elevator) }, \
|
||||
{ "yaw_rudder", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_controls_t, yaw_rudder) }, \
|
||||
{ "throttle", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_controls_t, throttle) }, \
|
||||
{ "aux1", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_controls_t, aux1) }, \
|
||||
{ "aux2", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_controls_t, aux2) }, \
|
||||
{ "aux3", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_controls_t, aux3) }, \
|
||||
{ "aux4", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_controls_t, aux4) }, \
|
||||
{ "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_hil_controls_t, mode) }, \
|
||||
{ "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_hil_controls_t, nav_mode) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_CONTROLS { \
|
||||
"HIL_CONTROLS", \
|
||||
11, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_controls_t, time_usec) }, \
|
||||
{ "roll_ailerons", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_controls_t, roll_ailerons) }, \
|
||||
{ "pitch_elevator", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_controls_t, pitch_elevator) }, \
|
||||
{ "yaw_rudder", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_controls_t, yaw_rudder) }, \
|
||||
{ "throttle", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_controls_t, throttle) }, \
|
||||
{ "aux1", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_controls_t, aux1) }, \
|
||||
{ "aux2", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_controls_t, aux2) }, \
|
||||
{ "aux3", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_controls_t, aux3) }, \
|
||||
{ "aux4", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_controls_t, aux4) }, \
|
||||
{ "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_hil_controls_t, mode) }, \
|
||||
{ "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_hil_controls_t, nav_mode) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_controls message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param roll_ailerons Control output -1 .. 1
|
||||
* @param pitch_elevator Control output -1 .. 1
|
||||
* @param yaw_rudder Control output -1 .. 1
|
||||
* @param throttle Throttle 0 .. 1
|
||||
* @param aux1 Aux 1, -1 .. 1
|
||||
* @param aux2 Aux 2, -1 .. 1
|
||||
* @param aux3 Aux 3, -1 .. 1
|
||||
* @param aux4 Aux 4, -1 .. 1
|
||||
* @param mode System mode.
|
||||
* @param nav_mode Navigation mode (MAV_NAV_MODE)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, roll_ailerons);
|
||||
_mav_put_float(buf, 12, pitch_elevator);
|
||||
_mav_put_float(buf, 16, yaw_rudder);
|
||||
_mav_put_float(buf, 20, throttle);
|
||||
_mav_put_float(buf, 24, aux1);
|
||||
_mav_put_float(buf, 28, aux2);
|
||||
_mav_put_float(buf, 32, aux3);
|
||||
_mav_put_float(buf, 36, aux4);
|
||||
_mav_put_uint8_t(buf, 40, mode);
|
||||
_mav_put_uint8_t(buf, 41, nav_mode);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN);
|
||||
#else
|
||||
mavlink_hil_controls_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.roll_ailerons = roll_ailerons;
|
||||
packet.pitch_elevator = pitch_elevator;
|
||||
packet.yaw_rudder = yaw_rudder;
|
||||
packet.throttle = throttle;
|
||||
packet.aux1 = aux1;
|
||||
packet.aux2 = aux2;
|
||||
packet.aux3 = aux3;
|
||||
packet.aux4 = aux4;
|
||||
packet.mode = mode;
|
||||
packet.nav_mode = nav_mode;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_controls message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param roll_ailerons Control output -1 .. 1
|
||||
* @param pitch_elevator Control output -1 .. 1
|
||||
* @param yaw_rudder Control output -1 .. 1
|
||||
* @param throttle Throttle 0 .. 1
|
||||
* @param aux1 Aux 1, -1 .. 1
|
||||
* @param aux2 Aux 2, -1 .. 1
|
||||
* @param aux3 Aux 3, -1 .. 1
|
||||
* @param aux4 Aux 4, -1 .. 1
|
||||
* @param mode System mode.
|
||||
* @param nav_mode Navigation mode (MAV_NAV_MODE)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,float roll_ailerons,float pitch_elevator,float yaw_rudder,float throttle,float aux1,float aux2,float aux3,float aux4,uint8_t mode,uint8_t nav_mode)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, roll_ailerons);
|
||||
_mav_put_float(buf, 12, pitch_elevator);
|
||||
_mav_put_float(buf, 16, yaw_rudder);
|
||||
_mav_put_float(buf, 20, throttle);
|
||||
_mav_put_float(buf, 24, aux1);
|
||||
_mav_put_float(buf, 28, aux2);
|
||||
_mav_put_float(buf, 32, aux3);
|
||||
_mav_put_float(buf, 36, aux4);
|
||||
_mav_put_uint8_t(buf, 40, mode);
|
||||
_mav_put_uint8_t(buf, 41, nav_mode);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN);
|
||||
#else
|
||||
mavlink_hil_controls_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.roll_ailerons = roll_ailerons;
|
||||
packet.pitch_elevator = pitch_elevator;
|
||||
packet.yaw_rudder = yaw_rudder;
|
||||
packet.throttle = throttle;
|
||||
packet.aux1 = aux1;
|
||||
packet.aux2 = aux2;
|
||||
packet.aux3 = aux3;
|
||||
packet.aux4 = aux4;
|
||||
packet.mode = mode;
|
||||
packet.nav_mode = nav_mode;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_controls struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_controls C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_controls_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_controls_t* hil_controls)
|
||||
{
|
||||
return mavlink_msg_hil_controls_pack(system_id, component_id, msg, hil_controls->time_usec, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->aux1, hil_controls->aux2, hil_controls->aux3, hil_controls->aux4, hil_controls->mode, hil_controls->nav_mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_controls struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_controls C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_controls_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_controls_t* hil_controls)
|
||||
{
|
||||
return mavlink_msg_hil_controls_pack_chan(system_id, component_id, chan, msg, hil_controls->time_usec, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->aux1, hil_controls->aux2, hil_controls->aux3, hil_controls->aux4, hil_controls->mode, hil_controls->nav_mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_controls message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param roll_ailerons Control output -1 .. 1
|
||||
* @param pitch_elevator Control output -1 .. 1
|
||||
* @param yaw_rudder Control output -1 .. 1
|
||||
* @param throttle Throttle 0 .. 1
|
||||
* @param aux1 Aux 1, -1 .. 1
|
||||
* @param aux2 Aux 2, -1 .. 1
|
||||
* @param aux3 Aux 3, -1 .. 1
|
||||
* @param aux4 Aux 4, -1 .. 1
|
||||
* @param mode System mode.
|
||||
* @param nav_mode Navigation mode (MAV_NAV_MODE)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_hil_controls_send(mavlink_channel_t chan, uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, roll_ailerons);
|
||||
_mav_put_float(buf, 12, pitch_elevator);
|
||||
_mav_put_float(buf, 16, yaw_rudder);
|
||||
_mav_put_float(buf, 20, throttle);
|
||||
_mav_put_float(buf, 24, aux1);
|
||||
_mav_put_float(buf, 28, aux2);
|
||||
_mav_put_float(buf, 32, aux3);
|
||||
_mav_put_float(buf, 36, aux4);
|
||||
_mav_put_uint8_t(buf, 40, mode);
|
||||
_mav_put_uint8_t(buf, 41, nav_mode);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
|
||||
#else
|
||||
mavlink_hil_controls_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.roll_ailerons = roll_ailerons;
|
||||
packet.pitch_elevator = pitch_elevator;
|
||||
packet.yaw_rudder = yaw_rudder;
|
||||
packet.throttle = throttle;
|
||||
packet.aux1 = aux1;
|
||||
packet.aux2 = aux2;
|
||||
packet.aux3 = aux3;
|
||||
packet.aux4 = aux4;
|
||||
packet.mode = mode;
|
||||
packet.nav_mode = nav_mode;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)&packet, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_controls message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_hil_controls_send_struct(mavlink_channel_t chan, const mavlink_hil_controls_t* hil_controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_hil_controls_send(chan, hil_controls->time_usec, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->aux1, hil_controls->aux2, hil_controls->aux3, hil_controls->aux4, hil_controls->mode, hil_controls->nav_mode);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)hil_controls, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HIL_CONTROLS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_hil_controls_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, roll_ailerons);
|
||||
_mav_put_float(buf, 12, pitch_elevator);
|
||||
_mav_put_float(buf, 16, yaw_rudder);
|
||||
_mav_put_float(buf, 20, throttle);
|
||||
_mav_put_float(buf, 24, aux1);
|
||||
_mav_put_float(buf, 28, aux2);
|
||||
_mav_put_float(buf, 32, aux3);
|
||||
_mav_put_float(buf, 36, aux4);
|
||||
_mav_put_uint8_t(buf, 40, mode);
|
||||
_mav_put_uint8_t(buf, 41, nav_mode);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
|
||||
#else
|
||||
mavlink_hil_controls_t *packet = (mavlink_hil_controls_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->roll_ailerons = roll_ailerons;
|
||||
packet->pitch_elevator = pitch_elevator;
|
||||
packet->yaw_rudder = yaw_rudder;
|
||||
packet->throttle = throttle;
|
||||
packet->aux1 = aux1;
|
||||
packet->aux2 = aux2;
|
||||
packet->aux3 = aux3;
|
||||
packet->aux4 = aux4;
|
||||
packet->mode = mode;
|
||||
packet->nav_mode = nav_mode;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)packet, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIL_CONTROLS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from hil_controls message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_hil_controls_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll_ailerons from hil_controls message
|
||||
*
|
||||
* @return Control output -1 .. 1
|
||||
*/
|
||||
static inline float mavlink_msg_hil_controls_get_roll_ailerons(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch_elevator from hil_controls message
|
||||
*
|
||||
* @return Control output -1 .. 1
|
||||
*/
|
||||
static inline float mavlink_msg_hil_controls_get_pitch_elevator(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw_rudder from hil_controls message
|
||||
*
|
||||
* @return Control output -1 .. 1
|
||||
*/
|
||||
static inline float mavlink_msg_hil_controls_get_yaw_rudder(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field throttle from hil_controls message
|
||||
*
|
||||
* @return Throttle 0 .. 1
|
||||
*/
|
||||
static inline float mavlink_msg_hil_controls_get_throttle(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field aux1 from hil_controls message
|
||||
*
|
||||
* @return Aux 1, -1 .. 1
|
||||
*/
|
||||
static inline float mavlink_msg_hil_controls_get_aux1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field aux2 from hil_controls message
|
||||
*
|
||||
* @return Aux 2, -1 .. 1
|
||||
*/
|
||||
static inline float mavlink_msg_hil_controls_get_aux2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field aux3 from hil_controls message
|
||||
*
|
||||
* @return Aux 3, -1 .. 1
|
||||
*/
|
||||
static inline float mavlink_msg_hil_controls_get_aux3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field aux4 from hil_controls message
|
||||
*
|
||||
* @return Aux 4, -1 .. 1
|
||||
*/
|
||||
static inline float mavlink_msg_hil_controls_get_aux4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mode from hil_controls message
|
||||
*
|
||||
* @return System mode.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_hil_controls_get_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field nav_mode from hil_controls message
|
||||
*
|
||||
* @return Navigation mode (MAV_NAV_MODE)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_hil_controls_get_nav_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 41);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a hil_controls message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param hil_controls C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_hil_controls_decode(const mavlink_message_t* msg, mavlink_hil_controls_t* hil_controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
hil_controls->time_usec = mavlink_msg_hil_controls_get_time_usec(msg);
|
||||
hil_controls->roll_ailerons = mavlink_msg_hil_controls_get_roll_ailerons(msg);
|
||||
hil_controls->pitch_elevator = mavlink_msg_hil_controls_get_pitch_elevator(msg);
|
||||
hil_controls->yaw_rudder = mavlink_msg_hil_controls_get_yaw_rudder(msg);
|
||||
hil_controls->throttle = mavlink_msg_hil_controls_get_throttle(msg);
|
||||
hil_controls->aux1 = mavlink_msg_hil_controls_get_aux1(msg);
|
||||
hil_controls->aux2 = mavlink_msg_hil_controls_get_aux2(msg);
|
||||
hil_controls->aux3 = mavlink_msg_hil_controls_get_aux3(msg);
|
||||
hil_controls->aux4 = mavlink_msg_hil_controls_get_aux4(msg);
|
||||
hil_controls->mode = mavlink_msg_hil_controls_get_mode(msg);
|
||||
hil_controls->nav_mode = mavlink_msg_hil_controls_get_nav_mode(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_CONTROLS_LEN? msg->len : MAVLINK_MSG_ID_HIL_CONTROLS_LEN;
|
||||
memset(hil_controls, 0, MAVLINK_MSG_ID_HIL_CONTROLS_LEN);
|
||||
memcpy(hil_controls, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,513 @@
|
||||
#pragma once
|
||||
// MESSAGE HIL_GPS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_GPS 113
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_hil_gps_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
int32_t lat; /*< [degE7] Latitude (WGS84)*/
|
||||
int32_t lon; /*< [degE7] Longitude (WGS84)*/
|
||||
int32_t alt; /*< [mm] Altitude (AMSL). Positive for up.*/
|
||||
uint16_t eph; /*< [cm] GPS HDOP horizontal dilution of position. If unknown, set to: 65535*/
|
||||
uint16_t epv; /*< [cm] GPS VDOP vertical dilution of position. If unknown, set to: 65535*/
|
||||
uint16_t vel; /*< [cm/s] GPS ground speed. If unknown, set to: 65535*/
|
||||
int16_t vn; /*< [cm/s] GPS velocity in NORTH direction in earth-fixed NED frame*/
|
||||
int16_t ve; /*< [cm/s] GPS velocity in EAST direction in earth-fixed NED frame*/
|
||||
int16_t vd; /*< [cm/s] GPS velocity in DOWN direction in earth-fixed NED frame*/
|
||||
uint16_t cog; /*< [cdeg] Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535*/
|
||||
uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.*/
|
||||
uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/
|
||||
}) mavlink_hil_gps_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_GPS_LEN 36
|
||||
#define MAVLINK_MSG_ID_HIL_GPS_MIN_LEN 36
|
||||
#define MAVLINK_MSG_ID_113_LEN 36
|
||||
#define MAVLINK_MSG_ID_113_MIN_LEN 36
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_GPS_CRC 124
|
||||
#define MAVLINK_MSG_ID_113_CRC 124
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_GPS { \
|
||||
113, \
|
||||
"HIL_GPS", \
|
||||
13, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_gps_t, time_usec) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_hil_gps_t, fix_type) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_hil_gps_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_hil_gps_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_hil_gps_t, alt) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_gps_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_gps_t, epv) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_gps_t, vel) }, \
|
||||
{ "vn", NULL, MAVLINK_TYPE_INT16_T, 0, 26, offsetof(mavlink_hil_gps_t, vn) }, \
|
||||
{ "ve", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_hil_gps_t, ve) }, \
|
||||
{ "vd", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_hil_gps_t, vd) }, \
|
||||
{ "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_hil_gps_t, cog) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_hil_gps_t, satellites_visible) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_GPS { \
|
||||
"HIL_GPS", \
|
||||
13, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_gps_t, time_usec) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_hil_gps_t, fix_type) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_hil_gps_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_hil_gps_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_hil_gps_t, alt) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_gps_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_gps_t, epv) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_gps_t, vel) }, \
|
||||
{ "vn", NULL, MAVLINK_TYPE_INT16_T, 0, 26, offsetof(mavlink_hil_gps_t, vn) }, \
|
||||
{ "ve", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_hil_gps_t, ve) }, \
|
||||
{ "vd", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_hil_gps_t, vd) }, \
|
||||
{ "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_hil_gps_t, cog) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_hil_gps_t, satellites_visible) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_gps message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [mm] Altitude (AMSL). Positive for up.
|
||||
* @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: 65535
|
||||
* @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: 65535
|
||||
* @param vel [cm/s] GPS ground speed. If unknown, set to: 65535
|
||||
* @param vn [cm/s] GPS velocity in NORTH direction in earth-fixed NED frame
|
||||
* @param ve [cm/s] GPS velocity in EAST direction in earth-fixed NED frame
|
||||
* @param vd [cm/s] GPS velocity in DOWN direction in earth-fixed NED frame
|
||||
* @param cog [cdeg] Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_gps_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_GPS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_int16_t(buf, 26, vn);
|
||||
_mav_put_int16_t(buf, 28, ve);
|
||||
_mav_put_int16_t(buf, 30, vd);
|
||||
_mav_put_uint16_t(buf, 32, cog);
|
||||
_mav_put_uint8_t(buf, 34, fix_type);
|
||||
_mav_put_uint8_t(buf, 35, satellites_visible);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_GPS_LEN);
|
||||
#else
|
||||
mavlink_hil_gps_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.vn = vn;
|
||||
packet.ve = ve;
|
||||
packet.vd = vd;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_GPS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_GPS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_gps message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [mm] Altitude (AMSL). Positive for up.
|
||||
* @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: 65535
|
||||
* @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: 65535
|
||||
* @param vel [cm/s] GPS ground speed. If unknown, set to: 65535
|
||||
* @param vn [cm/s] GPS velocity in NORTH direction in earth-fixed NED frame
|
||||
* @param ve [cm/s] GPS velocity in EAST direction in earth-fixed NED frame
|
||||
* @param vd [cm/s] GPS velocity in DOWN direction in earth-fixed NED frame
|
||||
* @param cog [cdeg] Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_gps_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,int16_t vn,int16_t ve,int16_t vd,uint16_t cog,uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_GPS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_int16_t(buf, 26, vn);
|
||||
_mav_put_int16_t(buf, 28, ve);
|
||||
_mav_put_int16_t(buf, 30, vd);
|
||||
_mav_put_uint16_t(buf, 32, cog);
|
||||
_mav_put_uint8_t(buf, 34, fix_type);
|
||||
_mav_put_uint8_t(buf, 35, satellites_visible);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_GPS_LEN);
|
||||
#else
|
||||
mavlink_hil_gps_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.vn = vn;
|
||||
packet.ve = ve;
|
||||
packet.vd = vd;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_GPS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_GPS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_gps struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_gps C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_gps_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_gps_t* hil_gps)
|
||||
{
|
||||
return mavlink_msg_hil_gps_pack(system_id, component_id, msg, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_gps struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_gps C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_gps_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_gps_t* hil_gps)
|
||||
{
|
||||
return mavlink_msg_hil_gps_pack_chan(system_id, component_id, chan, msg, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_gps message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
|
||||
* @param lat [degE7] Latitude (WGS84)
|
||||
* @param lon [degE7] Longitude (WGS84)
|
||||
* @param alt [mm] Altitude (AMSL). Positive for up.
|
||||
* @param eph [cm] GPS HDOP horizontal dilution of position. If unknown, set to: 65535
|
||||
* @param epv [cm] GPS VDOP vertical dilution of position. If unknown, set to: 65535
|
||||
* @param vel [cm/s] GPS ground speed. If unknown, set to: 65535
|
||||
* @param vn [cm/s] GPS velocity in NORTH direction in earth-fixed NED frame
|
||||
* @param ve [cm/s] GPS velocity in EAST direction in earth-fixed NED frame
|
||||
* @param vd [cm/s] GPS velocity in DOWN direction in earth-fixed NED frame
|
||||
* @param cog [cdeg] Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_hil_gps_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_GPS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_int16_t(buf, 26, vn);
|
||||
_mav_put_int16_t(buf, 28, ve);
|
||||
_mav_put_int16_t(buf, 30, vd);
|
||||
_mav_put_uint16_t(buf, 32, cog);
|
||||
_mav_put_uint8_t(buf, 34, fix_type);
|
||||
_mav_put_uint8_t(buf, 35, satellites_visible);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
|
||||
#else
|
||||
mavlink_hil_gps_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.vn = vn;
|
||||
packet.ve = ve;
|
||||
packet.vd = vd;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)&packet, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_gps message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_hil_gps_send_struct(mavlink_channel_t chan, const mavlink_hil_gps_t* hil_gps)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_hil_gps_send(chan, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)hil_gps, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HIL_GPS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_hil_gps_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_int16_t(buf, 26, vn);
|
||||
_mav_put_int16_t(buf, 28, ve);
|
||||
_mav_put_int16_t(buf, 30, vd);
|
||||
_mav_put_uint16_t(buf, 32, cog);
|
||||
_mav_put_uint8_t(buf, 34, fix_type);
|
||||
_mav_put_uint8_t(buf, 35, satellites_visible);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
|
||||
#else
|
||||
mavlink_hil_gps_t *packet = (mavlink_hil_gps_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->eph = eph;
|
||||
packet->epv = epv;
|
||||
packet->vel = vel;
|
||||
packet->vn = vn;
|
||||
packet->ve = ve;
|
||||
packet->vd = vd;
|
||||
packet->cog = cog;
|
||||
packet->fix_type = fix_type;
|
||||
packet->satellites_visible = satellites_visible;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)packet, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIL_GPS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from hil_gps message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_hil_gps_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fix_type from hil_gps message
|
||||
*
|
||||
* @return 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_hil_gps_get_fix_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from hil_gps message
|
||||
*
|
||||
* @return [degE7] Latitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_hil_gps_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from hil_gps message
|
||||
*
|
||||
* @return [degE7] Longitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_hil_gps_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from hil_gps message
|
||||
*
|
||||
* @return [mm] Altitude (AMSL). Positive for up.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_hil_gps_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field eph from hil_gps message
|
||||
*
|
||||
* @return [cm] GPS HDOP horizontal dilution of position. If unknown, set to: 65535
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_gps_get_eph(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field epv from hil_gps message
|
||||
*
|
||||
* @return [cm] GPS VDOP vertical dilution of position. If unknown, set to: 65535
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_gps_get_epv(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel from hil_gps message
|
||||
*
|
||||
* @return [cm/s] GPS ground speed. If unknown, set to: 65535
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_gps_get_vel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vn from hil_gps message
|
||||
*
|
||||
* @return [cm/s] GPS velocity in NORTH direction in earth-fixed NED frame
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_gps_get_vn(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ve from hil_gps message
|
||||
*
|
||||
* @return [cm/s] GPS velocity in EAST direction in earth-fixed NED frame
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_gps_get_ve(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vd from hil_gps message
|
||||
*
|
||||
* @return [cm/s] GPS velocity in DOWN direction in earth-fixed NED frame
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_gps_get_vd(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cog from hil_gps message
|
||||
*
|
||||
* @return [cdeg] Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: 65535
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_gps_get_cog(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellites_visible from hil_gps message
|
||||
*
|
||||
* @return Number of satellites visible. If unknown, set to 255
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_hil_gps_get_satellites_visible(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 35);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a hil_gps message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param hil_gps C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_hil_gps_decode(const mavlink_message_t* msg, mavlink_hil_gps_t* hil_gps)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
hil_gps->time_usec = mavlink_msg_hil_gps_get_time_usec(msg);
|
||||
hil_gps->lat = mavlink_msg_hil_gps_get_lat(msg);
|
||||
hil_gps->lon = mavlink_msg_hil_gps_get_lon(msg);
|
||||
hil_gps->alt = mavlink_msg_hil_gps_get_alt(msg);
|
||||
hil_gps->eph = mavlink_msg_hil_gps_get_eph(msg);
|
||||
hil_gps->epv = mavlink_msg_hil_gps_get_epv(msg);
|
||||
hil_gps->vel = mavlink_msg_hil_gps_get_vel(msg);
|
||||
hil_gps->vn = mavlink_msg_hil_gps_get_vn(msg);
|
||||
hil_gps->ve = mavlink_msg_hil_gps_get_ve(msg);
|
||||
hil_gps->vd = mavlink_msg_hil_gps_get_vd(msg);
|
||||
hil_gps->cog = mavlink_msg_hil_gps_get_cog(msg);
|
||||
hil_gps->fix_type = mavlink_msg_hil_gps_get_fix_type(msg);
|
||||
hil_gps->satellites_visible = mavlink_msg_hil_gps_get_satellites_visible(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_GPS_LEN? msg->len : MAVLINK_MSG_ID_HIL_GPS_LEN;
|
||||
memset(hil_gps, 0, MAVLINK_MSG_ID_HIL_GPS_LEN);
|
||||
memcpy(hil_gps, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,488 @@
|
||||
#pragma once
|
||||
// MESSAGE HIL_OPTICAL_FLOW PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW 114
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_hil_optical_flow_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
uint32_t integration_time_us; /*< [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.*/
|
||||
float integrated_x; /*< [rad] Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)*/
|
||||
float integrated_y; /*< [rad] Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)*/
|
||||
float integrated_xgyro; /*< [rad] RH rotation around X axis*/
|
||||
float integrated_ygyro; /*< [rad] RH rotation around Y axis*/
|
||||
float integrated_zgyro; /*< [rad] RH rotation around Z axis*/
|
||||
uint32_t time_delta_distance_us; /*< [us] Time since the distance was sampled.*/
|
||||
float distance; /*< [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.*/
|
||||
int16_t temperature; /*< [cdegC] Temperature*/
|
||||
uint8_t sensor_id; /*< Sensor ID*/
|
||||
uint8_t quality; /*< Optical flow quality / confidence. 0: no valid flow, 255: maximum quality*/
|
||||
}) mavlink_hil_optical_flow_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN 44
|
||||
#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN 44
|
||||
#define MAVLINK_MSG_ID_114_LEN 44
|
||||
#define MAVLINK_MSG_ID_114_MIN_LEN 44
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC 237
|
||||
#define MAVLINK_MSG_ID_114_CRC 237
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW { \
|
||||
114, \
|
||||
"HIL_OPTICAL_FLOW", \
|
||||
12, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_optical_flow_t, time_usec) }, \
|
||||
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_hil_optical_flow_t, sensor_id) }, \
|
||||
{ "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_hil_optical_flow_t, integration_time_us) }, \
|
||||
{ "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_optical_flow_t, integrated_x) }, \
|
||||
{ "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_optical_flow_t, integrated_y) }, \
|
||||
{ "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_optical_flow_t, integrated_xgyro) }, \
|
||||
{ "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_optical_flow_t, integrated_ygyro) }, \
|
||||
{ "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_optical_flow_t, integrated_zgyro) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_hil_optical_flow_t, temperature) }, \
|
||||
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \
|
||||
{ "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_hil_optical_flow_t, time_delta_distance_us) }, \
|
||||
{ "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_optical_flow_t, distance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW { \
|
||||
"HIL_OPTICAL_FLOW", \
|
||||
12, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_optical_flow_t, time_usec) }, \
|
||||
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_hil_optical_flow_t, sensor_id) }, \
|
||||
{ "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_hil_optical_flow_t, integration_time_us) }, \
|
||||
{ "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_optical_flow_t, integrated_x) }, \
|
||||
{ "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_optical_flow_t, integrated_y) }, \
|
||||
{ "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_optical_flow_t, integrated_xgyro) }, \
|
||||
{ "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_optical_flow_t, integrated_ygyro) }, \
|
||||
{ "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_optical_flow_t, integrated_zgyro) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_hil_optical_flow_t, temperature) }, \
|
||||
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \
|
||||
{ "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_hil_optical_flow_t, time_delta_distance_us) }, \
|
||||
{ "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_optical_flow_t, distance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_optical_flow message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_id Sensor ID
|
||||
* @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
|
||||
* @param integrated_x [rad] Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
|
||||
* @param integrated_y [rad] Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
|
||||
* @param integrated_xgyro [rad] RH rotation around X axis
|
||||
* @param integrated_ygyro [rad] RH rotation around Y axis
|
||||
* @param integrated_zgyro [rad] RH rotation around Z axis
|
||||
* @param temperature [cdegC] Temperature
|
||||
* @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
|
||||
* @param time_delta_distance_us [us] Time since the distance was sampled.
|
||||
* @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, integration_time_us);
|
||||
_mav_put_float(buf, 12, integrated_x);
|
||||
_mav_put_float(buf, 16, integrated_y);
|
||||
_mav_put_float(buf, 20, integrated_xgyro);
|
||||
_mav_put_float(buf, 24, integrated_ygyro);
|
||||
_mav_put_float(buf, 28, integrated_zgyro);
|
||||
_mav_put_uint32_t(buf, 32, time_delta_distance_us);
|
||||
_mav_put_float(buf, 36, distance);
|
||||
_mav_put_int16_t(buf, 40, temperature);
|
||||
_mav_put_uint8_t(buf, 42, sensor_id);
|
||||
_mav_put_uint8_t(buf, 43, quality);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
|
||||
#else
|
||||
mavlink_hil_optical_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.integration_time_us = integration_time_us;
|
||||
packet.integrated_x = integrated_x;
|
||||
packet.integrated_y = integrated_y;
|
||||
packet.integrated_xgyro = integrated_xgyro;
|
||||
packet.integrated_ygyro = integrated_ygyro;
|
||||
packet.integrated_zgyro = integrated_zgyro;
|
||||
packet.time_delta_distance_us = time_delta_distance_us;
|
||||
packet.distance = distance;
|
||||
packet.temperature = temperature;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_OPTICAL_FLOW;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_optical_flow message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_id Sensor ID
|
||||
* @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
|
||||
* @param integrated_x [rad] Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
|
||||
* @param integrated_y [rad] Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
|
||||
* @param integrated_xgyro [rad] RH rotation around X axis
|
||||
* @param integrated_ygyro [rad] RH rotation around Y axis
|
||||
* @param integrated_zgyro [rad] RH rotation around Z axis
|
||||
* @param temperature [cdegC] Temperature
|
||||
* @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
|
||||
* @param time_delta_distance_us [us] Time since the distance was sampled.
|
||||
* @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_optical_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t sensor_id,uint32_t integration_time_us,float integrated_x,float integrated_y,float integrated_xgyro,float integrated_ygyro,float integrated_zgyro,int16_t temperature,uint8_t quality,uint32_t time_delta_distance_us,float distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, integration_time_us);
|
||||
_mav_put_float(buf, 12, integrated_x);
|
||||
_mav_put_float(buf, 16, integrated_y);
|
||||
_mav_put_float(buf, 20, integrated_xgyro);
|
||||
_mav_put_float(buf, 24, integrated_ygyro);
|
||||
_mav_put_float(buf, 28, integrated_zgyro);
|
||||
_mav_put_uint32_t(buf, 32, time_delta_distance_us);
|
||||
_mav_put_float(buf, 36, distance);
|
||||
_mav_put_int16_t(buf, 40, temperature);
|
||||
_mav_put_uint8_t(buf, 42, sensor_id);
|
||||
_mav_put_uint8_t(buf, 43, quality);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
|
||||
#else
|
||||
mavlink_hil_optical_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.integration_time_us = integration_time_us;
|
||||
packet.integrated_x = integrated_x;
|
||||
packet.integrated_y = integrated_y;
|
||||
packet.integrated_xgyro = integrated_xgyro;
|
||||
packet.integrated_ygyro = integrated_ygyro;
|
||||
packet.integrated_zgyro = integrated_zgyro;
|
||||
packet.time_delta_distance_us = time_delta_distance_us;
|
||||
packet.distance = distance;
|
||||
packet.temperature = temperature;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_OPTICAL_FLOW;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_optical_flow struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_optical_flow C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_optical_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_optical_flow_t* hil_optical_flow)
|
||||
{
|
||||
return mavlink_msg_hil_optical_flow_pack(system_id, component_id, msg, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_optical_flow struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_optical_flow C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_optical_flow_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_optical_flow_t* hil_optical_flow)
|
||||
{
|
||||
return mavlink_msg_hil_optical_flow_pack_chan(system_id, component_id, chan, msg, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_optical_flow message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_id Sensor ID
|
||||
* @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
|
||||
* @param integrated_x [rad] Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
|
||||
* @param integrated_y [rad] Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
|
||||
* @param integrated_xgyro [rad] RH rotation around X axis
|
||||
* @param integrated_ygyro [rad] RH rotation around Y axis
|
||||
* @param integrated_zgyro [rad] RH rotation around Z axis
|
||||
* @param temperature [cdegC] Temperature
|
||||
* @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
|
||||
* @param time_delta_distance_us [us] Time since the distance was sampled.
|
||||
* @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_hil_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, integration_time_us);
|
||||
_mav_put_float(buf, 12, integrated_x);
|
||||
_mav_put_float(buf, 16, integrated_y);
|
||||
_mav_put_float(buf, 20, integrated_xgyro);
|
||||
_mav_put_float(buf, 24, integrated_ygyro);
|
||||
_mav_put_float(buf, 28, integrated_zgyro);
|
||||
_mav_put_uint32_t(buf, 32, time_delta_distance_us);
|
||||
_mav_put_float(buf, 36, distance);
|
||||
_mav_put_int16_t(buf, 40, temperature);
|
||||
_mav_put_uint8_t(buf, 42, sensor_id);
|
||||
_mav_put_uint8_t(buf, 43, quality);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
|
||||
#else
|
||||
mavlink_hil_optical_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.integration_time_us = integration_time_us;
|
||||
packet.integrated_x = integrated_x;
|
||||
packet.integrated_y = integrated_y;
|
||||
packet.integrated_xgyro = integrated_xgyro;
|
||||
packet.integrated_ygyro = integrated_ygyro;
|
||||
packet.integrated_zgyro = integrated_zgyro;
|
||||
packet.time_delta_distance_us = time_delta_distance_us;
|
||||
packet.distance = distance;
|
||||
packet.temperature = temperature;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_optical_flow message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_hil_optical_flow_send_struct(mavlink_channel_t chan, const mavlink_hil_optical_flow_t* hil_optical_flow)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_hil_optical_flow_send(chan, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)hil_optical_flow, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_hil_optical_flow_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, integration_time_us);
|
||||
_mav_put_float(buf, 12, integrated_x);
|
||||
_mav_put_float(buf, 16, integrated_y);
|
||||
_mav_put_float(buf, 20, integrated_xgyro);
|
||||
_mav_put_float(buf, 24, integrated_ygyro);
|
||||
_mav_put_float(buf, 28, integrated_zgyro);
|
||||
_mav_put_uint32_t(buf, 32, time_delta_distance_us);
|
||||
_mav_put_float(buf, 36, distance);
|
||||
_mav_put_int16_t(buf, 40, temperature);
|
||||
_mav_put_uint8_t(buf, 42, sensor_id);
|
||||
_mav_put_uint8_t(buf, 43, quality);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
|
||||
#else
|
||||
mavlink_hil_optical_flow_t *packet = (mavlink_hil_optical_flow_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->integration_time_us = integration_time_us;
|
||||
packet->integrated_x = integrated_x;
|
||||
packet->integrated_y = integrated_y;
|
||||
packet->integrated_xgyro = integrated_xgyro;
|
||||
packet->integrated_ygyro = integrated_ygyro;
|
||||
packet->integrated_zgyro = integrated_zgyro;
|
||||
packet->time_delta_distance_us = time_delta_distance_us;
|
||||
packet->distance = distance;
|
||||
packet->temperature = temperature;
|
||||
packet->sensor_id = sensor_id;
|
||||
packet->quality = quality;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIL_OPTICAL_FLOW UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from hil_optical_flow message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_hil_optical_flow_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sensor_id from hil_optical_flow message
|
||||
*
|
||||
* @return Sensor ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_hil_optical_flow_get_sensor_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 42);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integration_time_us from hil_optical_flow message
|
||||
*
|
||||
* @return [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_hil_optical_flow_get_integration_time_us(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integrated_x from hil_optical_flow message
|
||||
*
|
||||
* @return [rad] Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
|
||||
*/
|
||||
static inline float mavlink_msg_hil_optical_flow_get_integrated_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integrated_y from hil_optical_flow message
|
||||
*
|
||||
* @return [rad] Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
|
||||
*/
|
||||
static inline float mavlink_msg_hil_optical_flow_get_integrated_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integrated_xgyro from hil_optical_flow message
|
||||
*
|
||||
* @return [rad] RH rotation around X axis
|
||||
*/
|
||||
static inline float mavlink_msg_hil_optical_flow_get_integrated_xgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integrated_ygyro from hil_optical_flow message
|
||||
*
|
||||
* @return [rad] RH rotation around Y axis
|
||||
*/
|
||||
static inline float mavlink_msg_hil_optical_flow_get_integrated_ygyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integrated_zgyro from hil_optical_flow message
|
||||
*
|
||||
* @return [rad] RH rotation around Z axis
|
||||
*/
|
||||
static inline float mavlink_msg_hil_optical_flow_get_integrated_zgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field temperature from hil_optical_flow message
|
||||
*
|
||||
* @return [cdegC] Temperature
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_optical_flow_get_temperature(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field quality from hil_optical_flow message
|
||||
*
|
||||
* @return Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_hil_optical_flow_get_quality(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 43);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_delta_distance_us from hil_optical_flow message
|
||||
*
|
||||
* @return [us] Time since the distance was sampled.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_hil_optical_flow_get_time_delta_distance_us(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field distance from hil_optical_flow message
|
||||
*
|
||||
* @return [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.
|
||||
*/
|
||||
static inline float mavlink_msg_hil_optical_flow_get_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a hil_optical_flow message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param hil_optical_flow C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_hil_optical_flow_decode(const mavlink_message_t* msg, mavlink_hil_optical_flow_t* hil_optical_flow)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
hil_optical_flow->time_usec = mavlink_msg_hil_optical_flow_get_time_usec(msg);
|
||||
hil_optical_flow->integration_time_us = mavlink_msg_hil_optical_flow_get_integration_time_us(msg);
|
||||
hil_optical_flow->integrated_x = mavlink_msg_hil_optical_flow_get_integrated_x(msg);
|
||||
hil_optical_flow->integrated_y = mavlink_msg_hil_optical_flow_get_integrated_y(msg);
|
||||
hil_optical_flow->integrated_xgyro = mavlink_msg_hil_optical_flow_get_integrated_xgyro(msg);
|
||||
hil_optical_flow->integrated_ygyro = mavlink_msg_hil_optical_flow_get_integrated_ygyro(msg);
|
||||
hil_optical_flow->integrated_zgyro = mavlink_msg_hil_optical_flow_get_integrated_zgyro(msg);
|
||||
hil_optical_flow->time_delta_distance_us = mavlink_msg_hil_optical_flow_get_time_delta_distance_us(msg);
|
||||
hil_optical_flow->distance = mavlink_msg_hil_optical_flow_get_distance(msg);
|
||||
hil_optical_flow->temperature = mavlink_msg_hil_optical_flow_get_temperature(msg);
|
||||
hil_optical_flow->sensor_id = mavlink_msg_hil_optical_flow_get_sensor_id(msg);
|
||||
hil_optical_flow->quality = mavlink_msg_hil_optical_flow_get_quality(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN? msg->len : MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN;
|
||||
memset(hil_optical_flow, 0, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
|
||||
memcpy(hil_optical_flow, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,538 @@
|
||||
#pragma once
|
||||
// MESSAGE HIL_RC_INPUTS_RAW PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW 92
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_hil_rc_inputs_raw_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
uint16_t chan1_raw; /*< [us] RC channel 1 value*/
|
||||
uint16_t chan2_raw; /*< [us] RC channel 2 value*/
|
||||
uint16_t chan3_raw; /*< [us] RC channel 3 value*/
|
||||
uint16_t chan4_raw; /*< [us] RC channel 4 value*/
|
||||
uint16_t chan5_raw; /*< [us] RC channel 5 value*/
|
||||
uint16_t chan6_raw; /*< [us] RC channel 6 value*/
|
||||
uint16_t chan7_raw; /*< [us] RC channel 7 value*/
|
||||
uint16_t chan8_raw; /*< [us] RC channel 8 value*/
|
||||
uint16_t chan9_raw; /*< [us] RC channel 9 value*/
|
||||
uint16_t chan10_raw; /*< [us] RC channel 10 value*/
|
||||
uint16_t chan11_raw; /*< [us] RC channel 11 value*/
|
||||
uint16_t chan12_raw; /*< [us] RC channel 12 value*/
|
||||
uint8_t rssi; /*< Receive signal strength indicator. Values: [0-100], 255: invalid/unknown.*/
|
||||
}) mavlink_hil_rc_inputs_raw_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN 33
|
||||
#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN 33
|
||||
#define MAVLINK_MSG_ID_92_LEN 33
|
||||
#define MAVLINK_MSG_ID_92_MIN_LEN 33
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC 54
|
||||
#define MAVLINK_MSG_ID_92_CRC 54
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \
|
||||
92, \
|
||||
"HIL_RC_INPUTS_RAW", \
|
||||
14, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \
|
||||
{ "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_hil_rc_inputs_raw_t, chan1_raw) }, \
|
||||
{ "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_hil_rc_inputs_raw_t, chan2_raw) }, \
|
||||
{ "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_hil_rc_inputs_raw_t, chan3_raw) }, \
|
||||
{ "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_hil_rc_inputs_raw_t, chan4_raw) }, \
|
||||
{ "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_hil_rc_inputs_raw_t, chan5_raw) }, \
|
||||
{ "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_hil_rc_inputs_raw_t, chan6_raw) }, \
|
||||
{ "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_rc_inputs_raw_t, chan7_raw) }, \
|
||||
{ "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_rc_inputs_raw_t, chan8_raw) }, \
|
||||
{ "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_rc_inputs_raw_t, chan9_raw) }, \
|
||||
{ "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_hil_rc_inputs_raw_t, chan10_raw) }, \
|
||||
{ "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_hil_rc_inputs_raw_t, chan11_raw) }, \
|
||||
{ "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_hil_rc_inputs_raw_t, chan12_raw) }, \
|
||||
{ "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_hil_rc_inputs_raw_t, rssi) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \
|
||||
"HIL_RC_INPUTS_RAW", \
|
||||
14, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \
|
||||
{ "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_hil_rc_inputs_raw_t, chan1_raw) }, \
|
||||
{ "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_hil_rc_inputs_raw_t, chan2_raw) }, \
|
||||
{ "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_hil_rc_inputs_raw_t, chan3_raw) }, \
|
||||
{ "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_hil_rc_inputs_raw_t, chan4_raw) }, \
|
||||
{ "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_hil_rc_inputs_raw_t, chan5_raw) }, \
|
||||
{ "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_hil_rc_inputs_raw_t, chan6_raw) }, \
|
||||
{ "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_rc_inputs_raw_t, chan7_raw) }, \
|
||||
{ "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_rc_inputs_raw_t, chan8_raw) }, \
|
||||
{ "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_rc_inputs_raw_t, chan9_raw) }, \
|
||||
{ "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_hil_rc_inputs_raw_t, chan10_raw) }, \
|
||||
{ "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_hil_rc_inputs_raw_t, chan11_raw) }, \
|
||||
{ "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_hil_rc_inputs_raw_t, chan12_raw) }, \
|
||||
{ "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_hil_rc_inputs_raw_t, rssi) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_rc_inputs_raw message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param chan1_raw [us] RC channel 1 value
|
||||
* @param chan2_raw [us] RC channel 2 value
|
||||
* @param chan3_raw [us] RC channel 3 value
|
||||
* @param chan4_raw [us] RC channel 4 value
|
||||
* @param chan5_raw [us] RC channel 5 value
|
||||
* @param chan6_raw [us] RC channel 6 value
|
||||
* @param chan7_raw [us] RC channel 7 value
|
||||
* @param chan8_raw [us] RC channel 8 value
|
||||
* @param chan9_raw [us] RC channel 9 value
|
||||
* @param chan10_raw [us] RC channel 10 value
|
||||
* @param chan11_raw [us] RC channel 11 value
|
||||
* @param chan12_raw [us] RC channel 12 value
|
||||
* @param rssi Receive signal strength indicator. Values: [0-100], 255: invalid/unknown.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint16_t(buf, 8, chan1_raw);
|
||||
_mav_put_uint16_t(buf, 10, chan2_raw);
|
||||
_mav_put_uint16_t(buf, 12, chan3_raw);
|
||||
_mav_put_uint16_t(buf, 14, chan4_raw);
|
||||
_mav_put_uint16_t(buf, 16, chan5_raw);
|
||||
_mav_put_uint16_t(buf, 18, chan6_raw);
|
||||
_mav_put_uint16_t(buf, 20, chan7_raw);
|
||||
_mav_put_uint16_t(buf, 22, chan8_raw);
|
||||
_mav_put_uint16_t(buf, 24, chan9_raw);
|
||||
_mav_put_uint16_t(buf, 26, chan10_raw);
|
||||
_mav_put_uint16_t(buf, 28, chan11_raw);
|
||||
_mav_put_uint16_t(buf, 30, chan12_raw);
|
||||
_mav_put_uint8_t(buf, 32, rssi);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
|
||||
#else
|
||||
mavlink_hil_rc_inputs_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.chan1_raw = chan1_raw;
|
||||
packet.chan2_raw = chan2_raw;
|
||||
packet.chan3_raw = chan3_raw;
|
||||
packet.chan4_raw = chan4_raw;
|
||||
packet.chan5_raw = chan5_raw;
|
||||
packet.chan6_raw = chan6_raw;
|
||||
packet.chan7_raw = chan7_raw;
|
||||
packet.chan8_raw = chan8_raw;
|
||||
packet.chan9_raw = chan9_raw;
|
||||
packet.chan10_raw = chan10_raw;
|
||||
packet.chan11_raw = chan11_raw;
|
||||
packet.chan12_raw = chan12_raw;
|
||||
packet.rssi = rssi;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_rc_inputs_raw message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param chan1_raw [us] RC channel 1 value
|
||||
* @param chan2_raw [us] RC channel 2 value
|
||||
* @param chan3_raw [us] RC channel 3 value
|
||||
* @param chan4_raw [us] RC channel 4 value
|
||||
* @param chan5_raw [us] RC channel 5 value
|
||||
* @param chan6_raw [us] RC channel 6 value
|
||||
* @param chan7_raw [us] RC channel 7 value
|
||||
* @param chan8_raw [us] RC channel 8 value
|
||||
* @param chan9_raw [us] RC channel 9 value
|
||||
* @param chan10_raw [us] RC channel 10 value
|
||||
* @param chan11_raw [us] RC channel 11 value
|
||||
* @param chan12_raw [us] RC channel 12 value
|
||||
* @param rssi Receive signal strength indicator. Values: [0-100], 255: invalid/unknown.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint16_t chan9_raw,uint16_t chan10_raw,uint16_t chan11_raw,uint16_t chan12_raw,uint8_t rssi)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint16_t(buf, 8, chan1_raw);
|
||||
_mav_put_uint16_t(buf, 10, chan2_raw);
|
||||
_mav_put_uint16_t(buf, 12, chan3_raw);
|
||||
_mav_put_uint16_t(buf, 14, chan4_raw);
|
||||
_mav_put_uint16_t(buf, 16, chan5_raw);
|
||||
_mav_put_uint16_t(buf, 18, chan6_raw);
|
||||
_mav_put_uint16_t(buf, 20, chan7_raw);
|
||||
_mav_put_uint16_t(buf, 22, chan8_raw);
|
||||
_mav_put_uint16_t(buf, 24, chan9_raw);
|
||||
_mav_put_uint16_t(buf, 26, chan10_raw);
|
||||
_mav_put_uint16_t(buf, 28, chan11_raw);
|
||||
_mav_put_uint16_t(buf, 30, chan12_raw);
|
||||
_mav_put_uint8_t(buf, 32, rssi);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
|
||||
#else
|
||||
mavlink_hil_rc_inputs_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.chan1_raw = chan1_raw;
|
||||
packet.chan2_raw = chan2_raw;
|
||||
packet.chan3_raw = chan3_raw;
|
||||
packet.chan4_raw = chan4_raw;
|
||||
packet.chan5_raw = chan5_raw;
|
||||
packet.chan6_raw = chan6_raw;
|
||||
packet.chan7_raw = chan7_raw;
|
||||
packet.chan8_raw = chan8_raw;
|
||||
packet.chan9_raw = chan9_raw;
|
||||
packet.chan10_raw = chan10_raw;
|
||||
packet.chan11_raw = chan11_raw;
|
||||
packet.chan12_raw = chan12_raw;
|
||||
packet.rssi = rssi;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_rc_inputs_raw struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_rc_inputs_raw C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
|
||||
{
|
||||
return mavlink_msg_hil_rc_inputs_raw_pack(system_id, component_id, msg, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_rc_inputs_raw struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_rc_inputs_raw C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
|
||||
{
|
||||
return mavlink_msg_hil_rc_inputs_raw_pack_chan(system_id, component_id, chan, msg, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_rc_inputs_raw message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param chan1_raw [us] RC channel 1 value
|
||||
* @param chan2_raw [us] RC channel 2 value
|
||||
* @param chan3_raw [us] RC channel 3 value
|
||||
* @param chan4_raw [us] RC channel 4 value
|
||||
* @param chan5_raw [us] RC channel 5 value
|
||||
* @param chan6_raw [us] RC channel 6 value
|
||||
* @param chan7_raw [us] RC channel 7 value
|
||||
* @param chan8_raw [us] RC channel 8 value
|
||||
* @param chan9_raw [us] RC channel 9 value
|
||||
* @param chan10_raw [us] RC channel 10 value
|
||||
* @param chan11_raw [us] RC channel 11 value
|
||||
* @param chan12_raw [us] RC channel 12 value
|
||||
* @param rssi Receive signal strength indicator. Values: [0-100], 255: invalid/unknown.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_hil_rc_inputs_raw_send(mavlink_channel_t chan, uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint16_t(buf, 8, chan1_raw);
|
||||
_mav_put_uint16_t(buf, 10, chan2_raw);
|
||||
_mav_put_uint16_t(buf, 12, chan3_raw);
|
||||
_mav_put_uint16_t(buf, 14, chan4_raw);
|
||||
_mav_put_uint16_t(buf, 16, chan5_raw);
|
||||
_mav_put_uint16_t(buf, 18, chan6_raw);
|
||||
_mav_put_uint16_t(buf, 20, chan7_raw);
|
||||
_mav_put_uint16_t(buf, 22, chan8_raw);
|
||||
_mav_put_uint16_t(buf, 24, chan9_raw);
|
||||
_mav_put_uint16_t(buf, 26, chan10_raw);
|
||||
_mav_put_uint16_t(buf, 28, chan11_raw);
|
||||
_mav_put_uint16_t(buf, 30, chan12_raw);
|
||||
_mav_put_uint8_t(buf, 32, rssi);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
|
||||
#else
|
||||
mavlink_hil_rc_inputs_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.chan1_raw = chan1_raw;
|
||||
packet.chan2_raw = chan2_raw;
|
||||
packet.chan3_raw = chan3_raw;
|
||||
packet.chan4_raw = chan4_raw;
|
||||
packet.chan5_raw = chan5_raw;
|
||||
packet.chan6_raw = chan6_raw;
|
||||
packet.chan7_raw = chan7_raw;
|
||||
packet.chan8_raw = chan8_raw;
|
||||
packet.chan9_raw = chan9_raw;
|
||||
packet.chan10_raw = chan10_raw;
|
||||
packet.chan11_raw = chan11_raw;
|
||||
packet.chan12_raw = chan12_raw;
|
||||
packet.rssi = rssi;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)&packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_rc_inputs_raw message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_hil_rc_inputs_raw_send_struct(mavlink_channel_t chan, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_hil_rc_inputs_raw_send(chan, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)hil_rc_inputs_raw, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_hil_rc_inputs_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint16_t(buf, 8, chan1_raw);
|
||||
_mav_put_uint16_t(buf, 10, chan2_raw);
|
||||
_mav_put_uint16_t(buf, 12, chan3_raw);
|
||||
_mav_put_uint16_t(buf, 14, chan4_raw);
|
||||
_mav_put_uint16_t(buf, 16, chan5_raw);
|
||||
_mav_put_uint16_t(buf, 18, chan6_raw);
|
||||
_mav_put_uint16_t(buf, 20, chan7_raw);
|
||||
_mav_put_uint16_t(buf, 22, chan8_raw);
|
||||
_mav_put_uint16_t(buf, 24, chan9_raw);
|
||||
_mav_put_uint16_t(buf, 26, chan10_raw);
|
||||
_mav_put_uint16_t(buf, 28, chan11_raw);
|
||||
_mav_put_uint16_t(buf, 30, chan12_raw);
|
||||
_mav_put_uint8_t(buf, 32, rssi);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
|
||||
#else
|
||||
mavlink_hil_rc_inputs_raw_t *packet = (mavlink_hil_rc_inputs_raw_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->chan1_raw = chan1_raw;
|
||||
packet->chan2_raw = chan2_raw;
|
||||
packet->chan3_raw = chan3_raw;
|
||||
packet->chan4_raw = chan4_raw;
|
||||
packet->chan5_raw = chan5_raw;
|
||||
packet->chan6_raw = chan6_raw;
|
||||
packet->chan7_raw = chan7_raw;
|
||||
packet->chan8_raw = chan8_raw;
|
||||
packet->chan9_raw = chan9_raw;
|
||||
packet->chan10_raw = chan10_raw;
|
||||
packet->chan11_raw = chan11_raw;
|
||||
packet->chan12_raw = chan12_raw;
|
||||
packet->rssi = rssi;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIL_RC_INPUTS_RAW UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_hil_rc_inputs_raw_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan1_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 1 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan2_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 2 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan3_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 3 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan4_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 4 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan5_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 5 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan6_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 6 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan7_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 7 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan8_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 8 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan9_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 9 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan10_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 10 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan11_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 11 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field chan12_raw from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return [us] RC channel 12 value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rssi from hil_rc_inputs_raw message
|
||||
*
|
||||
* @return Receive signal strength indicator. Values: [0-100], 255: invalid/unknown.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_hil_rc_inputs_raw_get_rssi(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a hil_rc_inputs_raw message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param hil_rc_inputs_raw C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_hil_rc_inputs_raw_decode(const mavlink_message_t* msg, mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
hil_rc_inputs_raw->time_usec = mavlink_msg_hil_rc_inputs_raw_get_time_usec(msg);
|
||||
hil_rc_inputs_raw->chan1_raw = mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(msg);
|
||||
hil_rc_inputs_raw->chan2_raw = mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(msg);
|
||||
hil_rc_inputs_raw->chan3_raw = mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(msg);
|
||||
hil_rc_inputs_raw->chan4_raw = mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(msg);
|
||||
hil_rc_inputs_raw->chan5_raw = mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(msg);
|
||||
hil_rc_inputs_raw->chan6_raw = mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(msg);
|
||||
hil_rc_inputs_raw->chan7_raw = mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(msg);
|
||||
hil_rc_inputs_raw->chan8_raw = mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(msg);
|
||||
hil_rc_inputs_raw->chan9_raw = mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(msg);
|
||||
hil_rc_inputs_raw->chan10_raw = mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(msg);
|
||||
hil_rc_inputs_raw->chan11_raw = mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(msg);
|
||||
hil_rc_inputs_raw->chan12_raw = mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(msg);
|
||||
hil_rc_inputs_raw->rssi = mavlink_msg_hil_rc_inputs_raw_get_rssi(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN? msg->len : MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN;
|
||||
memset(hil_rc_inputs_raw, 0, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
|
||||
memcpy(hil_rc_inputs_raw, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,563 @@
|
||||
#pragma once
|
||||
// MESSAGE HIL_SENSOR PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_SENSOR 107
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_hil_sensor_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float xacc; /*< [m/s/s] X acceleration*/
|
||||
float yacc; /*< [m/s/s] Y acceleration*/
|
||||
float zacc; /*< [m/s/s] Z acceleration*/
|
||||
float xgyro; /*< [rad/s] Angular speed around X axis in body frame*/
|
||||
float ygyro; /*< [rad/s] Angular speed around Y axis in body frame*/
|
||||
float zgyro; /*< [rad/s] Angular speed around Z axis in body frame*/
|
||||
float xmag; /*< [gauss] X Magnetic field*/
|
||||
float ymag; /*< [gauss] Y Magnetic field*/
|
||||
float zmag; /*< [gauss] Z Magnetic field*/
|
||||
float abs_pressure; /*< [mbar] Absolute pressure*/
|
||||
float diff_pressure; /*< [mbar] Differential pressure (airspeed)*/
|
||||
float pressure_alt; /*< Altitude calculated from pressure*/
|
||||
float temperature; /*< [degC] Temperature*/
|
||||
uint32_t fields_updated; /*< Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.*/
|
||||
}) mavlink_hil_sensor_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_SENSOR_LEN 64
|
||||
#define MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN 64
|
||||
#define MAVLINK_MSG_ID_107_LEN 64
|
||||
#define MAVLINK_MSG_ID_107_MIN_LEN 64
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_SENSOR_CRC 108
|
||||
#define MAVLINK_MSG_ID_107_CRC 108
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_SENSOR { \
|
||||
107, \
|
||||
"HIL_SENSOR", \
|
||||
15, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_sensor_t, time_usec) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_sensor_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_sensor_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_sensor_t, zacc) }, \
|
||||
{ "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_sensor_t, xgyro) }, \
|
||||
{ "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_sensor_t, ygyro) }, \
|
||||
{ "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_sensor_t, zgyro) }, \
|
||||
{ "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_sensor_t, xmag) }, \
|
||||
{ "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_sensor_t, ymag) }, \
|
||||
{ "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_hil_sensor_t, zmag) }, \
|
||||
{ "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_hil_sensor_t, abs_pressure) }, \
|
||||
{ "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_hil_sensor_t, diff_pressure) }, \
|
||||
{ "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_hil_sensor_t, pressure_alt) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_hil_sensor_t, temperature) }, \
|
||||
{ "fields_updated", NULL, MAVLINK_TYPE_UINT32_T, 0, 60, offsetof(mavlink_hil_sensor_t, fields_updated) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_SENSOR { \
|
||||
"HIL_SENSOR", \
|
||||
15, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_sensor_t, time_usec) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_sensor_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_sensor_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_sensor_t, zacc) }, \
|
||||
{ "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_sensor_t, xgyro) }, \
|
||||
{ "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_sensor_t, ygyro) }, \
|
||||
{ "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_sensor_t, zgyro) }, \
|
||||
{ "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_sensor_t, xmag) }, \
|
||||
{ "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_sensor_t, ymag) }, \
|
||||
{ "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_hil_sensor_t, zmag) }, \
|
||||
{ "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_hil_sensor_t, abs_pressure) }, \
|
||||
{ "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_hil_sensor_t, diff_pressure) }, \
|
||||
{ "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_hil_sensor_t, pressure_alt) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_hil_sensor_t, temperature) }, \
|
||||
{ "fields_updated", NULL, MAVLINK_TYPE_UINT32_T, 0, 60, offsetof(mavlink_hil_sensor_t, fields_updated) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_sensor message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param xacc [m/s/s] X acceleration
|
||||
* @param yacc [m/s/s] Y acceleration
|
||||
* @param zacc [m/s/s] Z acceleration
|
||||
* @param xgyro [rad/s] Angular speed around X axis in body frame
|
||||
* @param ygyro [rad/s] Angular speed around Y axis in body frame
|
||||
* @param zgyro [rad/s] Angular speed around Z axis in body frame
|
||||
* @param xmag [gauss] X Magnetic field
|
||||
* @param ymag [gauss] Y Magnetic field
|
||||
* @param zmag [gauss] Z Magnetic field
|
||||
* @param abs_pressure [mbar] Absolute pressure
|
||||
* @param diff_pressure [mbar] Differential pressure (airspeed)
|
||||
* @param pressure_alt Altitude calculated from pressure
|
||||
* @param temperature [degC] Temperature
|
||||
* @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint32_t fields_updated)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, xacc);
|
||||
_mav_put_float(buf, 12, yacc);
|
||||
_mav_put_float(buf, 16, zacc);
|
||||
_mav_put_float(buf, 20, xgyro);
|
||||
_mav_put_float(buf, 24, ygyro);
|
||||
_mav_put_float(buf, 28, zgyro);
|
||||
_mav_put_float(buf, 32, xmag);
|
||||
_mav_put_float(buf, 36, ymag);
|
||||
_mav_put_float(buf, 40, zmag);
|
||||
_mav_put_float(buf, 44, abs_pressure);
|
||||
_mav_put_float(buf, 48, diff_pressure);
|
||||
_mav_put_float(buf, 52, pressure_alt);
|
||||
_mav_put_float(buf, 56, temperature);
|
||||
_mav_put_uint32_t(buf, 60, fields_updated);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_SENSOR_LEN);
|
||||
#else
|
||||
mavlink_hil_sensor_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
packet.abs_pressure = abs_pressure;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.pressure_alt = pressure_alt;
|
||||
packet.temperature = temperature;
|
||||
packet.fields_updated = fields_updated;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_SENSOR_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_SENSOR;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_sensor message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param xacc [m/s/s] X acceleration
|
||||
* @param yacc [m/s/s] Y acceleration
|
||||
* @param zacc [m/s/s] Z acceleration
|
||||
* @param xgyro [rad/s] Angular speed around X axis in body frame
|
||||
* @param ygyro [rad/s] Angular speed around Y axis in body frame
|
||||
* @param zgyro [rad/s] Angular speed around Z axis in body frame
|
||||
* @param xmag [gauss] X Magnetic field
|
||||
* @param ymag [gauss] Y Magnetic field
|
||||
* @param zmag [gauss] Z Magnetic field
|
||||
* @param abs_pressure [mbar] Absolute pressure
|
||||
* @param diff_pressure [mbar] Differential pressure (airspeed)
|
||||
* @param pressure_alt Altitude calculated from pressure
|
||||
* @param temperature [degC] Temperature
|
||||
* @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint32_t fields_updated)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, xacc);
|
||||
_mav_put_float(buf, 12, yacc);
|
||||
_mav_put_float(buf, 16, zacc);
|
||||
_mav_put_float(buf, 20, xgyro);
|
||||
_mav_put_float(buf, 24, ygyro);
|
||||
_mav_put_float(buf, 28, zgyro);
|
||||
_mav_put_float(buf, 32, xmag);
|
||||
_mav_put_float(buf, 36, ymag);
|
||||
_mav_put_float(buf, 40, zmag);
|
||||
_mav_put_float(buf, 44, abs_pressure);
|
||||
_mav_put_float(buf, 48, diff_pressure);
|
||||
_mav_put_float(buf, 52, pressure_alt);
|
||||
_mav_put_float(buf, 56, temperature);
|
||||
_mav_put_uint32_t(buf, 60, fields_updated);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_SENSOR_LEN);
|
||||
#else
|
||||
mavlink_hil_sensor_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
packet.abs_pressure = abs_pressure;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.pressure_alt = pressure_alt;
|
||||
packet.temperature = temperature;
|
||||
packet.fields_updated = fields_updated;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_SENSOR_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_SENSOR;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_sensor struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_sensor C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_sensor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_sensor_t* hil_sensor)
|
||||
{
|
||||
return mavlink_msg_hil_sensor_pack(system_id, component_id, msg, hil_sensor->time_usec, hil_sensor->xacc, hil_sensor->yacc, hil_sensor->zacc, hil_sensor->xgyro, hil_sensor->ygyro, hil_sensor->zgyro, hil_sensor->xmag, hil_sensor->ymag, hil_sensor->zmag, hil_sensor->abs_pressure, hil_sensor->diff_pressure, hil_sensor->pressure_alt, hil_sensor->temperature, hil_sensor->fields_updated);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_sensor struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_sensor C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_sensor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_sensor_t* hil_sensor)
|
||||
{
|
||||
return mavlink_msg_hil_sensor_pack_chan(system_id, component_id, chan, msg, hil_sensor->time_usec, hil_sensor->xacc, hil_sensor->yacc, hil_sensor->zacc, hil_sensor->xgyro, hil_sensor->ygyro, hil_sensor->zgyro, hil_sensor->xmag, hil_sensor->ymag, hil_sensor->zmag, hil_sensor->abs_pressure, hil_sensor->diff_pressure, hil_sensor->pressure_alt, hil_sensor->temperature, hil_sensor->fields_updated);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_sensor message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param xacc [m/s/s] X acceleration
|
||||
* @param yacc [m/s/s] Y acceleration
|
||||
* @param zacc [m/s/s] Z acceleration
|
||||
* @param xgyro [rad/s] Angular speed around X axis in body frame
|
||||
* @param ygyro [rad/s] Angular speed around Y axis in body frame
|
||||
* @param zgyro [rad/s] Angular speed around Z axis in body frame
|
||||
* @param xmag [gauss] X Magnetic field
|
||||
* @param ymag [gauss] Y Magnetic field
|
||||
* @param zmag [gauss] Z Magnetic field
|
||||
* @param abs_pressure [mbar] Absolute pressure
|
||||
* @param diff_pressure [mbar] Differential pressure (airspeed)
|
||||
* @param pressure_alt Altitude calculated from pressure
|
||||
* @param temperature [degC] Temperature
|
||||
* @param fields_updated Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_hil_sensor_send(mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint32_t fields_updated)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, xacc);
|
||||
_mav_put_float(buf, 12, yacc);
|
||||
_mav_put_float(buf, 16, zacc);
|
||||
_mav_put_float(buf, 20, xgyro);
|
||||
_mav_put_float(buf, 24, ygyro);
|
||||
_mav_put_float(buf, 28, zgyro);
|
||||
_mav_put_float(buf, 32, xmag);
|
||||
_mav_put_float(buf, 36, ymag);
|
||||
_mav_put_float(buf, 40, zmag);
|
||||
_mav_put_float(buf, 44, abs_pressure);
|
||||
_mav_put_float(buf, 48, diff_pressure);
|
||||
_mav_put_float(buf, 52, pressure_alt);
|
||||
_mav_put_float(buf, 56, temperature);
|
||||
_mav_put_uint32_t(buf, 60, fields_updated);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, buf, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
|
||||
#else
|
||||
mavlink_hil_sensor_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
packet.abs_pressure = abs_pressure;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.pressure_alt = pressure_alt;
|
||||
packet.temperature = temperature;
|
||||
packet.fields_updated = fields_updated;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_sensor message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_hil_sensor_send_struct(mavlink_channel_t chan, const mavlink_hil_sensor_t* hil_sensor)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_hil_sensor_send(chan, hil_sensor->time_usec, hil_sensor->xacc, hil_sensor->yacc, hil_sensor->zacc, hil_sensor->xgyro, hil_sensor->ygyro, hil_sensor->zgyro, hil_sensor->xmag, hil_sensor->ymag, hil_sensor->zmag, hil_sensor->abs_pressure, hil_sensor->diff_pressure, hil_sensor->pressure_alt, hil_sensor->temperature, hil_sensor->fields_updated);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)hil_sensor, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HIL_SENSOR_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_hil_sensor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint32_t fields_updated)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, xacc);
|
||||
_mav_put_float(buf, 12, yacc);
|
||||
_mav_put_float(buf, 16, zacc);
|
||||
_mav_put_float(buf, 20, xgyro);
|
||||
_mav_put_float(buf, 24, ygyro);
|
||||
_mav_put_float(buf, 28, zgyro);
|
||||
_mav_put_float(buf, 32, xmag);
|
||||
_mav_put_float(buf, 36, ymag);
|
||||
_mav_put_float(buf, 40, zmag);
|
||||
_mav_put_float(buf, 44, abs_pressure);
|
||||
_mav_put_float(buf, 48, diff_pressure);
|
||||
_mav_put_float(buf, 52, pressure_alt);
|
||||
_mav_put_float(buf, 56, temperature);
|
||||
_mav_put_uint32_t(buf, 60, fields_updated);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, buf, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
|
||||
#else
|
||||
mavlink_hil_sensor_t *packet = (mavlink_hil_sensor_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->xacc = xacc;
|
||||
packet->yacc = yacc;
|
||||
packet->zacc = zacc;
|
||||
packet->xgyro = xgyro;
|
||||
packet->ygyro = ygyro;
|
||||
packet->zgyro = zgyro;
|
||||
packet->xmag = xmag;
|
||||
packet->ymag = ymag;
|
||||
packet->zmag = zmag;
|
||||
packet->abs_pressure = abs_pressure;
|
||||
packet->diff_pressure = diff_pressure;
|
||||
packet->pressure_alt = pressure_alt;
|
||||
packet->temperature = temperature;
|
||||
packet->fields_updated = fields_updated;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)packet, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIL_SENSOR UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from hil_sensor message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_hil_sensor_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xacc from hil_sensor message
|
||||
*
|
||||
* @return [m/s/s] X acceleration
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_xacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yacc from hil_sensor message
|
||||
*
|
||||
* @return [m/s/s] Y acceleration
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_yacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zacc from hil_sensor message
|
||||
*
|
||||
* @return [m/s/s] Z acceleration
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_zacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xgyro from hil_sensor message
|
||||
*
|
||||
* @return [rad/s] Angular speed around X axis in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_xgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ygyro from hil_sensor message
|
||||
*
|
||||
* @return [rad/s] Angular speed around Y axis in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_ygyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zgyro from hil_sensor message
|
||||
*
|
||||
* @return [rad/s] Angular speed around Z axis in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_zgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xmag from hil_sensor message
|
||||
*
|
||||
* @return [gauss] X Magnetic field
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_xmag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ymag from hil_sensor message
|
||||
*
|
||||
* @return [gauss] Y Magnetic field
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_ymag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zmag from hil_sensor message
|
||||
*
|
||||
* @return [gauss] Z Magnetic field
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_zmag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field abs_pressure from hil_sensor message
|
||||
*
|
||||
* @return [mbar] Absolute pressure
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_abs_pressure(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diff_pressure from hil_sensor message
|
||||
*
|
||||
* @return [mbar] Differential pressure (airspeed)
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_diff_pressure(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pressure_alt from hil_sensor message
|
||||
*
|
||||
* @return Altitude calculated from pressure
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_pressure_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field temperature from hil_sensor message
|
||||
*
|
||||
* @return [degC] Temperature
|
||||
*/
|
||||
static inline float mavlink_msg_hil_sensor_get_temperature(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 56);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fields_updated from hil_sensor message
|
||||
*
|
||||
* @return Bitmap for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_hil_sensor_get_fields_updated(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a hil_sensor message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param hil_sensor C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_hil_sensor_decode(const mavlink_message_t* msg, mavlink_hil_sensor_t* hil_sensor)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
hil_sensor->time_usec = mavlink_msg_hil_sensor_get_time_usec(msg);
|
||||
hil_sensor->xacc = mavlink_msg_hil_sensor_get_xacc(msg);
|
||||
hil_sensor->yacc = mavlink_msg_hil_sensor_get_yacc(msg);
|
||||
hil_sensor->zacc = mavlink_msg_hil_sensor_get_zacc(msg);
|
||||
hil_sensor->xgyro = mavlink_msg_hil_sensor_get_xgyro(msg);
|
||||
hil_sensor->ygyro = mavlink_msg_hil_sensor_get_ygyro(msg);
|
||||
hil_sensor->zgyro = mavlink_msg_hil_sensor_get_zgyro(msg);
|
||||
hil_sensor->xmag = mavlink_msg_hil_sensor_get_xmag(msg);
|
||||
hil_sensor->ymag = mavlink_msg_hil_sensor_get_ymag(msg);
|
||||
hil_sensor->zmag = mavlink_msg_hil_sensor_get_zmag(msg);
|
||||
hil_sensor->abs_pressure = mavlink_msg_hil_sensor_get_abs_pressure(msg);
|
||||
hil_sensor->diff_pressure = mavlink_msg_hil_sensor_get_diff_pressure(msg);
|
||||
hil_sensor->pressure_alt = mavlink_msg_hil_sensor_get_pressure_alt(msg);
|
||||
hil_sensor->temperature = mavlink_msg_hil_sensor_get_temperature(msg);
|
||||
hil_sensor->fields_updated = mavlink_msg_hil_sensor_get_fields_updated(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_SENSOR_LEN? msg->len : MAVLINK_MSG_ID_HIL_SENSOR_LEN;
|
||||
memset(hil_sensor, 0, MAVLINK_MSG_ID_HIL_SENSOR_LEN);
|
||||
memcpy(hil_sensor, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,588 @@
|
||||
#pragma once
|
||||
// MESSAGE HIL_STATE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_STATE 90
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_hil_state_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float roll; /*< [rad] Roll angle*/
|
||||
float pitch; /*< [rad] Pitch angle*/
|
||||
float yaw; /*< [rad] Yaw angle*/
|
||||
float rollspeed; /*< [rad/s] Body frame roll / phi angular speed*/
|
||||
float pitchspeed; /*< [rad/s] Body frame pitch / theta angular speed*/
|
||||
float yawspeed; /*< [rad/s] Body frame yaw / psi angular speed*/
|
||||
int32_t lat; /*< [degE7] Latitude*/
|
||||
int32_t lon; /*< [degE7] Longitude*/
|
||||
int32_t alt; /*< [mm] Altitude*/
|
||||
int16_t vx; /*< [cm/s] Ground X Speed (Latitude)*/
|
||||
int16_t vy; /*< [cm/s] Ground Y Speed (Longitude)*/
|
||||
int16_t vz; /*< [cm/s] Ground Z Speed (Altitude)*/
|
||||
int16_t xacc; /*< [mG] X acceleration*/
|
||||
int16_t yacc; /*< [mG] Y acceleration*/
|
||||
int16_t zacc; /*< [mG] Z acceleration*/
|
||||
}) mavlink_hil_state_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_STATE_LEN 56
|
||||
#define MAVLINK_MSG_ID_HIL_STATE_MIN_LEN 56
|
||||
#define MAVLINK_MSG_ID_90_LEN 56
|
||||
#define MAVLINK_MSG_ID_90_MIN_LEN 56
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_STATE_CRC 183
|
||||
#define MAVLINK_MSG_ID_90_CRC 183
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_STATE { \
|
||||
90, \
|
||||
"HIL_STATE", \
|
||||
16, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_t, time_usec) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_state_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_state_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_state_t, yaw) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_state_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_t, yawspeed) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 32, offsetof(mavlink_hil_state_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_t, alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 44, offsetof(mavlink_hil_state_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 46, offsetof(mavlink_hil_state_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_t, vz) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 54, offsetof(mavlink_hil_state_t, zacc) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_STATE { \
|
||||
"HIL_STATE", \
|
||||
16, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_t, time_usec) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_state_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_state_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_state_t, yaw) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_state_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_t, yawspeed) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 32, offsetof(mavlink_hil_state_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_t, alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 44, offsetof(mavlink_hil_state_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 46, offsetof(mavlink_hil_state_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_t, vz) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 54, offsetof(mavlink_hil_state_t, zacc) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_state message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param roll [rad] Roll angle
|
||||
* @param pitch [rad] Pitch angle
|
||||
* @param yaw [rad] Yaw angle
|
||||
* @param rollspeed [rad/s] Body frame roll / phi angular speed
|
||||
* @param pitchspeed [rad/s] Body frame pitch / theta angular speed
|
||||
* @param yawspeed [rad/s] Body frame yaw / psi angular speed
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param alt [mm] Altitude
|
||||
* @param vx [cm/s] Ground X Speed (Latitude)
|
||||
* @param vy [cm/s] Ground Y Speed (Longitude)
|
||||
* @param vz [cm/s] Ground Z Speed (Altitude)
|
||||
* @param xacc [mG] X acceleration
|
||||
* @param yacc [mG] Y acceleration
|
||||
* @param zacc [mG] Z acceleration
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_STATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, roll);
|
||||
_mav_put_float(buf, 12, pitch);
|
||||
_mav_put_float(buf, 16, yaw);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
_mav_put_int32_t(buf, 32, lat);
|
||||
_mav_put_int32_t(buf, 36, lon);
|
||||
_mav_put_int32_t(buf, 40, alt);
|
||||
_mav_put_int16_t(buf, 44, vx);
|
||||
_mav_put_int16_t(buf, 46, vy);
|
||||
_mav_put_int16_t(buf, 48, vz);
|
||||
_mav_put_int16_t(buf, 50, xacc);
|
||||
_mav_put_int16_t(buf, 52, yacc);
|
||||
_mav_put_int16_t(buf, 54, zacc);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_LEN);
|
||||
#else
|
||||
mavlink_hil_state_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_STATE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_state message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param roll [rad] Roll angle
|
||||
* @param pitch [rad] Pitch angle
|
||||
* @param yaw [rad] Yaw angle
|
||||
* @param rollspeed [rad/s] Body frame roll / phi angular speed
|
||||
* @param pitchspeed [rad/s] Body frame pitch / theta angular speed
|
||||
* @param yawspeed [rad/s] Body frame yaw / psi angular speed
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param alt [mm] Altitude
|
||||
* @param vx [cm/s] Ground X Speed (Latitude)
|
||||
* @param vy [cm/s] Ground Y Speed (Longitude)
|
||||
* @param vz [cm/s] Ground Z Speed (Altitude)
|
||||
* @param xacc [mG] X acceleration
|
||||
* @param yacc [mG] Y acceleration
|
||||
* @param zacc [mG] Z acceleration
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,int16_t xacc,int16_t yacc,int16_t zacc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_STATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, roll);
|
||||
_mav_put_float(buf, 12, pitch);
|
||||
_mav_put_float(buf, 16, yaw);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
_mav_put_int32_t(buf, 32, lat);
|
||||
_mav_put_int32_t(buf, 36, lon);
|
||||
_mav_put_int32_t(buf, 40, alt);
|
||||
_mav_put_int16_t(buf, 44, vx);
|
||||
_mav_put_int16_t(buf, 46, vy);
|
||||
_mav_put_int16_t(buf, 48, vz);
|
||||
_mav_put_int16_t(buf, 50, xacc);
|
||||
_mav_put_int16_t(buf, 52, yacc);
|
||||
_mav_put_int16_t(buf, 54, zacc);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_LEN);
|
||||
#else
|
||||
mavlink_hil_state_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_STATE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_state struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_state C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_state_t* hil_state)
|
||||
{
|
||||
return mavlink_msg_hil_state_pack(system_id, component_id, msg, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_state struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_state C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_state_t* hil_state)
|
||||
{
|
||||
return mavlink_msg_hil_state_pack_chan(system_id, component_id, chan, msg, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_state message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param roll [rad] Roll angle
|
||||
* @param pitch [rad] Pitch angle
|
||||
* @param yaw [rad] Yaw angle
|
||||
* @param rollspeed [rad/s] Body frame roll / phi angular speed
|
||||
* @param pitchspeed [rad/s] Body frame pitch / theta angular speed
|
||||
* @param yawspeed [rad/s] Body frame yaw / psi angular speed
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param alt [mm] Altitude
|
||||
* @param vx [cm/s] Ground X Speed (Latitude)
|
||||
* @param vy [cm/s] Ground Y Speed (Longitude)
|
||||
* @param vz [cm/s] Ground Z Speed (Altitude)
|
||||
* @param xacc [mG] X acceleration
|
||||
* @param yacc [mG] Y acceleration
|
||||
* @param zacc [mG] Z acceleration
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_hil_state_send(mavlink_channel_t chan, uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_STATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, roll);
|
||||
_mav_put_float(buf, 12, pitch);
|
||||
_mav_put_float(buf, 16, yaw);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
_mav_put_int32_t(buf, 32, lat);
|
||||
_mav_put_int32_t(buf, 36, lon);
|
||||
_mav_put_int32_t(buf, 40, alt);
|
||||
_mav_put_int16_t(buf, 44, vx);
|
||||
_mav_put_int16_t(buf, 46, vy);
|
||||
_mav_put_int16_t(buf, 48, vz);
|
||||
_mav_put_int16_t(buf, 50, xacc);
|
||||
_mav_put_int16_t(buf, 52, yacc);
|
||||
_mav_put_int16_t(buf, 54, zacc);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
|
||||
#else
|
||||
mavlink_hil_state_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_state message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_hil_state_send_struct(mavlink_channel_t chan, const mavlink_hil_state_t* hil_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_hil_state_send(chan, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)hil_state, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HIL_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_hil_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, roll);
|
||||
_mav_put_float(buf, 12, pitch);
|
||||
_mav_put_float(buf, 16, yaw);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
_mav_put_int32_t(buf, 32, lat);
|
||||
_mav_put_int32_t(buf, 36, lon);
|
||||
_mav_put_int32_t(buf, 40, alt);
|
||||
_mav_put_int16_t(buf, 44, vx);
|
||||
_mav_put_int16_t(buf, 46, vy);
|
||||
_mav_put_int16_t(buf, 48, vz);
|
||||
_mav_put_int16_t(buf, 50, xacc);
|
||||
_mav_put_int16_t(buf, 52, yacc);
|
||||
_mav_put_int16_t(buf, 54, zacc);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
|
||||
#else
|
||||
mavlink_hil_state_t *packet = (mavlink_hil_state_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->roll = roll;
|
||||
packet->pitch = pitch;
|
||||
packet->yaw = yaw;
|
||||
packet->rollspeed = rollspeed;
|
||||
packet->pitchspeed = pitchspeed;
|
||||
packet->yawspeed = yawspeed;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->vx = vx;
|
||||
packet->vy = vy;
|
||||
packet->vz = vz;
|
||||
packet->xacc = xacc;
|
||||
packet->yacc = yacc;
|
||||
packet->zacc = zacc;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIL_STATE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from hil_state message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_hil_state_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from hil_state message
|
||||
*
|
||||
* @return [rad] Roll angle
|
||||
*/
|
||||
static inline float mavlink_msg_hil_state_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from hil_state message
|
||||
*
|
||||
* @return [rad] Pitch angle
|
||||
*/
|
||||
static inline float mavlink_msg_hil_state_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from hil_state message
|
||||
*
|
||||
* @return [rad] Yaw angle
|
||||
*/
|
||||
static inline float mavlink_msg_hil_state_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rollspeed from hil_state message
|
||||
*
|
||||
* @return [rad/s] Body frame roll / phi angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_hil_state_get_rollspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitchspeed from hil_state message
|
||||
*
|
||||
* @return [rad/s] Body frame pitch / theta angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_hil_state_get_pitchspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yawspeed from hil_state message
|
||||
*
|
||||
* @return [rad/s] Body frame yaw / psi angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_hil_state_get_yawspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from hil_state message
|
||||
*
|
||||
* @return [degE7] Latitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_hil_state_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from hil_state message
|
||||
*
|
||||
* @return [degE7] Longitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_hil_state_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from hil_state message
|
||||
*
|
||||
* @return [mm] Altitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_hil_state_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vx from hil_state message
|
||||
*
|
||||
* @return [cm/s] Ground X Speed (Latitude)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_get_vx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vy from hil_state message
|
||||
*
|
||||
* @return [cm/s] Ground Y Speed (Longitude)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_get_vy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 46);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vz from hil_state message
|
||||
*
|
||||
* @return [cm/s] Ground Z Speed (Altitude)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_get_vz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xacc from hil_state message
|
||||
*
|
||||
* @return [mG] X acceleration
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_get_xacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 50);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yacc from hil_state message
|
||||
*
|
||||
* @return [mG] Y acceleration
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_get_yacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zacc from hil_state message
|
||||
*
|
||||
* @return [mG] Z acceleration
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_get_zacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 54);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a hil_state message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param hil_state C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_hil_state_decode(const mavlink_message_t* msg, mavlink_hil_state_t* hil_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
hil_state->time_usec = mavlink_msg_hil_state_get_time_usec(msg);
|
||||
hil_state->roll = mavlink_msg_hil_state_get_roll(msg);
|
||||
hil_state->pitch = mavlink_msg_hil_state_get_pitch(msg);
|
||||
hil_state->yaw = mavlink_msg_hil_state_get_yaw(msg);
|
||||
hil_state->rollspeed = mavlink_msg_hil_state_get_rollspeed(msg);
|
||||
hil_state->pitchspeed = mavlink_msg_hil_state_get_pitchspeed(msg);
|
||||
hil_state->yawspeed = mavlink_msg_hil_state_get_yawspeed(msg);
|
||||
hil_state->lat = mavlink_msg_hil_state_get_lat(msg);
|
||||
hil_state->lon = mavlink_msg_hil_state_get_lon(msg);
|
||||
hil_state->alt = mavlink_msg_hil_state_get_alt(msg);
|
||||
hil_state->vx = mavlink_msg_hil_state_get_vx(msg);
|
||||
hil_state->vy = mavlink_msg_hil_state_get_vy(msg);
|
||||
hil_state->vz = mavlink_msg_hil_state_get_vz(msg);
|
||||
hil_state->xacc = mavlink_msg_hil_state_get_xacc(msg);
|
||||
hil_state->yacc = mavlink_msg_hil_state_get_yacc(msg);
|
||||
hil_state->zacc = mavlink_msg_hil_state_get_zacc(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_STATE_LEN? msg->len : MAVLINK_MSG_ID_HIL_STATE_LEN;
|
||||
memset(hil_state, 0, MAVLINK_MSG_ID_HIL_STATE_LEN);
|
||||
memcpy(hil_state, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,580 @@
|
||||
#pragma once
|
||||
// MESSAGE HIL_STATE_QUATERNION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_STATE_QUATERNION 115
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_hil_state_quaternion_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float attitude_quaternion[4]; /*< Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)*/
|
||||
float rollspeed; /*< [rad/s] Body frame roll / phi angular speed*/
|
||||
float pitchspeed; /*< [rad/s] Body frame pitch / theta angular speed*/
|
||||
float yawspeed; /*< [rad/s] Body frame yaw / psi angular speed*/
|
||||
int32_t lat; /*< [degE7] Latitude*/
|
||||
int32_t lon; /*< [degE7] Longitude*/
|
||||
int32_t alt; /*< [mm] Altitude*/
|
||||
int16_t vx; /*< [cm/s] Ground X Speed (Latitude)*/
|
||||
int16_t vy; /*< [cm/s] Ground Y Speed (Longitude)*/
|
||||
int16_t vz; /*< [cm/s] Ground Z Speed (Altitude)*/
|
||||
uint16_t ind_airspeed; /*< [cm/s] Indicated airspeed*/
|
||||
uint16_t true_airspeed; /*< [cm/s] True airspeed*/
|
||||
int16_t xacc; /*< [mG] X acceleration*/
|
||||
int16_t yacc; /*< [mG] Y acceleration*/
|
||||
int16_t zacc; /*< [mG] Z acceleration*/
|
||||
}) mavlink_hil_state_quaternion_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN 64
|
||||
#define MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN 64
|
||||
#define MAVLINK_MSG_ID_115_LEN 64
|
||||
#define MAVLINK_MSG_ID_115_MIN_LEN 64
|
||||
|
||||
#define MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC 4
|
||||
#define MAVLINK_MSG_ID_115_CRC 4
|
||||
|
||||
#define MAVLINK_MSG_HIL_STATE_QUATERNION_FIELD_ATTITUDE_QUATERNION_LEN 4
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION { \
|
||||
115, \
|
||||
"HIL_STATE_QUATERNION", \
|
||||
16, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_quaternion_t, time_usec) }, \
|
||||
{ "attitude_quaternion", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_hil_state_quaternion_t, attitude_quaternion) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_quaternion_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_quaternion_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_state_quaternion_t, yawspeed) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_quaternion_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_quaternion_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 44, offsetof(mavlink_hil_state_quaternion_t, alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_quaternion_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_quaternion_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_quaternion_t, vz) }, \
|
||||
{ "ind_airspeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 54, offsetof(mavlink_hil_state_quaternion_t, ind_airspeed) }, \
|
||||
{ "true_airspeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_hil_state_quaternion_t, true_airspeed) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 58, offsetof(mavlink_hil_state_quaternion_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 60, offsetof(mavlink_hil_state_quaternion_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 62, offsetof(mavlink_hil_state_quaternion_t, zacc) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION { \
|
||||
"HIL_STATE_QUATERNION", \
|
||||
16, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_quaternion_t, time_usec) }, \
|
||||
{ "attitude_quaternion", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_hil_state_quaternion_t, attitude_quaternion) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_quaternion_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_quaternion_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_state_quaternion_t, yawspeed) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_quaternion_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_quaternion_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 44, offsetof(mavlink_hil_state_quaternion_t, alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_quaternion_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_quaternion_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_quaternion_t, vz) }, \
|
||||
{ "ind_airspeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 54, offsetof(mavlink_hil_state_quaternion_t, ind_airspeed) }, \
|
||||
{ "true_airspeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_hil_state_quaternion_t, true_airspeed) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 58, offsetof(mavlink_hil_state_quaternion_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 60, offsetof(mavlink_hil_state_quaternion_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 62, offsetof(mavlink_hil_state_quaternion_t, zacc) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_state_quaternion message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)
|
||||
* @param rollspeed [rad/s] Body frame roll / phi angular speed
|
||||
* @param pitchspeed [rad/s] Body frame pitch / theta angular speed
|
||||
* @param yawspeed [rad/s] Body frame yaw / psi angular speed
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param alt [mm] Altitude
|
||||
* @param vx [cm/s] Ground X Speed (Latitude)
|
||||
* @param vy [cm/s] Ground Y Speed (Longitude)
|
||||
* @param vz [cm/s] Ground Z Speed (Altitude)
|
||||
* @param ind_airspeed [cm/s] Indicated airspeed
|
||||
* @param true_airspeed [cm/s] True airspeed
|
||||
* @param xacc [mG] X acceleration
|
||||
* @param yacc [mG] Y acceleration
|
||||
* @param zacc [mG] Z acceleration
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_state_quaternion_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, const float *attitude_quaternion, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t ind_airspeed, uint16_t true_airspeed, int16_t xacc, int16_t yacc, int16_t zacc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_int32_t(buf, 36, lat);
|
||||
_mav_put_int32_t(buf, 40, lon);
|
||||
_mav_put_int32_t(buf, 44, alt);
|
||||
_mav_put_int16_t(buf, 48, vx);
|
||||
_mav_put_int16_t(buf, 50, vy);
|
||||
_mav_put_int16_t(buf, 52, vz);
|
||||
_mav_put_uint16_t(buf, 54, ind_airspeed);
|
||||
_mav_put_uint16_t(buf, 56, true_airspeed);
|
||||
_mav_put_int16_t(buf, 58, xacc);
|
||||
_mav_put_int16_t(buf, 60, yacc);
|
||||
_mav_put_int16_t(buf, 62, zacc);
|
||||
_mav_put_float_array(buf, 8, attitude_quaternion, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN);
|
||||
#else
|
||||
mavlink_hil_state_quaternion_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.ind_airspeed = ind_airspeed;
|
||||
packet.true_airspeed = true_airspeed;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_STATE_QUATERNION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a hil_state_quaternion message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)
|
||||
* @param rollspeed [rad/s] Body frame roll / phi angular speed
|
||||
* @param pitchspeed [rad/s] Body frame pitch / theta angular speed
|
||||
* @param yawspeed [rad/s] Body frame yaw / psi angular speed
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param alt [mm] Altitude
|
||||
* @param vx [cm/s] Ground X Speed (Latitude)
|
||||
* @param vy [cm/s] Ground Y Speed (Longitude)
|
||||
* @param vz [cm/s] Ground Z Speed (Altitude)
|
||||
* @param ind_airspeed [cm/s] Indicated airspeed
|
||||
* @param true_airspeed [cm/s] True airspeed
|
||||
* @param xacc [mG] X acceleration
|
||||
* @param yacc [mG] Y acceleration
|
||||
* @param zacc [mG] Z acceleration
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_state_quaternion_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,const float *attitude_quaternion,float rollspeed,float pitchspeed,float yawspeed,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,uint16_t ind_airspeed,uint16_t true_airspeed,int16_t xacc,int16_t yacc,int16_t zacc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_int32_t(buf, 36, lat);
|
||||
_mav_put_int32_t(buf, 40, lon);
|
||||
_mav_put_int32_t(buf, 44, alt);
|
||||
_mav_put_int16_t(buf, 48, vx);
|
||||
_mav_put_int16_t(buf, 50, vy);
|
||||
_mav_put_int16_t(buf, 52, vz);
|
||||
_mav_put_uint16_t(buf, 54, ind_airspeed);
|
||||
_mav_put_uint16_t(buf, 56, true_airspeed);
|
||||
_mav_put_int16_t(buf, 58, xacc);
|
||||
_mav_put_int16_t(buf, 60, yacc);
|
||||
_mav_put_int16_t(buf, 62, zacc);
|
||||
_mav_put_float_array(buf, 8, attitude_quaternion, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN);
|
||||
#else
|
||||
mavlink_hil_state_quaternion_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.ind_airspeed = ind_airspeed;
|
||||
packet.true_airspeed = true_airspeed;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_STATE_QUATERNION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_state_quaternion struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_state_quaternion C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_state_quaternion_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_state_quaternion_t* hil_state_quaternion)
|
||||
{
|
||||
return mavlink_msg_hil_state_quaternion_pack(system_id, component_id, msg, hil_state_quaternion->time_usec, hil_state_quaternion->attitude_quaternion, hil_state_quaternion->rollspeed, hil_state_quaternion->pitchspeed, hil_state_quaternion->yawspeed, hil_state_quaternion->lat, hil_state_quaternion->lon, hil_state_quaternion->alt, hil_state_quaternion->vx, hil_state_quaternion->vy, hil_state_quaternion->vz, hil_state_quaternion->ind_airspeed, hil_state_quaternion->true_airspeed, hil_state_quaternion->xacc, hil_state_quaternion->yacc, hil_state_quaternion->zacc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hil_state_quaternion struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hil_state_quaternion C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_state_quaternion_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_state_quaternion_t* hil_state_quaternion)
|
||||
{
|
||||
return mavlink_msg_hil_state_quaternion_pack_chan(system_id, component_id, chan, msg, hil_state_quaternion->time_usec, hil_state_quaternion->attitude_quaternion, hil_state_quaternion->rollspeed, hil_state_quaternion->pitchspeed, hil_state_quaternion->yawspeed, hil_state_quaternion->lat, hil_state_quaternion->lon, hil_state_quaternion->alt, hil_state_quaternion->vx, hil_state_quaternion->vy, hil_state_quaternion->vz, hil_state_quaternion->ind_airspeed, hil_state_quaternion->true_airspeed, hil_state_quaternion->xacc, hil_state_quaternion->yacc, hil_state_quaternion->zacc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_state_quaternion message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param attitude_quaternion Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)
|
||||
* @param rollspeed [rad/s] Body frame roll / phi angular speed
|
||||
* @param pitchspeed [rad/s] Body frame pitch / theta angular speed
|
||||
* @param yawspeed [rad/s] Body frame yaw / psi angular speed
|
||||
* @param lat [degE7] Latitude
|
||||
* @param lon [degE7] Longitude
|
||||
* @param alt [mm] Altitude
|
||||
* @param vx [cm/s] Ground X Speed (Latitude)
|
||||
* @param vy [cm/s] Ground Y Speed (Longitude)
|
||||
* @param vz [cm/s] Ground Z Speed (Altitude)
|
||||
* @param ind_airspeed [cm/s] Indicated airspeed
|
||||
* @param true_airspeed [cm/s] True airspeed
|
||||
* @param xacc [mG] X acceleration
|
||||
* @param yacc [mG] Y acceleration
|
||||
* @param zacc [mG] Z acceleration
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_hil_state_quaternion_send(mavlink_channel_t chan, uint64_t time_usec, const float *attitude_quaternion, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t ind_airspeed, uint16_t true_airspeed, int16_t xacc, int16_t yacc, int16_t zacc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_int32_t(buf, 36, lat);
|
||||
_mav_put_int32_t(buf, 40, lon);
|
||||
_mav_put_int32_t(buf, 44, alt);
|
||||
_mav_put_int16_t(buf, 48, vx);
|
||||
_mav_put_int16_t(buf, 50, vy);
|
||||
_mav_put_int16_t(buf, 52, vz);
|
||||
_mav_put_uint16_t(buf, 54, ind_airspeed);
|
||||
_mav_put_uint16_t(buf, 56, true_airspeed);
|
||||
_mav_put_int16_t(buf, 58, xacc);
|
||||
_mav_put_int16_t(buf, 60, yacc);
|
||||
_mav_put_int16_t(buf, 62, zacc);
|
||||
_mav_put_float_array(buf, 8, attitude_quaternion, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
|
||||
#else
|
||||
mavlink_hil_state_quaternion_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.ind_airspeed = ind_airspeed;
|
||||
packet.true_airspeed = true_airspeed;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hil_state_quaternion message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_hil_state_quaternion_send_struct(mavlink_channel_t chan, const mavlink_hil_state_quaternion_t* hil_state_quaternion)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_hil_state_quaternion_send(chan, hil_state_quaternion->time_usec, hil_state_quaternion->attitude_quaternion, hil_state_quaternion->rollspeed, hil_state_quaternion->pitchspeed, hil_state_quaternion->yawspeed, hil_state_quaternion->lat, hil_state_quaternion->lon, hil_state_quaternion->alt, hil_state_quaternion->vx, hil_state_quaternion->vy, hil_state_quaternion->vz, hil_state_quaternion->ind_airspeed, hil_state_quaternion->true_airspeed, hil_state_quaternion->xacc, hil_state_quaternion->yacc, hil_state_quaternion->zacc);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)hil_state_quaternion, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_hil_state_quaternion_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, const float *attitude_quaternion, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t ind_airspeed, uint16_t true_airspeed, int16_t xacc, int16_t yacc, int16_t zacc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_int32_t(buf, 36, lat);
|
||||
_mav_put_int32_t(buf, 40, lon);
|
||||
_mav_put_int32_t(buf, 44, alt);
|
||||
_mav_put_int16_t(buf, 48, vx);
|
||||
_mav_put_int16_t(buf, 50, vy);
|
||||
_mav_put_int16_t(buf, 52, vz);
|
||||
_mav_put_uint16_t(buf, 54, ind_airspeed);
|
||||
_mav_put_uint16_t(buf, 56, true_airspeed);
|
||||
_mav_put_int16_t(buf, 58, xacc);
|
||||
_mav_put_int16_t(buf, 60, yacc);
|
||||
_mav_put_int16_t(buf, 62, zacc);
|
||||
_mav_put_float_array(buf, 8, attitude_quaternion, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
|
||||
#else
|
||||
mavlink_hil_state_quaternion_t *packet = (mavlink_hil_state_quaternion_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->rollspeed = rollspeed;
|
||||
packet->pitchspeed = pitchspeed;
|
||||
packet->yawspeed = yawspeed;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->vx = vx;
|
||||
packet->vy = vy;
|
||||
packet->vz = vz;
|
||||
packet->ind_airspeed = ind_airspeed;
|
||||
packet->true_airspeed = true_airspeed;
|
||||
packet->xacc = xacc;
|
||||
packet->yacc = yacc;
|
||||
packet->zacc = zacc;
|
||||
mav_array_memcpy(packet->attitude_quaternion, attitude_quaternion, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIL_STATE_QUATERNION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from hil_state_quaternion message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_hil_state_quaternion_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field attitude_quaternion from hil_state_quaternion message
|
||||
*
|
||||
* @return Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_state_quaternion_get_attitude_quaternion(const mavlink_message_t* msg, float *attitude_quaternion)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, attitude_quaternion, 4, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rollspeed from hil_state_quaternion message
|
||||
*
|
||||
* @return [rad/s] Body frame roll / phi angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_hil_state_quaternion_get_rollspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitchspeed from hil_state_quaternion message
|
||||
*
|
||||
* @return [rad/s] Body frame pitch / theta angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_hil_state_quaternion_get_pitchspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yawspeed from hil_state_quaternion message
|
||||
*
|
||||
* @return [rad/s] Body frame yaw / psi angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_hil_state_quaternion_get_yawspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from hil_state_quaternion message
|
||||
*
|
||||
* @return [degE7] Latitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_hil_state_quaternion_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from hil_state_quaternion message
|
||||
*
|
||||
* @return [degE7] Longitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_hil_state_quaternion_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from hil_state_quaternion message
|
||||
*
|
||||
* @return [mm] Altitude
|
||||
*/
|
||||
static inline int32_t mavlink_msg_hil_state_quaternion_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vx from hil_state_quaternion message
|
||||
*
|
||||
* @return [cm/s] Ground X Speed (Latitude)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_quaternion_get_vx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vy from hil_state_quaternion message
|
||||
*
|
||||
* @return [cm/s] Ground Y Speed (Longitude)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_quaternion_get_vy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 50);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vz from hil_state_quaternion message
|
||||
*
|
||||
* @return [cm/s] Ground Z Speed (Altitude)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_quaternion_get_vz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ind_airspeed from hil_state_quaternion message
|
||||
*
|
||||
* @return [cm/s] Indicated airspeed
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_state_quaternion_get_ind_airspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 54);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field true_airspeed from hil_state_quaternion message
|
||||
*
|
||||
* @return [cm/s] True airspeed
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_state_quaternion_get_true_airspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 56);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xacc from hil_state_quaternion message
|
||||
*
|
||||
* @return [mG] X acceleration
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_quaternion_get_xacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 58);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yacc from hil_state_quaternion message
|
||||
*
|
||||
* @return [mG] Y acceleration
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_quaternion_get_yacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zacc from hil_state_quaternion message
|
||||
*
|
||||
* @return [mG] Z acceleration
|
||||
*/
|
||||
static inline int16_t mavlink_msg_hil_state_quaternion_get_zacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 62);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a hil_state_quaternion message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param hil_state_quaternion C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_hil_state_quaternion_decode(const mavlink_message_t* msg, mavlink_hil_state_quaternion_t* hil_state_quaternion)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
hil_state_quaternion->time_usec = mavlink_msg_hil_state_quaternion_get_time_usec(msg);
|
||||
mavlink_msg_hil_state_quaternion_get_attitude_quaternion(msg, hil_state_quaternion->attitude_quaternion);
|
||||
hil_state_quaternion->rollspeed = mavlink_msg_hil_state_quaternion_get_rollspeed(msg);
|
||||
hil_state_quaternion->pitchspeed = mavlink_msg_hil_state_quaternion_get_pitchspeed(msg);
|
||||
hil_state_quaternion->yawspeed = mavlink_msg_hil_state_quaternion_get_yawspeed(msg);
|
||||
hil_state_quaternion->lat = mavlink_msg_hil_state_quaternion_get_lat(msg);
|
||||
hil_state_quaternion->lon = mavlink_msg_hil_state_quaternion_get_lon(msg);
|
||||
hil_state_quaternion->alt = mavlink_msg_hil_state_quaternion_get_alt(msg);
|
||||
hil_state_quaternion->vx = mavlink_msg_hil_state_quaternion_get_vx(msg);
|
||||
hil_state_quaternion->vy = mavlink_msg_hil_state_quaternion_get_vy(msg);
|
||||
hil_state_quaternion->vz = mavlink_msg_hil_state_quaternion_get_vz(msg);
|
||||
hil_state_quaternion->ind_airspeed = mavlink_msg_hil_state_quaternion_get_ind_airspeed(msg);
|
||||
hil_state_quaternion->true_airspeed = mavlink_msg_hil_state_quaternion_get_true_airspeed(msg);
|
||||
hil_state_quaternion->xacc = mavlink_msg_hil_state_quaternion_get_xacc(msg);
|
||||
hil_state_quaternion->yacc = mavlink_msg_hil_state_quaternion_get_yacc(msg);
|
||||
hil_state_quaternion->zacc = mavlink_msg_hil_state_quaternion_get_zacc(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN? msg->len : MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN;
|
||||
memset(hil_state_quaternion, 0, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN);
|
||||
memcpy(hil_state_quaternion, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,455 @@
|
||||
#pragma once
|
||||
// MESSAGE HOME_POSITION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HOME_POSITION 242
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_home_position_t {
|
||||
int32_t latitude; /*< [degE7] Latitude (WGS84)*/
|
||||
int32_t longitude; /*< [degE7] Longitude (WGS84)*/
|
||||
int32_t altitude; /*< [mm] Altitude (AMSL). Positive for up.*/
|
||||
float x; /*< [m] Local X position of this position in the local coordinate frame*/
|
||||
float y; /*< [m] Local Y position of this position in the local coordinate frame*/
|
||||
float z; /*< [m] Local Z position of this position in the local coordinate frame*/
|
||||
float q[4]; /*< World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground*/
|
||||
float approach_x; /*< [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
|
||||
float approach_y; /*< [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
|
||||
float approach_z; /*< [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
}) mavlink_home_position_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HOME_POSITION_LEN 60
|
||||
#define MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN 52
|
||||
#define MAVLINK_MSG_ID_242_LEN 60
|
||||
#define MAVLINK_MSG_ID_242_MIN_LEN 52
|
||||
|
||||
#define MAVLINK_MSG_ID_HOME_POSITION_CRC 104
|
||||
#define MAVLINK_MSG_ID_242_CRC 104
|
||||
|
||||
#define MAVLINK_MSG_HOME_POSITION_FIELD_Q_LEN 4
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HOME_POSITION { \
|
||||
242, \
|
||||
"HOME_POSITION", \
|
||||
11, \
|
||||
{ { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_home_position_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_home_position_t, longitude) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_home_position_t, altitude) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_home_position_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_home_position_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_home_position_t, z) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_home_position_t, q) }, \
|
||||
{ "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_home_position_t, approach_x) }, \
|
||||
{ "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_home_position_t, approach_y) }, \
|
||||
{ "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_home_position_t, approach_z) }, \
|
||||
{ "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 52, offsetof(mavlink_home_position_t, time_usec) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_HOME_POSITION { \
|
||||
"HOME_POSITION", \
|
||||
11, \
|
||||
{ { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_home_position_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_home_position_t, longitude) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_home_position_t, altitude) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_home_position_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_home_position_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_home_position_t, z) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_home_position_t, q) }, \
|
||||
{ "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_home_position_t, approach_x) }, \
|
||||
{ "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_home_position_t, approach_y) }, \
|
||||
{ "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_home_position_t, approach_z) }, \
|
||||
{ "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 52, offsetof(mavlink_home_position_t, time_usec) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a home_position message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param latitude [degE7] Latitude (WGS84)
|
||||
* @param longitude [degE7] Longitude (WGS84)
|
||||
* @param altitude [mm] Altitude (AMSL). Positive for up.
|
||||
* @param x [m] Local X position of this position in the local coordinate frame
|
||||
* @param y [m] Local Y position of this position in the local coordinate frame
|
||||
* @param z [m] Local Z position of this position in the local coordinate frame
|
||||
* @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
|
||||
* @param approach_x [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
* @param approach_y [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
* @param approach_z [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z, uint64_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN];
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
_mav_put_float(buf, 12, x);
|
||||
_mav_put_float(buf, 16, y);
|
||||
_mav_put_float(buf, 20, z);
|
||||
_mav_put_float(buf, 40, approach_x);
|
||||
_mav_put_float(buf, 44, approach_y);
|
||||
_mav_put_float(buf, 48, approach_z);
|
||||
_mav_put_uint64_t(buf, 52, time_usec);
|
||||
_mav_put_float_array(buf, 24, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HOME_POSITION_LEN);
|
||||
#else
|
||||
mavlink_home_position_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.approach_x = approach_x;
|
||||
packet.approach_y = approach_y;
|
||||
packet.approach_z = approach_z;
|
||||
packet.time_usec = time_usec;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HOME_POSITION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HOME_POSITION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a home_position message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param latitude [degE7] Latitude (WGS84)
|
||||
* @param longitude [degE7] Longitude (WGS84)
|
||||
* @param altitude [mm] Altitude (AMSL). Positive for up.
|
||||
* @param x [m] Local X position of this position in the local coordinate frame
|
||||
* @param y [m] Local Y position of this position in the local coordinate frame
|
||||
* @param z [m] Local Z position of this position in the local coordinate frame
|
||||
* @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
|
||||
* @param approach_x [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
* @param approach_y [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
* @param approach_z [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
int32_t latitude,int32_t longitude,int32_t altitude,float x,float y,float z,const float *q,float approach_x,float approach_y,float approach_z,uint64_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN];
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
_mav_put_float(buf, 12, x);
|
||||
_mav_put_float(buf, 16, y);
|
||||
_mav_put_float(buf, 20, z);
|
||||
_mav_put_float(buf, 40, approach_x);
|
||||
_mav_put_float(buf, 44, approach_y);
|
||||
_mav_put_float(buf, 48, approach_z);
|
||||
_mav_put_uint64_t(buf, 52, time_usec);
|
||||
_mav_put_float_array(buf, 24, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HOME_POSITION_LEN);
|
||||
#else
|
||||
mavlink_home_position_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.approach_x = approach_x;
|
||||
packet.approach_y = approach_y;
|
||||
packet.approach_z = approach_z;
|
||||
packet.time_usec = time_usec;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HOME_POSITION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HOME_POSITION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a home_position struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param home_position C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_home_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_home_position_t* home_position)
|
||||
{
|
||||
return mavlink_msg_home_position_pack(system_id, component_id, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z, home_position->time_usec);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a home_position struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param home_position C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_home_position_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_home_position_t* home_position)
|
||||
{
|
||||
return mavlink_msg_home_position_pack_chan(system_id, component_id, chan, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z, home_position->time_usec);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a home_position message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param latitude [degE7] Latitude (WGS84)
|
||||
* @param longitude [degE7] Longitude (WGS84)
|
||||
* @param altitude [mm] Altitude (AMSL). Positive for up.
|
||||
* @param x [m] Local X position of this position in the local coordinate frame
|
||||
* @param y [m] Local Y position of this position in the local coordinate frame
|
||||
* @param z [m] Local Z position of this position in the local coordinate frame
|
||||
* @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
|
||||
* @param approach_x [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
* @param approach_y [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
* @param approach_z [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_home_position_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z, uint64_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN];
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
_mav_put_float(buf, 12, x);
|
||||
_mav_put_float(buf, 16, y);
|
||||
_mav_put_float(buf, 20, z);
|
||||
_mav_put_float(buf, 40, approach_x);
|
||||
_mav_put_float(buf, 44, approach_y);
|
||||
_mav_put_float(buf, 48, approach_z);
|
||||
_mav_put_uint64_t(buf, 52, time_usec);
|
||||
_mav_put_float_array(buf, 24, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
|
||||
#else
|
||||
mavlink_home_position_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.approach_x = approach_x;
|
||||
packet.approach_y = approach_y;
|
||||
packet.approach_z = approach_z;
|
||||
packet.time_usec = time_usec;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)&packet, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a home_position message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_home_position_send_struct(mavlink_channel_t chan, const mavlink_home_position_t* home_position)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_home_position_send(chan, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z, home_position->time_usec);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)home_position, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HOME_POSITION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_home_position_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z, uint64_t time_usec)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
_mav_put_float(buf, 12, x);
|
||||
_mav_put_float(buf, 16, y);
|
||||
_mav_put_float(buf, 20, z);
|
||||
_mav_put_float(buf, 40, approach_x);
|
||||
_mav_put_float(buf, 44, approach_y);
|
||||
_mav_put_float(buf, 48, approach_z);
|
||||
_mav_put_uint64_t(buf, 52, time_usec);
|
||||
_mav_put_float_array(buf, 24, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
|
||||
#else
|
||||
mavlink_home_position_t *packet = (mavlink_home_position_t *)msgbuf;
|
||||
packet->latitude = latitude;
|
||||
packet->longitude = longitude;
|
||||
packet->altitude = altitude;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->approach_x = approach_x;
|
||||
packet->approach_y = approach_y;
|
||||
packet->approach_z = approach_z;
|
||||
packet->time_usec = time_usec;
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)packet, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HOME_POSITION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field latitude from home_position message
|
||||
*
|
||||
* @return [degE7] Latitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_home_position_get_latitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field longitude from home_position message
|
||||
*
|
||||
* @return [degE7] Longitude (WGS84)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_home_position_get_longitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude from home_position message
|
||||
*
|
||||
* @return [mm] Altitude (AMSL). Positive for up.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_home_position_get_altitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from home_position message
|
||||
*
|
||||
* @return [m] Local X position of this position in the local coordinate frame
|
||||
*/
|
||||
static inline float mavlink_msg_home_position_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from home_position message
|
||||
*
|
||||
* @return [m] Local Y position of this position in the local coordinate frame
|
||||
*/
|
||||
static inline float mavlink_msg_home_position_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from home_position message
|
||||
*
|
||||
* @return [m] Local Z position of this position in the local coordinate frame
|
||||
*/
|
||||
static inline float mavlink_msg_home_position_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from home_position message
|
||||
*
|
||||
* @return World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_home_position_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field approach_x from home_position message
|
||||
*
|
||||
* @return [m] Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
*/
|
||||
static inline float mavlink_msg_home_position_get_approach_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field approach_y from home_position message
|
||||
*
|
||||
* @return [m] Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
*/
|
||||
static inline float mavlink_msg_home_position_get_approach_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field approach_z from home_position message
|
||||
*
|
||||
* @return [m] Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
|
||||
*/
|
||||
static inline float mavlink_msg_home_position_get_approach_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from home_position message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_home_position_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a home_position message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param home_position C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_home_position_decode(const mavlink_message_t* msg, mavlink_home_position_t* home_position)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
home_position->latitude = mavlink_msg_home_position_get_latitude(msg);
|
||||
home_position->longitude = mavlink_msg_home_position_get_longitude(msg);
|
||||
home_position->altitude = mavlink_msg_home_position_get_altitude(msg);
|
||||
home_position->x = mavlink_msg_home_position_get_x(msg);
|
||||
home_position->y = mavlink_msg_home_position_get_y(msg);
|
||||
home_position->z = mavlink_msg_home_position_get_z(msg);
|
||||
mavlink_msg_home_position_get_q(msg, home_position->q);
|
||||
home_position->approach_x = mavlink_msg_home_position_get_approach_x(msg);
|
||||
home_position->approach_y = mavlink_msg_home_position_get_approach_y(msg);
|
||||
home_position->approach_z = mavlink_msg_home_position_get_approach_z(msg);
|
||||
home_position->time_usec = mavlink_msg_home_position_get_time_usec(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HOME_POSITION_LEN? msg->len : MAVLINK_MSG_ID_HOME_POSITION_LEN;
|
||||
memset(home_position, 0, MAVLINK_MSG_ID_HOME_POSITION_LEN);
|
||||
memcpy(home_position, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,530 @@
|
||||
#pragma once
|
||||
// MESSAGE LANDING_TARGET PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LANDING_TARGET 149
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_landing_target_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float angle_x; /*< [rad] X-axis angular offset of the target from the center of the image*/
|
||||
float angle_y; /*< [rad] Y-axis angular offset of the target from the center of the image*/
|
||||
float distance; /*< [m] Distance to the target from the vehicle*/
|
||||
float size_x; /*< [rad] Size of target along x-axis*/
|
||||
float size_y; /*< [rad] Size of target along y-axis*/
|
||||
uint8_t target_num; /*< The ID of the target if multiple targets are present*/
|
||||
uint8_t frame; /*< Coordinate frame used for following fields.*/
|
||||
float x; /*< [m] X Position of the landing target on MAV_FRAME*/
|
||||
float y; /*< [m] Y Position of the landing target on MAV_FRAME*/
|
||||
float z; /*< [m] Z Position of the landing target on MAV_FRAME*/
|
||||
float q[4]; /*< Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
|
||||
uint8_t type; /*< Type of landing target*/
|
||||
uint8_t position_valid; /*< Boolean indicating known position (1) or default unknown position (0), for validation of positioning of the landing target*/
|
||||
}) mavlink_landing_target_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LANDING_TARGET_LEN 60
|
||||
#define MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN 30
|
||||
#define MAVLINK_MSG_ID_149_LEN 60
|
||||
#define MAVLINK_MSG_ID_149_MIN_LEN 30
|
||||
|
||||
#define MAVLINK_MSG_ID_LANDING_TARGET_CRC 200
|
||||
#define MAVLINK_MSG_ID_149_CRC 200
|
||||
|
||||
#define MAVLINK_MSG_LANDING_TARGET_FIELD_Q_LEN 4
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LANDING_TARGET { \
|
||||
149, \
|
||||
"LANDING_TARGET", \
|
||||
14, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \
|
||||
{ "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \
|
||||
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \
|
||||
{ "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, angle_x) }, \
|
||||
{ "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_landing_target_t, angle_y) }, \
|
||||
{ "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_landing_target_t, distance) }, \
|
||||
{ "size_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_landing_target_t, size_x) }, \
|
||||
{ "size_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_landing_target_t, size_y) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 30, offsetof(mavlink_landing_target_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 34, offsetof(mavlink_landing_target_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 38, offsetof(mavlink_landing_target_t, z) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 42, offsetof(mavlink_landing_target_t, q) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 58, offsetof(mavlink_landing_target_t, type) }, \
|
||||
{ "position_valid", NULL, MAVLINK_TYPE_UINT8_T, 0, 59, offsetof(mavlink_landing_target_t, position_valid) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LANDING_TARGET { \
|
||||
"LANDING_TARGET", \
|
||||
14, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \
|
||||
{ "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \
|
||||
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \
|
||||
{ "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, angle_x) }, \
|
||||
{ "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_landing_target_t, angle_y) }, \
|
||||
{ "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_landing_target_t, distance) }, \
|
||||
{ "size_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_landing_target_t, size_x) }, \
|
||||
{ "size_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_landing_target_t, size_y) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 30, offsetof(mavlink_landing_target_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 34, offsetof(mavlink_landing_target_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 38, offsetof(mavlink_landing_target_t, z) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 42, offsetof(mavlink_landing_target_t, q) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 58, offsetof(mavlink_landing_target_t, type) }, \
|
||||
{ "position_valid", NULL, MAVLINK_TYPE_UINT8_T, 0, 59, offsetof(mavlink_landing_target_t, position_valid) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a landing_target message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param target_num The ID of the target if multiple targets are present
|
||||
* @param frame Coordinate frame used for following fields.
|
||||
* @param angle_x [rad] X-axis angular offset of the target from the center of the image
|
||||
* @param angle_y [rad] Y-axis angular offset of the target from the center of the image
|
||||
* @param distance [m] Distance to the target from the vehicle
|
||||
* @param size_x [rad] Size of target along x-axis
|
||||
* @param size_y [rad] Size of target along y-axis
|
||||
* @param x [m] X Position of the landing target on MAV_FRAME
|
||||
* @param y [m] Y Position of the landing target on MAV_FRAME
|
||||
* @param z [m] Z Position of the landing target on MAV_FRAME
|
||||
* @param q Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param type Type of landing target
|
||||
* @param position_valid Boolean indicating known position (1) or default unknown position (0), for validation of positioning of the landing target
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_landing_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y, float x, float y, float z, const float *q, uint8_t type, uint8_t position_valid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, angle_x);
|
||||
_mav_put_float(buf, 12, angle_y);
|
||||
_mav_put_float(buf, 16, distance);
|
||||
_mav_put_float(buf, 20, size_x);
|
||||
_mav_put_float(buf, 24, size_y);
|
||||
_mav_put_uint8_t(buf, 28, target_num);
|
||||
_mav_put_uint8_t(buf, 29, frame);
|
||||
_mav_put_float(buf, 30, x);
|
||||
_mav_put_float(buf, 34, y);
|
||||
_mav_put_float(buf, 38, z);
|
||||
_mav_put_uint8_t(buf, 58, type);
|
||||
_mav_put_uint8_t(buf, 59, position_valid);
|
||||
_mav_put_float_array(buf, 42, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
|
||||
#else
|
||||
mavlink_landing_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.angle_x = angle_x;
|
||||
packet.angle_y = angle_y;
|
||||
packet.distance = distance;
|
||||
packet.size_x = size_x;
|
||||
packet.size_y = size_y;
|
||||
packet.target_num = target_num;
|
||||
packet.frame = frame;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.type = type;
|
||||
packet.position_valid = position_valid;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LANDING_TARGET;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a landing_target message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param target_num The ID of the target if multiple targets are present
|
||||
* @param frame Coordinate frame used for following fields.
|
||||
* @param angle_x [rad] X-axis angular offset of the target from the center of the image
|
||||
* @param angle_y [rad] Y-axis angular offset of the target from the center of the image
|
||||
* @param distance [m] Distance to the target from the vehicle
|
||||
* @param size_x [rad] Size of target along x-axis
|
||||
* @param size_y [rad] Size of target along y-axis
|
||||
* @param x [m] X Position of the landing target on MAV_FRAME
|
||||
* @param y [m] Y Position of the landing target on MAV_FRAME
|
||||
* @param z [m] Z Position of the landing target on MAV_FRAME
|
||||
* @param q Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param type Type of landing target
|
||||
* @param position_valid Boolean indicating known position (1) or default unknown position (0), for validation of positioning of the landing target
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_landing_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t target_num,uint8_t frame,float angle_x,float angle_y,float distance,float size_x,float size_y,float x,float y,float z,const float *q,uint8_t type,uint8_t position_valid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, angle_x);
|
||||
_mav_put_float(buf, 12, angle_y);
|
||||
_mav_put_float(buf, 16, distance);
|
||||
_mav_put_float(buf, 20, size_x);
|
||||
_mav_put_float(buf, 24, size_y);
|
||||
_mav_put_uint8_t(buf, 28, target_num);
|
||||
_mav_put_uint8_t(buf, 29, frame);
|
||||
_mav_put_float(buf, 30, x);
|
||||
_mav_put_float(buf, 34, y);
|
||||
_mav_put_float(buf, 38, z);
|
||||
_mav_put_uint8_t(buf, 58, type);
|
||||
_mav_put_uint8_t(buf, 59, position_valid);
|
||||
_mav_put_float_array(buf, 42, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
|
||||
#else
|
||||
mavlink_landing_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.angle_x = angle_x;
|
||||
packet.angle_y = angle_y;
|
||||
packet.distance = distance;
|
||||
packet.size_x = size_x;
|
||||
packet.size_y = size_y;
|
||||
packet.target_num = target_num;
|
||||
packet.frame = frame;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.type = type;
|
||||
packet.position_valid = position_valid;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LANDING_TARGET;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a landing_target struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param landing_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_landing_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_landing_target_t* landing_target)
|
||||
{
|
||||
return mavlink_msg_landing_target_pack(system_id, component_id, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y, landing_target->x, landing_target->y, landing_target->z, landing_target->q, landing_target->type, landing_target->position_valid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a landing_target struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param landing_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_landing_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_landing_target_t* landing_target)
|
||||
{
|
||||
return mavlink_msg_landing_target_pack_chan(system_id, component_id, chan, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y, landing_target->x, landing_target->y, landing_target->z, landing_target->q, landing_target->type, landing_target->position_valid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a landing_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param target_num The ID of the target if multiple targets are present
|
||||
* @param frame Coordinate frame used for following fields.
|
||||
* @param angle_x [rad] X-axis angular offset of the target from the center of the image
|
||||
* @param angle_y [rad] Y-axis angular offset of the target from the center of the image
|
||||
* @param distance [m] Distance to the target from the vehicle
|
||||
* @param size_x [rad] Size of target along x-axis
|
||||
* @param size_y [rad] Size of target along y-axis
|
||||
* @param x [m] X Position of the landing target on MAV_FRAME
|
||||
* @param y [m] Y Position of the landing target on MAV_FRAME
|
||||
* @param z [m] Z Position of the landing target on MAV_FRAME
|
||||
* @param q Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param type Type of landing target
|
||||
* @param position_valid Boolean indicating known position (1) or default unknown position (0), for validation of positioning of the landing target
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_landing_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y, float x, float y, float z, const float *q, uint8_t type, uint8_t position_valid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, angle_x);
|
||||
_mav_put_float(buf, 12, angle_y);
|
||||
_mav_put_float(buf, 16, distance);
|
||||
_mav_put_float(buf, 20, size_x);
|
||||
_mav_put_float(buf, 24, size_y);
|
||||
_mav_put_uint8_t(buf, 28, target_num);
|
||||
_mav_put_uint8_t(buf, 29, frame);
|
||||
_mav_put_float(buf, 30, x);
|
||||
_mav_put_float(buf, 34, y);
|
||||
_mav_put_float(buf, 38, z);
|
||||
_mav_put_uint8_t(buf, 58, type);
|
||||
_mav_put_uint8_t(buf, 59, position_valid);
|
||||
_mav_put_float_array(buf, 42, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
|
||||
#else
|
||||
mavlink_landing_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.angle_x = angle_x;
|
||||
packet.angle_y = angle_y;
|
||||
packet.distance = distance;
|
||||
packet.size_x = size_x;
|
||||
packet.size_y = size_y;
|
||||
packet.target_num = target_num;
|
||||
packet.frame = frame;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.type = type;
|
||||
packet.position_valid = position_valid;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)&packet, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a landing_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_landing_target_send_struct(mavlink_channel_t chan, const mavlink_landing_target_t* landing_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_landing_target_send(chan, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y, landing_target->x, landing_target->y, landing_target->z, landing_target->q, landing_target->type, landing_target->position_valid);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)landing_target, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LANDING_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_landing_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y, float x, float y, float z, const float *q, uint8_t type, uint8_t position_valid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, angle_x);
|
||||
_mav_put_float(buf, 12, angle_y);
|
||||
_mav_put_float(buf, 16, distance);
|
||||
_mav_put_float(buf, 20, size_x);
|
||||
_mav_put_float(buf, 24, size_y);
|
||||
_mav_put_uint8_t(buf, 28, target_num);
|
||||
_mav_put_uint8_t(buf, 29, frame);
|
||||
_mav_put_float(buf, 30, x);
|
||||
_mav_put_float(buf, 34, y);
|
||||
_mav_put_float(buf, 38, z);
|
||||
_mav_put_uint8_t(buf, 58, type);
|
||||
_mav_put_uint8_t(buf, 59, position_valid);
|
||||
_mav_put_float_array(buf, 42, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
|
||||
#else
|
||||
mavlink_landing_target_t *packet = (mavlink_landing_target_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->angle_x = angle_x;
|
||||
packet->angle_y = angle_y;
|
||||
packet->distance = distance;
|
||||
packet->size_x = size_x;
|
||||
packet->size_y = size_y;
|
||||
packet->target_num = target_num;
|
||||
packet->frame = frame;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->type = type;
|
||||
packet->position_valid = position_valid;
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)packet, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LANDING_TARGET UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from landing_target message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_landing_target_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_num from landing_target message
|
||||
*
|
||||
* @return The ID of the target if multiple targets are present
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_landing_target_get_target_num(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field frame from landing_target message
|
||||
*
|
||||
* @return Coordinate frame used for following fields.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_landing_target_get_frame(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 29);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field angle_x from landing_target message
|
||||
*
|
||||
* @return [rad] X-axis angular offset of the target from the center of the image
|
||||
*/
|
||||
static inline float mavlink_msg_landing_target_get_angle_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field angle_y from landing_target message
|
||||
*
|
||||
* @return [rad] Y-axis angular offset of the target from the center of the image
|
||||
*/
|
||||
static inline float mavlink_msg_landing_target_get_angle_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field distance from landing_target message
|
||||
*
|
||||
* @return [m] Distance to the target from the vehicle
|
||||
*/
|
||||
static inline float mavlink_msg_landing_target_get_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field size_x from landing_target message
|
||||
*
|
||||
* @return [rad] Size of target along x-axis
|
||||
*/
|
||||
static inline float mavlink_msg_landing_target_get_size_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field size_y from landing_target message
|
||||
*
|
||||
* @return [rad] Size of target along y-axis
|
||||
*/
|
||||
static inline float mavlink_msg_landing_target_get_size_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from landing_target message
|
||||
*
|
||||
* @return [m] X Position of the landing target on MAV_FRAME
|
||||
*/
|
||||
static inline float mavlink_msg_landing_target_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from landing_target message
|
||||
*
|
||||
* @return [m] Y Position of the landing target on MAV_FRAME
|
||||
*/
|
||||
static inline float mavlink_msg_landing_target_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from landing_target message
|
||||
*
|
||||
* @return [m] Z Position of the landing target on MAV_FRAME
|
||||
*/
|
||||
static inline float mavlink_msg_landing_target_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 38);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from landing_target message
|
||||
*
|
||||
* @return Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_landing_target_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 42);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field type from landing_target message
|
||||
*
|
||||
* @return Type of landing target
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_landing_target_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 58);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field position_valid from landing_target message
|
||||
*
|
||||
* @return Boolean indicating known position (1) or default unknown position (0), for validation of positioning of the landing target
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_landing_target_get_position_valid(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 59);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a landing_target message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param landing_target C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_landing_target_decode(const mavlink_message_t* msg, mavlink_landing_target_t* landing_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
landing_target->time_usec = mavlink_msg_landing_target_get_time_usec(msg);
|
||||
landing_target->angle_x = mavlink_msg_landing_target_get_angle_x(msg);
|
||||
landing_target->angle_y = mavlink_msg_landing_target_get_angle_y(msg);
|
||||
landing_target->distance = mavlink_msg_landing_target_get_distance(msg);
|
||||
landing_target->size_x = mavlink_msg_landing_target_get_size_x(msg);
|
||||
landing_target->size_y = mavlink_msg_landing_target_get_size_y(msg);
|
||||
landing_target->target_num = mavlink_msg_landing_target_get_target_num(msg);
|
||||
landing_target->frame = mavlink_msg_landing_target_get_frame(msg);
|
||||
landing_target->x = mavlink_msg_landing_target_get_x(msg);
|
||||
landing_target->y = mavlink_msg_landing_target_get_y(msg);
|
||||
landing_target->z = mavlink_msg_landing_target_get_z(msg);
|
||||
mavlink_msg_landing_target_get_q(msg, landing_target->q);
|
||||
landing_target->type = mavlink_msg_landing_target_get_type(msg);
|
||||
landing_target->position_valid = mavlink_msg_landing_target_get_position_valid(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LANDING_TARGET_LEN? msg->len : MAVLINK_MSG_ID_LANDING_TARGET_LEN;
|
||||
memset(landing_target, 0, MAVLINK_MSG_ID_LANDING_TARGET_LEN);
|
||||
memcpy(landing_target, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
#pragma once
|
||||
// MESSAGE LOCAL_POSITION_NED PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED 32
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_local_position_ned_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
float x; /*< [m] X Position*/
|
||||
float y; /*< [m] Y Position*/
|
||||
float z; /*< [m] Z Position*/
|
||||
float vx; /*< [m/s] X Speed*/
|
||||
float vy; /*< [m/s] Y Speed*/
|
||||
float vz; /*< [m/s] Z Speed*/
|
||||
}) mavlink_local_position_ned_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN 28
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN 28
|
||||
#define MAVLINK_MSG_ID_32_LEN 28
|
||||
#define MAVLINK_MSG_ID_32_MIN_LEN 28
|
||||
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC 185
|
||||
#define MAVLINK_MSG_ID_32_CRC 185
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED { \
|
||||
32, \
|
||||
"LOCAL_POSITION_NED", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_t, time_boot_ms) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_t, z) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_t, vz) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED { \
|
||||
"LOCAL_POSITION_NED", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_t, time_boot_ms) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_t, z) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_t, vz) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a local_position_ned message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param vx [m/s] X Speed
|
||||
* @param vy [m/s] Y Speed
|
||||
* @param vz [m/s] Z Speed
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, vx);
|
||||
_mav_put_float(buf, 20, vy);
|
||||
_mav_put_float(buf, 24, vz);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
|
||||
#else
|
||||
mavlink_local_position_ned_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a local_position_ned message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param vx [m/s] X Speed
|
||||
* @param vy [m/s] Y Speed
|
||||
* @param vz [m/s] Z Speed
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,float x,float y,float z,float vx,float vy,float vz)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, vx);
|
||||
_mav_put_float(buf, 20, vy);
|
||||
_mav_put_float(buf, 24, vz);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
|
||||
#else
|
||||
mavlink_local_position_ned_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a local_position_ned struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param local_position_ned C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_t* local_position_ned)
|
||||
{
|
||||
return mavlink_msg_local_position_ned_pack(system_id, component_id, msg, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a local_position_ned struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param local_position_ned C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_position_ned_t* local_position_ned)
|
||||
{
|
||||
return mavlink_msg_local_position_ned_pack_chan(system_id, component_id, chan, msg, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a local_position_ned message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param vx [m/s] X Speed
|
||||
* @param vy [m/s] Y Speed
|
||||
* @param vz [m/s] Z Speed
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_local_position_ned_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, vx);
|
||||
_mav_put_float(buf, 20, vy);
|
||||
_mav_put_float(buf, 24, vz);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
|
||||
#else
|
||||
mavlink_local_position_ned_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a local_position_ned message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_local_position_ned_send_struct(mavlink_channel_t chan, const mavlink_local_position_ned_t* local_position_ned)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_local_position_ned_send(chan, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)local_position_ned, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_local_position_ned_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, vx);
|
||||
_mav_put_float(buf, 20, vy);
|
||||
_mav_put_float(buf, 24, vz);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
|
||||
#else
|
||||
mavlink_local_position_ned_t *packet = (mavlink_local_position_ned_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->vx = vx;
|
||||
packet->vy = vy;
|
||||
packet->vz = vz;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOCAL_POSITION_NED UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from local_position_ned message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_local_position_ned_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from local_position_ned message
|
||||
*
|
||||
* @return [m] X Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from local_position_ned message
|
||||
*
|
||||
* @return [m] Y Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from local_position_ned message
|
||||
*
|
||||
* @return [m] Z Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vx from local_position_ned message
|
||||
*
|
||||
* @return [m/s] X Speed
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_get_vx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vy from local_position_ned message
|
||||
*
|
||||
* @return [m/s] Y Speed
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_get_vy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vz from local_position_ned message
|
||||
*
|
||||
* @return [m/s] Z Speed
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_get_vz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a local_position_ned message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param local_position_ned C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_local_position_ned_decode(const mavlink_message_t* msg, mavlink_local_position_ned_t* local_position_ned)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
local_position_ned->time_boot_ms = mavlink_msg_local_position_ned_get_time_boot_ms(msg);
|
||||
local_position_ned->x = mavlink_msg_local_position_ned_get_x(msg);
|
||||
local_position_ned->y = mavlink_msg_local_position_ned_get_y(msg);
|
||||
local_position_ned->z = mavlink_msg_local_position_ned_get_z(msg);
|
||||
local_position_ned->vx = mavlink_msg_local_position_ned_get_vx(msg);
|
||||
local_position_ned->vy = mavlink_msg_local_position_ned_get_vy(msg);
|
||||
local_position_ned->vz = mavlink_msg_local_position_ned_get_vz(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN? msg->len : MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN;
|
||||
memset(local_position_ned, 0, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
|
||||
memcpy(local_position_ned, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,480 @@
|
||||
#pragma once
|
||||
// MESSAGE LOCAL_POSITION_NED_COV PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV 64
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_local_position_ned_cov_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float x; /*< [m] X Position*/
|
||||
float y; /*< [m] Y Position*/
|
||||
float z; /*< [m] Z Position*/
|
||||
float vx; /*< [m/s] X Speed*/
|
||||
float vy; /*< [m/s] Y Speed*/
|
||||
float vz; /*< [m/s] Z Speed*/
|
||||
float ax; /*< [m/s/s] X Acceleration*/
|
||||
float ay; /*< [m/s/s] Y Acceleration*/
|
||||
float az; /*< [m/s/s] Z Acceleration*/
|
||||
float covariance[45]; /*< Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)*/
|
||||
uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/
|
||||
}) mavlink_local_position_ned_cov_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN 225
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN 225
|
||||
#define MAVLINK_MSG_ID_64_LEN 225
|
||||
#define MAVLINK_MSG_ID_64_MIN_LEN 225
|
||||
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC 191
|
||||
#define MAVLINK_MSG_ID_64_CRC 191
|
||||
|
||||
#define MAVLINK_MSG_LOCAL_POSITION_NED_COV_FIELD_COVARIANCE_LEN 45
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV { \
|
||||
64, \
|
||||
"LOCAL_POSITION_NED_COV", \
|
||||
12, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_usec) }, \
|
||||
{ "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 224, offsetof(mavlink_local_position_ned_cov_t, estimator_type) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_cov_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_cov_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_cov_t, z) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_cov_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_cov_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_local_position_ned_cov_t, vz) }, \
|
||||
{ "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_local_position_ned_cov_t, ax) }, \
|
||||
{ "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_local_position_ned_cov_t, ay) }, \
|
||||
{ "az", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_local_position_ned_cov_t, az) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 45, 44, offsetof(mavlink_local_position_ned_cov_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV { \
|
||||
"LOCAL_POSITION_NED_COV", \
|
||||
12, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_usec) }, \
|
||||
{ "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 224, offsetof(mavlink_local_position_ned_cov_t, estimator_type) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_cov_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_cov_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_cov_t, z) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_cov_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_cov_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_local_position_ned_cov_t, vz) }, \
|
||||
{ "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_local_position_ned_cov_t, ax) }, \
|
||||
{ "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_local_position_ned_cov_t, ay) }, \
|
||||
{ "az", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_local_position_ned_cov_t, az) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 45, 44, offsetof(mavlink_local_position_ned_cov_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a local_position_ned_cov message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param estimator_type Class id of the estimator this estimate originated from.
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param vx [m/s] X Speed
|
||||
* @param vy [m/s] Y Speed
|
||||
* @param vz [m/s] Z Speed
|
||||
* @param ax [m/s/s] X Acceleration
|
||||
* @param ay [m/s/s] Y Acceleration
|
||||
* @param az [m/s/s] Z Acceleration
|
||||
* @param covariance Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, vx);
|
||||
_mav_put_float(buf, 24, vy);
|
||||
_mav_put_float(buf, 28, vz);
|
||||
_mav_put_float(buf, 32, ax);
|
||||
_mav_put_float(buf, 36, ay);
|
||||
_mav_put_float(buf, 40, az);
|
||||
_mav_put_uint8_t(buf, 224, estimator_type);
|
||||
_mav_put_float_array(buf, 44, covariance, 45);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
|
||||
#else
|
||||
mavlink_local_position_ned_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.ax = ax;
|
||||
packet.ay = ay;
|
||||
packet.az = az;
|
||||
packet.estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a local_position_ned_cov message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param estimator_type Class id of the estimator this estimate originated from.
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param vx [m/s] X Speed
|
||||
* @param vy [m/s] Y Speed
|
||||
* @param vz [m/s] Z Speed
|
||||
* @param ax [m/s/s] X Acceleration
|
||||
* @param ay [m/s/s] Y Acceleration
|
||||
* @param az [m/s/s] Z Acceleration
|
||||
* @param covariance Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t estimator_type,float x,float y,float z,float vx,float vy,float vz,float ax,float ay,float az,const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, vx);
|
||||
_mav_put_float(buf, 24, vy);
|
||||
_mav_put_float(buf, 28, vz);
|
||||
_mav_put_float(buf, 32, ax);
|
||||
_mav_put_float(buf, 36, ay);
|
||||
_mav_put_float(buf, 40, az);
|
||||
_mav_put_uint8_t(buf, 224, estimator_type);
|
||||
_mav_put_float_array(buf, 44, covariance, 45);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
|
||||
#else
|
||||
mavlink_local_position_ned_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.ax = ax;
|
||||
packet.ay = ay;
|
||||
packet.az = az;
|
||||
packet.estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a local_position_ned_cov struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param local_position_ned_cov C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_cov_t* local_position_ned_cov)
|
||||
{
|
||||
return mavlink_msg_local_position_ned_cov_pack(system_id, component_id, msg, local_position_ned_cov->time_usec, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a local_position_ned_cov struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param local_position_ned_cov C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_position_ned_cov_t* local_position_ned_cov)
|
||||
{
|
||||
return mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, chan, msg, local_position_ned_cov->time_usec, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a local_position_ned_cov message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param estimator_type Class id of the estimator this estimate originated from.
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param vx [m/s] X Speed
|
||||
* @param vy [m/s] Y Speed
|
||||
* @param vz [m/s] Z Speed
|
||||
* @param ax [m/s/s] X Acceleration
|
||||
* @param ay [m/s/s] Y Acceleration
|
||||
* @param az [m/s/s] Z Acceleration
|
||||
* @param covariance Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_local_position_ned_cov_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, vx);
|
||||
_mav_put_float(buf, 24, vy);
|
||||
_mav_put_float(buf, 28, vz);
|
||||
_mav_put_float(buf, 32, ax);
|
||||
_mav_put_float(buf, 36, ay);
|
||||
_mav_put_float(buf, 40, az);
|
||||
_mav_put_uint8_t(buf, 224, estimator_type);
|
||||
_mav_put_float_array(buf, 44, covariance, 45);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
|
||||
#else
|
||||
mavlink_local_position_ned_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.ax = ax;
|
||||
packet.ay = ay;
|
||||
packet.az = az;
|
||||
packet.estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a local_position_ned_cov message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_local_position_ned_cov_send_struct(mavlink_channel_t chan, const mavlink_local_position_ned_cov_t* local_position_ned_cov)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_local_position_ned_cov_send(chan, local_position_ned_cov->time_usec, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)local_position_ned_cov, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_local_position_ned_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, vx);
|
||||
_mav_put_float(buf, 24, vy);
|
||||
_mav_put_float(buf, 28, vz);
|
||||
_mav_put_float(buf, 32, ax);
|
||||
_mav_put_float(buf, 36, ay);
|
||||
_mav_put_float(buf, 40, az);
|
||||
_mav_put_uint8_t(buf, 224, estimator_type);
|
||||
_mav_put_float_array(buf, 44, covariance, 45);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
|
||||
#else
|
||||
mavlink_local_position_ned_cov_t *packet = (mavlink_local_position_ned_cov_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->vx = vx;
|
||||
packet->vy = vy;
|
||||
packet->vz = vz;
|
||||
packet->ax = ax;
|
||||
packet->ay = ay;
|
||||
packet->az = az;
|
||||
packet->estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet->covariance, covariance, sizeof(float)*45);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOCAL_POSITION_NED_COV UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from local_position_ned_cov message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_local_position_ned_cov_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field estimator_type from local_position_ned_cov message
|
||||
*
|
||||
* @return Class id of the estimator this estimate originated from.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_local_position_ned_cov_get_estimator_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 224);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from local_position_ned_cov message
|
||||
*
|
||||
* @return [m] X Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_cov_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from local_position_ned_cov message
|
||||
*
|
||||
* @return [m] Y Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_cov_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from local_position_ned_cov message
|
||||
*
|
||||
* @return [m] Z Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_cov_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vx from local_position_ned_cov message
|
||||
*
|
||||
* @return [m/s] X Speed
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_cov_get_vx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vy from local_position_ned_cov message
|
||||
*
|
||||
* @return [m/s] Y Speed
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_cov_get_vy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vz from local_position_ned_cov message
|
||||
*
|
||||
* @return [m/s] Z Speed
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_cov_get_vz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ax from local_position_ned_cov message
|
||||
*
|
||||
* @return [m/s/s] X Acceleration
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_cov_get_ax(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ay from local_position_ned_cov message
|
||||
*
|
||||
* @return [m/s/s] Y Acceleration
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_cov_get_ay(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field az from local_position_ned_cov message
|
||||
*
|
||||
* @return [m/s/s] Z Acceleration
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_cov_get_az(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field covariance from local_position_ned_cov message
|
||||
*
|
||||
* @return Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, covariance, 45, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a local_position_ned_cov message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param local_position_ned_cov C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_local_position_ned_cov_decode(const mavlink_message_t* msg, mavlink_local_position_ned_cov_t* local_position_ned_cov)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
local_position_ned_cov->time_usec = mavlink_msg_local_position_ned_cov_get_time_usec(msg);
|
||||
local_position_ned_cov->x = mavlink_msg_local_position_ned_cov_get_x(msg);
|
||||
local_position_ned_cov->y = mavlink_msg_local_position_ned_cov_get_y(msg);
|
||||
local_position_ned_cov->z = mavlink_msg_local_position_ned_cov_get_z(msg);
|
||||
local_position_ned_cov->vx = mavlink_msg_local_position_ned_cov_get_vx(msg);
|
||||
local_position_ned_cov->vy = mavlink_msg_local_position_ned_cov_get_vy(msg);
|
||||
local_position_ned_cov->vz = mavlink_msg_local_position_ned_cov_get_vz(msg);
|
||||
local_position_ned_cov->ax = mavlink_msg_local_position_ned_cov_get_ax(msg);
|
||||
local_position_ned_cov->ay = mavlink_msg_local_position_ned_cov_get_ay(msg);
|
||||
local_position_ned_cov->az = mavlink_msg_local_position_ned_cov_get_az(msg);
|
||||
mavlink_msg_local_position_ned_cov_get_covariance(msg, local_position_ned_cov->covariance);
|
||||
local_position_ned_cov->estimator_type = mavlink_msg_local_position_ned_cov_get_estimator_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN? msg->len : MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN;
|
||||
memset(local_position_ned_cov, 0, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN);
|
||||
memcpy(local_position_ned_cov, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
#pragma once
|
||||
// MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET 89
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_local_position_ned_system_global_offset_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
float x; /*< [m] X Position*/
|
||||
float y; /*< [m] Y Position*/
|
||||
float z; /*< [m] Z Position*/
|
||||
float roll; /*< [rad] Roll*/
|
||||
float pitch; /*< [rad] Pitch*/
|
||||
float yaw; /*< [rad] Yaw*/
|
||||
}) mavlink_local_position_ned_system_global_offset_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN 28
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN 28
|
||||
#define MAVLINK_MSG_ID_89_LEN 28
|
||||
#define MAVLINK_MSG_ID_89_MIN_LEN 28
|
||||
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC 231
|
||||
#define MAVLINK_MSG_ID_89_CRC 231
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET { \
|
||||
89, \
|
||||
"LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_system_global_offset_t, time_boot_ms) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_system_global_offset_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_system_global_offset_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_system_global_offset_t, z) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_system_global_offset_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_system_global_offset_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_system_global_offset_t, yaw) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET { \
|
||||
"LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_system_global_offset_t, time_boot_ms) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_system_global_offset_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_system_global_offset_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_system_global_offset_t, z) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_system_global_offset_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_system_global_offset_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_system_global_offset_t, yaw) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a local_position_ned_system_global_offset message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param roll [rad] Roll
|
||||
* @param pitch [rad] Pitch
|
||||
* @param yaw [rad] Yaw
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, roll);
|
||||
_mav_put_float(buf, 20, pitch);
|
||||
_mav_put_float(buf, 24, yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN);
|
||||
#else
|
||||
mavlink_local_position_ned_system_global_offset_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a local_position_ned_system_global_offset message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param roll [rad] Roll
|
||||
* @param pitch [rad] Pitch
|
||||
* @param yaw [rad] Yaw
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,float x,float y,float z,float roll,float pitch,float yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, roll);
|
||||
_mav_put_float(buf, 20, pitch);
|
||||
_mav_put_float(buf, 24, yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN);
|
||||
#else
|
||||
mavlink_local_position_ned_system_global_offset_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a local_position_ned_system_global_offset struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param local_position_ned_system_global_offset C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
|
||||
{
|
||||
return mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, msg, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a local_position_ned_system_global_offset struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param local_position_ned_system_global_offset C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
|
||||
{
|
||||
return mavlink_msg_local_position_ned_system_global_offset_pack_chan(system_id, component_id, chan, msg, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a local_position_ned_system_global_offset message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param roll [rad] Roll
|
||||
* @param pitch [rad] Pitch
|
||||
* @param yaw [rad] Yaw
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_local_position_ned_system_global_offset_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, roll);
|
||||
_mav_put_float(buf, 20, pitch);
|
||||
_mav_put_float(buf, 24, yaw);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
|
||||
#else
|
||||
mavlink_local_position_ned_system_global_offset_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a local_position_ned_system_global_offset message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_local_position_ned_system_global_offset_send_struct(mavlink_channel_t chan, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_local_position_ned_system_global_offset_send(chan, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)local_position_ned_system_global_offset, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_local_position_ned_system_global_offset_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, roll);
|
||||
_mav_put_float(buf, 20, pitch);
|
||||
_mav_put_float(buf, 24, yaw);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
|
||||
#else
|
||||
mavlink_local_position_ned_system_global_offset_t *packet = (mavlink_local_position_ned_system_global_offset_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->roll = roll;
|
||||
packet->pitch = pitch;
|
||||
packet->yaw = yaw;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return [m] X Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return [m] Y Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return [m] Z Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return [rad] Roll
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return [rad] Pitch
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return [rad] Yaw
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a local_position_ned_system_global_offset message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param local_position_ned_system_global_offset C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_local_position_ned_system_global_offset_decode(const mavlink_message_t* msg, mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
local_position_ned_system_global_offset->time_boot_ms = mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(msg);
|
||||
local_position_ned_system_global_offset->x = mavlink_msg_local_position_ned_system_global_offset_get_x(msg);
|
||||
local_position_ned_system_global_offset->y = mavlink_msg_local_position_ned_system_global_offset_get_y(msg);
|
||||
local_position_ned_system_global_offset->z = mavlink_msg_local_position_ned_system_global_offset_get_z(msg);
|
||||
local_position_ned_system_global_offset->roll = mavlink_msg_local_position_ned_system_global_offset_get_roll(msg);
|
||||
local_position_ned_system_global_offset->pitch = mavlink_msg_local_position_ned_system_global_offset_get_pitch(msg);
|
||||
local_position_ned_system_global_offset->yaw = mavlink_msg_local_position_ned_system_global_offset_get_yaw(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN? msg->len : MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN;
|
||||
memset(local_position_ned_system_global_offset, 0, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN);
|
||||
memcpy(local_position_ned_system_global_offset, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
#pragma once
|
||||
// MESSAGE LOG_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_DATA 120
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_log_data_t {
|
||||
uint32_t ofs; /*< Offset into the log*/
|
||||
uint16_t id; /*< Log id (from LOG_ENTRY reply)*/
|
||||
uint8_t count; /*< [bytes] Number of bytes (zero for end of log)*/
|
||||
uint8_t data[90]; /*< log data*/
|
||||
}) mavlink_log_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_DATA_LEN 97
|
||||
#define MAVLINK_MSG_ID_LOG_DATA_MIN_LEN 97
|
||||
#define MAVLINK_MSG_ID_120_LEN 97
|
||||
#define MAVLINK_MSG_ID_120_MIN_LEN 97
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_DATA_CRC 134
|
||||
#define MAVLINK_MSG_ID_120_CRC 134
|
||||
|
||||
#define MAVLINK_MSG_LOG_DATA_FIELD_DATA_LEN 90
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_DATA { \
|
||||
120, \
|
||||
"LOG_DATA", \
|
||||
4, \
|
||||
{ { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_log_data_t, id) }, \
|
||||
{ "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_log_data_t, count) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 90, 7, offsetof(mavlink_log_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_DATA { \
|
||||
"LOG_DATA", \
|
||||
4, \
|
||||
{ { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_log_data_t, id) }, \
|
||||
{ "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_log_data_t, count) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 90, 7, offsetof(mavlink_log_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a log_data message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count [bytes] Number of bytes (zero for end of log)
|
||||
* @param data log data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint16_t(buf, 4, id);
|
||||
_mav_put_uint8_t(buf, 6, count);
|
||||
_mav_put_uint8_t_array(buf, 7, data, 90);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#else
|
||||
mavlink_log_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.id = id;
|
||||
packet.count = count;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_DATA;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count [bytes] Number of bytes (zero for end of log)
|
||||
* @param data log data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t id,uint32_t ofs,uint8_t count,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint16_t(buf, 4, id);
|
||||
_mav_put_uint8_t(buf, 6, count);
|
||||
_mav_put_uint8_t_array(buf, 7, data, 90);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#else
|
||||
mavlink_log_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.id = id;
|
||||
packet.count = count;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_DATA;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_data_t* log_data)
|
||||
{
|
||||
return mavlink_msg_log_data_pack(system_id, component_id, msg, log_data->id, log_data->ofs, log_data->count, log_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_data_t* log_data)
|
||||
{
|
||||
return mavlink_msg_log_data_pack_chan(system_id, component_id, chan, msg, log_data->id, log_data->ofs, log_data->count, log_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count [bytes] Number of bytes (zero for end of log)
|
||||
* @param data log data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_data_send(mavlink_channel_t chan, uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint16_t(buf, 4, id);
|
||||
_mav_put_uint8_t(buf, 6, count);
|
||||
_mav_put_uint8_t_array(buf, 7, data, 90);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
|
||||
#else
|
||||
mavlink_log_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.id = id;
|
||||
packet.count = count;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_log_data_send_struct(mavlink_channel_t chan, const mavlink_log_data_t* log_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_log_data_send(chan, log_data->id, log_data->ofs, log_data->count, log_data->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)log_data, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOG_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_log_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint16_t(buf, 4, id);
|
||||
_mav_put_uint8_t(buf, 6, count);
|
||||
_mav_put_uint8_t_array(buf, 7, data, 90);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
|
||||
#else
|
||||
mavlink_log_data_t *packet = (mavlink_log_data_t *)msgbuf;
|
||||
packet->ofs = ofs;
|
||||
packet->id = id;
|
||||
packet->count = count;
|
||||
mav_array_memcpy(packet->data, data, sizeof(uint8_t)*90);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)packet, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field id from log_data message
|
||||
*
|
||||
* @return Log id (from LOG_ENTRY reply)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ofs from log_data message
|
||||
*
|
||||
* @return Offset into the log
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_log_data_get_ofs(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field count from log_data message
|
||||
*
|
||||
* @return [bytes] Number of bytes (zero for end of log)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_data_get_count(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from log_data message
|
||||
*
|
||||
* @return log data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 90, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_data_decode(const mavlink_message_t* msg, mavlink_log_data_t* log_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
log_data->ofs = mavlink_msg_log_data_get_ofs(msg);
|
||||
log_data->id = mavlink_msg_log_data_get_id(msg);
|
||||
log_data->count = mavlink_msg_log_data_get_count(msg);
|
||||
mavlink_msg_log_data_get_data(msg, log_data->data);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_DATA_LEN? msg->len : MAVLINK_MSG_ID_LOG_DATA_LEN;
|
||||
memset(log_data, 0, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
memcpy(log_data, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
#pragma once
|
||||
// MESSAGE LOG_ENTRY PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ENTRY 118
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_log_entry_t {
|
||||
uint32_t time_utc; /*< [s] UTC timestamp of log since 1970, or 0 if not available*/
|
||||
uint32_t size; /*< [bytes] Size of the log (may be approximate)*/
|
||||
uint16_t id; /*< Log id*/
|
||||
uint16_t num_logs; /*< Total number of logs*/
|
||||
uint16_t last_log_num; /*< High log number*/
|
||||
}) mavlink_log_entry_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ENTRY_LEN 14
|
||||
#define MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN 14
|
||||
#define MAVLINK_MSG_ID_118_LEN 14
|
||||
#define MAVLINK_MSG_ID_118_MIN_LEN 14
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ENTRY_CRC 56
|
||||
#define MAVLINK_MSG_ID_118_CRC 56
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_ENTRY { \
|
||||
118, \
|
||||
"LOG_ENTRY", \
|
||||
5, \
|
||||
{ { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_entry_t, id) }, \
|
||||
{ "num_logs", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_log_entry_t, num_logs) }, \
|
||||
{ "last_log_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_log_entry_t, last_log_num) }, \
|
||||
{ "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \
|
||||
{ "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_entry_t, size) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_ENTRY { \
|
||||
"LOG_ENTRY", \
|
||||
5, \
|
||||
{ { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_entry_t, id) }, \
|
||||
{ "num_logs", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_log_entry_t, num_logs) }, \
|
||||
{ "last_log_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_log_entry_t, last_log_num) }, \
|
||||
{ "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \
|
||||
{ "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_entry_t, size) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a log_entry message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param id Log id
|
||||
* @param num_logs Total number of logs
|
||||
* @param last_log_num High log number
|
||||
* @param time_utc [s] UTC timestamp of log since 1970, or 0 if not available
|
||||
* @param size [bytes] Size of the log (may be approximate)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_utc);
|
||||
_mav_put_uint32_t(buf, 4, size);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint16_t(buf, 10, num_logs);
|
||||
_mav_put_uint16_t(buf, 12, last_log_num);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#else
|
||||
mavlink_log_entry_t packet;
|
||||
packet.time_utc = time_utc;
|
||||
packet.size = size;
|
||||
packet.id = id;
|
||||
packet.num_logs = num_logs;
|
||||
packet.last_log_num = last_log_num;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_ENTRY;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_entry message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param id Log id
|
||||
* @param num_logs Total number of logs
|
||||
* @param last_log_num High log number
|
||||
* @param time_utc [s] UTC timestamp of log since 1970, or 0 if not available
|
||||
* @param size [bytes] Size of the log (may be approximate)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t id,uint16_t num_logs,uint16_t last_log_num,uint32_t time_utc,uint32_t size)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_utc);
|
||||
_mav_put_uint32_t(buf, 4, size);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint16_t(buf, 10, num_logs);
|
||||
_mav_put_uint16_t(buf, 12, last_log_num);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#else
|
||||
mavlink_log_entry_t packet;
|
||||
packet.time_utc = time_utc;
|
||||
packet.size = size;
|
||||
packet.id = id;
|
||||
packet.num_logs = num_logs;
|
||||
packet.last_log_num = last_log_num;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_ENTRY;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_entry struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_entry C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_entry_t* log_entry)
|
||||
{
|
||||
return mavlink_msg_log_entry_pack(system_id, component_id, msg, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_entry struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_entry C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_entry_t* log_entry)
|
||||
{
|
||||
return mavlink_msg_log_entry_pack_chan(system_id, component_id, chan, msg, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_entry message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param id Log id
|
||||
* @param num_logs Total number of logs
|
||||
* @param last_log_num High log number
|
||||
* @param time_utc [s] UTC timestamp of log since 1970, or 0 if not available
|
||||
* @param size [bytes] Size of the log (may be approximate)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_entry_send(mavlink_channel_t chan, uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_utc);
|
||||
_mav_put_uint32_t(buf, 4, size);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint16_t(buf, 10, num_logs);
|
||||
_mav_put_uint16_t(buf, 12, last_log_num);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
|
||||
#else
|
||||
mavlink_log_entry_t packet;
|
||||
packet.time_utc = time_utc;
|
||||
packet.size = size;
|
||||
packet.id = id;
|
||||
packet.num_logs = num_logs;
|
||||
packet.last_log_num = last_log_num;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)&packet, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_entry message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_log_entry_send_struct(mavlink_channel_t chan, const mavlink_log_entry_t* log_entry)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_log_entry_send(chan, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)log_entry, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOG_ENTRY_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_log_entry_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_utc);
|
||||
_mav_put_uint32_t(buf, 4, size);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint16_t(buf, 10, num_logs);
|
||||
_mav_put_uint16_t(buf, 12, last_log_num);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
|
||||
#else
|
||||
mavlink_log_entry_t *packet = (mavlink_log_entry_t *)msgbuf;
|
||||
packet->time_utc = time_utc;
|
||||
packet->size = size;
|
||||
packet->id = id;
|
||||
packet->num_logs = num_logs;
|
||||
packet->last_log_num = last_log_num;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)packet, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_ENTRY UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field id from log_entry message
|
||||
*
|
||||
* @return Log id
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field num_logs from log_entry message
|
||||
*
|
||||
* @return Total number of logs
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_get_num_logs(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field last_log_num from log_entry message
|
||||
*
|
||||
* @return High log number
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_get_last_log_num(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_utc from log_entry message
|
||||
*
|
||||
* @return [s] UTC timestamp of log since 1970, or 0 if not available
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_log_entry_get_time_utc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field size from log_entry message
|
||||
*
|
||||
* @return [bytes] Size of the log (may be approximate)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_log_entry_get_size(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_entry message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_entry C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_entry_decode(const mavlink_message_t* msg, mavlink_log_entry_t* log_entry)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
log_entry->time_utc = mavlink_msg_log_entry_get_time_utc(msg);
|
||||
log_entry->size = mavlink_msg_log_entry_get_size(msg);
|
||||
log_entry->id = mavlink_msg_log_entry_get_id(msg);
|
||||
log_entry->num_logs = mavlink_msg_log_entry_get_num_logs(msg);
|
||||
log_entry->last_log_num = mavlink_msg_log_entry_get_last_log_num(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_ENTRY_LEN? msg->len : MAVLINK_MSG_ID_LOG_ENTRY_LEN;
|
||||
memset(log_entry, 0, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
memcpy(log_entry, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
#pragma once
|
||||
// MESSAGE LOG_ERASE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ERASE 121
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_log_erase_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
}) mavlink_log_erase_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ERASE_LEN 2
|
||||
#define MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN 2
|
||||
#define MAVLINK_MSG_ID_121_LEN 2
|
||||
#define MAVLINK_MSG_ID_121_MIN_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ERASE_CRC 237
|
||||
#define MAVLINK_MSG_ID_121_CRC 237
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_ERASE { \
|
||||
121, \
|
||||
"LOG_ERASE", \
|
||||
2, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_erase_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_erase_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_ERASE { \
|
||||
"LOG_ERASE", \
|
||||
2, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_erase_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_erase_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a log_erase message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_erase_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#else
|
||||
mavlink_log_erase_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_ERASE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_erase message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_erase_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#else
|
||||
mavlink_log_erase_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_ERASE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_erase struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_erase C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_erase_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_erase_t* log_erase)
|
||||
{
|
||||
return mavlink_msg_log_erase_pack(system_id, component_id, msg, log_erase->target_system, log_erase->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_erase struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_erase C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_erase_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_erase_t* log_erase)
|
||||
{
|
||||
return mavlink_msg_log_erase_pack_chan(system_id, component_id, chan, msg, log_erase->target_system, log_erase->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_erase message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_erase_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
|
||||
#else
|
||||
mavlink_log_erase_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)&packet, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_erase message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_log_erase_send_struct(mavlink_channel_t chan, const mavlink_log_erase_t* log_erase)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_log_erase_send(chan, log_erase->target_system, log_erase->target_component);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)log_erase, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOG_ERASE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_log_erase_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
|
||||
#else
|
||||
mavlink_log_erase_t *packet = (mavlink_log_erase_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)packet, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_ERASE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from log_erase message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_erase_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from log_erase message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_erase_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_erase message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_erase C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_erase_decode(const mavlink_message_t* msg, mavlink_log_erase_t* log_erase)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
log_erase->target_system = mavlink_msg_log_erase_get_target_system(msg);
|
||||
log_erase->target_component = mavlink_msg_log_erase_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_ERASE_LEN? msg->len : MAVLINK_MSG_ID_LOG_ERASE_LEN;
|
||||
memset(log_erase, 0, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
memcpy(log_erase, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
#pragma once
|
||||
// MESSAGE LOG_REQUEST_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_DATA 119
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_log_request_data_t {
|
||||
uint32_t ofs; /*< Offset into the log*/
|
||||
uint32_t count; /*< [bytes] Number of bytes*/
|
||||
uint16_t id; /*< Log id (from LOG_ENTRY reply)*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
}) mavlink_log_request_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN 12
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN 12
|
||||
#define MAVLINK_MSG_ID_119_LEN 12
|
||||
#define MAVLINK_MSG_ID_119_MIN_LEN 12
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC 116
|
||||
#define MAVLINK_MSG_ID_119_CRC 116
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA { \
|
||||
119, \
|
||||
"LOG_REQUEST_DATA", \
|
||||
5, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_log_request_data_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_log_request_data_t, target_component) }, \
|
||||
{ "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_request_data_t, id) }, \
|
||||
{ "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_request_data_t, count) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA { \
|
||||
"LOG_REQUEST_DATA", \
|
||||
5, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_log_request_data_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_log_request_data_t, target_component) }, \
|
||||
{ "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_request_data_t, id) }, \
|
||||
{ "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_request_data_t, count) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_data message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count [bytes] Number of bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint32_t(buf, 4, count);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint8_t(buf, 10, target_system);
|
||||
_mav_put_uint8_t(buf, 11, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#else
|
||||
mavlink_log_request_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.count = count;
|
||||
packet.id = id;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_DATA;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count [bytes] Number of bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t id,uint32_t ofs,uint32_t count)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint32_t(buf, 4, count);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint8_t(buf, 10, target_system);
|
||||
_mav_put_uint8_t(buf, 11, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#else
|
||||
mavlink_log_request_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.count = count;
|
||||
packet.id = id;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_DATA;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_data_t* log_request_data)
|
||||
{
|
||||
return mavlink_msg_log_request_data_pack(system_id, component_id, msg, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_data_t* log_request_data)
|
||||
{
|
||||
return mavlink_msg_log_request_data_pack_chan(system_id, component_id, chan, msg, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_request_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count [bytes] Number of bytes
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_request_data_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint32_t(buf, 4, count);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint8_t(buf, 10, target_system);
|
||||
_mav_put_uint8_t(buf, 11, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
|
||||
#else
|
||||
mavlink_log_request_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.count = count;
|
||||
packet.id = id;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_request_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_data_send_struct(mavlink_channel_t chan, const mavlink_log_request_data_t* log_request_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_log_request_data_send(chan, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)log_request_data, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint32_t(buf, 4, count);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint8_t(buf, 10, target_system);
|
||||
_mav_put_uint8_t(buf, 11, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
|
||||
#else
|
||||
mavlink_log_request_data_t *packet = (mavlink_log_request_data_t *)msgbuf;
|
||||
packet->ofs = ofs;
|
||||
packet->count = count;
|
||||
packet->id = id;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_REQUEST_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from log_request_data message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_data_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from log_request_data message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_data_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field id from log_request_data message
|
||||
*
|
||||
* @return Log id (from LOG_ENTRY reply)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_data_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ofs from log_request_data message
|
||||
*
|
||||
* @return Offset into the log
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_log_request_data_get_ofs(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field count from log_request_data message
|
||||
*
|
||||
* @return [bytes] Number of bytes
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_log_request_data_get_count(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_request_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_request_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_data_decode(const mavlink_message_t* msg, mavlink_log_request_data_t* log_request_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
log_request_data->ofs = mavlink_msg_log_request_data_get_ofs(msg);
|
||||
log_request_data->count = mavlink_msg_log_request_data_get_count(msg);
|
||||
log_request_data->id = mavlink_msg_log_request_data_get_id(msg);
|
||||
log_request_data->target_system = mavlink_msg_log_request_data_get_target_system(msg);
|
||||
log_request_data->target_component = mavlink_msg_log_request_data_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN? msg->len : MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN;
|
||||
memset(log_request_data, 0, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
memcpy(log_request_data, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
#pragma once
|
||||
// MESSAGE LOG_REQUEST_END PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_END 122
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_log_request_end_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
}) mavlink_log_request_end_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_END_LEN 2
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN 2
|
||||
#define MAVLINK_MSG_ID_122_LEN 2
|
||||
#define MAVLINK_MSG_ID_122_MIN_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_END_CRC 203
|
||||
#define MAVLINK_MSG_ID_122_CRC 203
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_END { \
|
||||
122, \
|
||||
"LOG_REQUEST_END", \
|
||||
2, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_request_end_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_request_end_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_END { \
|
||||
"LOG_REQUEST_END", \
|
||||
2, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_request_end_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_request_end_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_end message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_end_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#else
|
||||
mavlink_log_request_end_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_END;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_end message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_end_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#else
|
||||
mavlink_log_request_end_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_END;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_end struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_end C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_end_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_end_t* log_request_end)
|
||||
{
|
||||
return mavlink_msg_log_request_end_pack(system_id, component_id, msg, log_request_end->target_system, log_request_end->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_end struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_end C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_end_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_end_t* log_request_end)
|
||||
{
|
||||
return mavlink_msg_log_request_end_pack_chan(system_id, component_id, chan, msg, log_request_end->target_system, log_request_end->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_request_end message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_request_end_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
|
||||
#else
|
||||
mavlink_log_request_end_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_request_end message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_end_send_struct(mavlink_channel_t chan, const mavlink_log_request_end_t* log_request_end)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_log_request_end_send(chan, log_request_end->target_system, log_request_end->target_component);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)log_request_end, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOG_REQUEST_END_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_end_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
|
||||
#else
|
||||
mavlink_log_request_end_t *packet = (mavlink_log_request_end_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_REQUEST_END UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from log_request_end message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_end_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from log_request_end message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_end_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_request_end message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_request_end C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_end_decode(const mavlink_message_t* msg, mavlink_log_request_end_t* log_request_end)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
log_request_end->target_system = mavlink_msg_log_request_end_get_target_system(msg);
|
||||
log_request_end->target_component = mavlink_msg_log_request_end_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_REQUEST_END_LEN? msg->len : MAVLINK_MSG_ID_LOG_REQUEST_END_LEN;
|
||||
memset(log_request_end, 0, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
memcpy(log_request_end, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
#pragma once
|
||||
// MESSAGE LOG_REQUEST_LIST PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_LIST 117
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_log_request_list_t {
|
||||
uint16_t start; /*< First log id (0 for first available)*/
|
||||
uint16_t end; /*< Last log id (0xffff for last available)*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
}) mavlink_log_request_list_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN 6
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN 6
|
||||
#define MAVLINK_MSG_ID_117_LEN 6
|
||||
#define MAVLINK_MSG_ID_117_MIN_LEN 6
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC 128
|
||||
#define MAVLINK_MSG_ID_117_CRC 128
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST { \
|
||||
117, \
|
||||
"LOG_REQUEST_LIST", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_log_request_list_t, target_component) }, \
|
||||
{ "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \
|
||||
{ "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST { \
|
||||
"LOG_REQUEST_LIST", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_log_request_list_t, target_component) }, \
|
||||
{ "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \
|
||||
{ "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_list message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start First log id (0 for first available)
|
||||
* @param end Last log id (0xffff for last available)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN];
|
||||
_mav_put_uint16_t(buf, 0, start);
|
||||
_mav_put_uint16_t(buf, 2, end);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#else
|
||||
mavlink_log_request_list_t packet;
|
||||
packet.start = start;
|
||||
packet.end = end;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_LIST;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_list message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start First log id (0 for first available)
|
||||
* @param end Last log id (0xffff for last available)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t start,uint16_t end)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN];
|
||||
_mav_put_uint16_t(buf, 0, start);
|
||||
_mav_put_uint16_t(buf, 2, end);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#else
|
||||
mavlink_log_request_list_t packet;
|
||||
packet.start = start;
|
||||
packet.end = end;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_LIST;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_list struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_list C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_list_t* log_request_list)
|
||||
{
|
||||
return mavlink_msg_log_request_list_pack(system_id, component_id, msg, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_list struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_list C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_list_t* log_request_list)
|
||||
{
|
||||
return mavlink_msg_log_request_list_pack_chan(system_id, component_id, chan, msg, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_request_list message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start First log id (0 for first available)
|
||||
* @param end Last log id (0xffff for last available)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN];
|
||||
_mav_put_uint16_t(buf, 0, start);
|
||||
_mav_put_uint16_t(buf, 2, end);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
|
||||
#else
|
||||
mavlink_log_request_list_t packet;
|
||||
packet.start = start;
|
||||
packet.end = end;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_request_list message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_list_send_struct(mavlink_channel_t chan, const mavlink_log_request_list_t* log_request_list)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_log_request_list_send(chan, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)log_request_list, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, start);
|
||||
_mav_put_uint16_t(buf, 2, end);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
|
||||
#else
|
||||
mavlink_log_request_list_t *packet = (mavlink_log_request_list_t *)msgbuf;
|
||||
packet->start = start;
|
||||
packet->end = end;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_REQUEST_LIST UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from log_request_list message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_list_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from log_request_list message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_list_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field start from log_request_list message
|
||||
*
|
||||
* @return First log id (0 for first available)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_get_start(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field end from log_request_list message
|
||||
*
|
||||
* @return Last log id (0xffff for last available)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_get_end(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_request_list message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_request_list C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_list_decode(const mavlink_message_t* msg, mavlink_log_request_list_t* log_request_list)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
log_request_list->start = mavlink_msg_log_request_list_get_start(msg);
|
||||
log_request_list->end = mavlink_msg_log_request_list_get_end(msg);
|
||||
log_request_list->target_system = mavlink_msg_log_request_list_get_target_system(msg);
|
||||
log_request_list->target_component = mavlink_msg_log_request_list_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN? msg->len : MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN;
|
||||
memset(log_request_list, 0, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
memcpy(log_request_list, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE LOGGING_ACK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOGGING_ACK 268
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_logging_ack_t {
|
||||
uint16_t sequence; /*< sequence number (must match the one in LOGGING_DATA_ACKED)*/
|
||||
uint8_t target_system; /*< system ID of the target*/
|
||||
uint8_t target_component; /*< component ID of the target*/
|
||||
}) mavlink_logging_ack_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOGGING_ACK_LEN 4
|
||||
#define MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN 4
|
||||
#define MAVLINK_MSG_ID_268_LEN 4
|
||||
#define MAVLINK_MSG_ID_268_MIN_LEN 4
|
||||
|
||||
#define MAVLINK_MSG_ID_LOGGING_ACK_CRC 14
|
||||
#define MAVLINK_MSG_ID_268_CRC 14
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOGGING_ACK { \
|
||||
268, \
|
||||
"LOGGING_ACK", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_logging_ack_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_logging_ack_t, target_component) }, \
|
||||
{ "sequence", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_logging_ack_t, sequence) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOGGING_ACK { \
|
||||
"LOGGING_ACK", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_logging_ack_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_logging_ack_t, target_component) }, \
|
||||
{ "sequence", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_logging_ack_t, sequence) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a logging_ack message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system system ID of the target
|
||||
* @param target_component component ID of the target
|
||||
* @param sequence sequence number (must match the one in LOGGING_DATA_ACKED)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t sequence)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOGGING_ACK_LEN];
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOGGING_ACK_LEN);
|
||||
#else
|
||||
mavlink_logging_ack_t packet;
|
||||
packet.sequence = sequence;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOGGING_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOGGING_ACK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN, MAVLINK_MSG_ID_LOGGING_ACK_LEN, MAVLINK_MSG_ID_LOGGING_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a logging_ack message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system system ID of the target
|
||||
* @param target_component component ID of the target
|
||||
* @param sequence sequence number (must match the one in LOGGING_DATA_ACKED)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t sequence)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOGGING_ACK_LEN];
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOGGING_ACK_LEN);
|
||||
#else
|
||||
mavlink_logging_ack_t packet;
|
||||
packet.sequence = sequence;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOGGING_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOGGING_ACK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN, MAVLINK_MSG_ID_LOGGING_ACK_LEN, MAVLINK_MSG_ID_LOGGING_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a logging_ack struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param logging_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_logging_ack_t* logging_ack)
|
||||
{
|
||||
return mavlink_msg_logging_ack_pack(system_id, component_id, msg, logging_ack->target_system, logging_ack->target_component, logging_ack->sequence);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a logging_ack struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param logging_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_logging_ack_t* logging_ack)
|
||||
{
|
||||
return mavlink_msg_logging_ack_pack_chan(system_id, component_id, chan, msg, logging_ack->target_system, logging_ack->target_component, logging_ack->sequence);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a logging_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system system ID of the target
|
||||
* @param target_component component ID of the target
|
||||
* @param sequence sequence number (must match the one in LOGGING_DATA_ACKED)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_logging_ack_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t sequence)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOGGING_ACK_LEN];
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_ACK, buf, MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN, MAVLINK_MSG_ID_LOGGING_ACK_LEN, MAVLINK_MSG_ID_LOGGING_ACK_CRC);
|
||||
#else
|
||||
mavlink_logging_ack_t packet;
|
||||
packet.sequence = sequence;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_ACK, (const char *)&packet, MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN, MAVLINK_MSG_ID_LOGGING_ACK_LEN, MAVLINK_MSG_ID_LOGGING_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a logging_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_logging_ack_send_struct(mavlink_channel_t chan, const mavlink_logging_ack_t* logging_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_logging_ack_send(chan, logging_ack->target_system, logging_ack->target_component, logging_ack->sequence);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_ACK, (const char *)logging_ack, MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN, MAVLINK_MSG_ID_LOGGING_ACK_LEN, MAVLINK_MSG_ID_LOGGING_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOGGING_ACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_logging_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t sequence)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_ACK, buf, MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN, MAVLINK_MSG_ID_LOGGING_ACK_LEN, MAVLINK_MSG_ID_LOGGING_ACK_CRC);
|
||||
#else
|
||||
mavlink_logging_ack_t *packet = (mavlink_logging_ack_t *)msgbuf;
|
||||
packet->sequence = sequence;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_ACK, (const char *)packet, MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN, MAVLINK_MSG_ID_LOGGING_ACK_LEN, MAVLINK_MSG_ID_LOGGING_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOGGING_ACK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from logging_ack message
|
||||
*
|
||||
* @return system ID of the target
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_logging_ack_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from logging_ack message
|
||||
*
|
||||
* @return component ID of the target
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_logging_ack_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sequence from logging_ack message
|
||||
*
|
||||
* @return sequence number (must match the one in LOGGING_DATA_ACKED)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_ack_get_sequence(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a logging_ack message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param logging_ack C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_logging_ack_decode(const mavlink_message_t* msg, mavlink_logging_ack_t* logging_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
logging_ack->sequence = mavlink_msg_logging_ack_get_sequence(msg);
|
||||
logging_ack->target_system = mavlink_msg_logging_ack_get_target_system(msg);
|
||||
logging_ack->target_component = mavlink_msg_logging_ack_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOGGING_ACK_LEN? msg->len : MAVLINK_MSG_ID_LOGGING_ACK_LEN;
|
||||
memset(logging_ack, 0, MAVLINK_MSG_ID_LOGGING_ACK_LEN);
|
||||
memcpy(logging_ack, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,330 @@
|
||||
#pragma once
|
||||
// MESSAGE LOGGING_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOGGING_DATA 266
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_logging_data_t {
|
||||
uint16_t sequence; /*< sequence number (can wrap)*/
|
||||
uint8_t target_system; /*< system ID of the target*/
|
||||
uint8_t target_component; /*< component ID of the target*/
|
||||
uint8_t length; /*< [bytes] data length*/
|
||||
uint8_t first_message_offset; /*< [bytes] offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists).*/
|
||||
uint8_t data[249]; /*< logged data*/
|
||||
}) mavlink_logging_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOGGING_DATA_LEN 255
|
||||
#define MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN 255
|
||||
#define MAVLINK_MSG_ID_266_LEN 255
|
||||
#define MAVLINK_MSG_ID_266_MIN_LEN 255
|
||||
|
||||
#define MAVLINK_MSG_ID_LOGGING_DATA_CRC 193
|
||||
#define MAVLINK_MSG_ID_266_CRC 193
|
||||
|
||||
#define MAVLINK_MSG_LOGGING_DATA_FIELD_DATA_LEN 249
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOGGING_DATA { \
|
||||
266, \
|
||||
"LOGGING_DATA", \
|
||||
6, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_logging_data_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_logging_data_t, target_component) }, \
|
||||
{ "sequence", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_logging_data_t, sequence) }, \
|
||||
{ "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_logging_data_t, length) }, \
|
||||
{ "first_message_offset", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_logging_data_t, first_message_offset) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 249, 6, offsetof(mavlink_logging_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOGGING_DATA { \
|
||||
"LOGGING_DATA", \
|
||||
6, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_logging_data_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_logging_data_t, target_component) }, \
|
||||
{ "sequence", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_logging_data_t, sequence) }, \
|
||||
{ "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_logging_data_t, length) }, \
|
||||
{ "first_message_offset", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_logging_data_t, first_message_offset) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 249, 6, offsetof(mavlink_logging_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a logging_data message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system system ID of the target
|
||||
* @param target_component component ID of the target
|
||||
* @param sequence sequence number (can wrap)
|
||||
* @param length [bytes] data length
|
||||
* @param first_message_offset [bytes] offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists).
|
||||
* @param data logged data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t sequence, uint8_t length, uint8_t first_message_offset, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOGGING_DATA_LEN];
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, length);
|
||||
_mav_put_uint8_t(buf, 5, first_message_offset);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 249);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOGGING_DATA_LEN);
|
||||
#else
|
||||
mavlink_logging_data_t packet;
|
||||
packet.sequence = sequence;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.length = length;
|
||||
packet.first_message_offset = first_message_offset;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*249);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOGGING_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOGGING_DATA;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_LEN, MAVLINK_MSG_ID_LOGGING_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a logging_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system system ID of the target
|
||||
* @param target_component component ID of the target
|
||||
* @param sequence sequence number (can wrap)
|
||||
* @param length [bytes] data length
|
||||
* @param first_message_offset [bytes] offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists).
|
||||
* @param data logged data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t sequence,uint8_t length,uint8_t first_message_offset,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOGGING_DATA_LEN];
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, length);
|
||||
_mav_put_uint8_t(buf, 5, first_message_offset);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 249);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOGGING_DATA_LEN);
|
||||
#else
|
||||
mavlink_logging_data_t packet;
|
||||
packet.sequence = sequence;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.length = length;
|
||||
packet.first_message_offset = first_message_offset;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*249);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOGGING_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOGGING_DATA;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_LEN, MAVLINK_MSG_ID_LOGGING_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a logging_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param logging_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_logging_data_t* logging_data)
|
||||
{
|
||||
return mavlink_msg_logging_data_pack(system_id, component_id, msg, logging_data->target_system, logging_data->target_component, logging_data->sequence, logging_data->length, logging_data->first_message_offset, logging_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a logging_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param logging_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_logging_data_t* logging_data)
|
||||
{
|
||||
return mavlink_msg_logging_data_pack_chan(system_id, component_id, chan, msg, logging_data->target_system, logging_data->target_component, logging_data->sequence, logging_data->length, logging_data->first_message_offset, logging_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a logging_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system system ID of the target
|
||||
* @param target_component component ID of the target
|
||||
* @param sequence sequence number (can wrap)
|
||||
* @param length [bytes] data length
|
||||
* @param first_message_offset [bytes] offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists).
|
||||
* @param data logged data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_logging_data_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t sequence, uint8_t length, uint8_t first_message_offset, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOGGING_DATA_LEN];
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, length);
|
||||
_mav_put_uint8_t(buf, 5, first_message_offset);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 249);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_DATA, buf, MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_LEN, MAVLINK_MSG_ID_LOGGING_DATA_CRC);
|
||||
#else
|
||||
mavlink_logging_data_t packet;
|
||||
packet.sequence = sequence;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.length = length;
|
||||
packet.first_message_offset = first_message_offset;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*249);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_LEN, MAVLINK_MSG_ID_LOGGING_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a logging_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_logging_data_send_struct(mavlink_channel_t chan, const mavlink_logging_data_t* logging_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_logging_data_send(chan, logging_data->target_system, logging_data->target_component, logging_data->sequence, logging_data->length, logging_data->first_message_offset, logging_data->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_DATA, (const char *)logging_data, MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_LEN, MAVLINK_MSG_ID_LOGGING_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOGGING_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_logging_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t sequence, uint8_t length, uint8_t first_message_offset, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, length);
|
||||
_mav_put_uint8_t(buf, 5, first_message_offset);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 249);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_DATA, buf, MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_LEN, MAVLINK_MSG_ID_LOGGING_DATA_CRC);
|
||||
#else
|
||||
mavlink_logging_data_t *packet = (mavlink_logging_data_t *)msgbuf;
|
||||
packet->sequence = sequence;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->length = length;
|
||||
packet->first_message_offset = first_message_offset;
|
||||
mav_array_memcpy(packet->data, data, sizeof(uint8_t)*249);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_DATA, (const char *)packet, MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_LEN, MAVLINK_MSG_ID_LOGGING_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOGGING_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from logging_data message
|
||||
*
|
||||
* @return system ID of the target
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_logging_data_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from logging_data message
|
||||
*
|
||||
* @return component ID of the target
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_logging_data_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sequence from logging_data message
|
||||
*
|
||||
* @return sequence number (can wrap)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_get_sequence(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field length from logging_data message
|
||||
*
|
||||
* @return [bytes] data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_logging_data_get_length(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field first_message_offset from logging_data message
|
||||
*
|
||||
* @return [bytes] offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists).
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_logging_data_get_first_message_offset(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from logging_data message
|
||||
*
|
||||
* @return logged data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 249, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a logging_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param logging_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_logging_data_decode(const mavlink_message_t* msg, mavlink_logging_data_t* logging_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
logging_data->sequence = mavlink_msg_logging_data_get_sequence(msg);
|
||||
logging_data->target_system = mavlink_msg_logging_data_get_target_system(msg);
|
||||
logging_data->target_component = mavlink_msg_logging_data_get_target_component(msg);
|
||||
logging_data->length = mavlink_msg_logging_data_get_length(msg);
|
||||
logging_data->first_message_offset = mavlink_msg_logging_data_get_first_message_offset(msg);
|
||||
mavlink_msg_logging_data_get_data(msg, logging_data->data);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOGGING_DATA_LEN? msg->len : MAVLINK_MSG_ID_LOGGING_DATA_LEN;
|
||||
memset(logging_data, 0, MAVLINK_MSG_ID_LOGGING_DATA_LEN);
|
||||
memcpy(logging_data, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,330 @@
|
||||
#pragma once
|
||||
// MESSAGE LOGGING_DATA_ACKED PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOGGING_DATA_ACKED 267
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_logging_data_acked_t {
|
||||
uint16_t sequence; /*< sequence number (can wrap)*/
|
||||
uint8_t target_system; /*< system ID of the target*/
|
||||
uint8_t target_component; /*< component ID of the target*/
|
||||
uint8_t length; /*< [bytes] data length*/
|
||||
uint8_t first_message_offset; /*< [bytes] offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists).*/
|
||||
uint8_t data[249]; /*< logged data*/
|
||||
}) mavlink_logging_data_acked_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN 255
|
||||
#define MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN 255
|
||||
#define MAVLINK_MSG_ID_267_LEN 255
|
||||
#define MAVLINK_MSG_ID_267_MIN_LEN 255
|
||||
|
||||
#define MAVLINK_MSG_ID_LOGGING_DATA_ACKED_CRC 35
|
||||
#define MAVLINK_MSG_ID_267_CRC 35
|
||||
|
||||
#define MAVLINK_MSG_LOGGING_DATA_ACKED_FIELD_DATA_LEN 249
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LOGGING_DATA_ACKED { \
|
||||
267, \
|
||||
"LOGGING_DATA_ACKED", \
|
||||
6, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_logging_data_acked_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_logging_data_acked_t, target_component) }, \
|
||||
{ "sequence", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_logging_data_acked_t, sequence) }, \
|
||||
{ "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_logging_data_acked_t, length) }, \
|
||||
{ "first_message_offset", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_logging_data_acked_t, first_message_offset) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 249, 6, offsetof(mavlink_logging_data_acked_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LOGGING_DATA_ACKED { \
|
||||
"LOGGING_DATA_ACKED", \
|
||||
6, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_logging_data_acked_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_logging_data_acked_t, target_component) }, \
|
||||
{ "sequence", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_logging_data_acked_t, sequence) }, \
|
||||
{ "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_logging_data_acked_t, length) }, \
|
||||
{ "first_message_offset", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_logging_data_acked_t, first_message_offset) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 249, 6, offsetof(mavlink_logging_data_acked_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a logging_data_acked message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system system ID of the target
|
||||
* @param target_component component ID of the target
|
||||
* @param sequence sequence number (can wrap)
|
||||
* @param length [bytes] data length
|
||||
* @param first_message_offset [bytes] offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists).
|
||||
* @param data logged data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_acked_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t sequence, uint8_t length, uint8_t first_message_offset, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN];
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, length);
|
||||
_mav_put_uint8_t(buf, 5, first_message_offset);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 249);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN);
|
||||
#else
|
||||
mavlink_logging_data_acked_t packet;
|
||||
packet.sequence = sequence;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.length = length;
|
||||
packet.first_message_offset = first_message_offset;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*249);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOGGING_DATA_ACKED;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a logging_data_acked message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system system ID of the target
|
||||
* @param target_component component ID of the target
|
||||
* @param sequence sequence number (can wrap)
|
||||
* @param length [bytes] data length
|
||||
* @param first_message_offset [bytes] offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists).
|
||||
* @param data logged data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_acked_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t sequence,uint8_t length,uint8_t first_message_offset,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN];
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, length);
|
||||
_mav_put_uint8_t(buf, 5, first_message_offset);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 249);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN);
|
||||
#else
|
||||
mavlink_logging_data_acked_t packet;
|
||||
packet.sequence = sequence;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.length = length;
|
||||
packet.first_message_offset = first_message_offset;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*249);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOGGING_DATA_ACKED;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a logging_data_acked struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param logging_data_acked C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_acked_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_logging_data_acked_t* logging_data_acked)
|
||||
{
|
||||
return mavlink_msg_logging_data_acked_pack(system_id, component_id, msg, logging_data_acked->target_system, logging_data_acked->target_component, logging_data_acked->sequence, logging_data_acked->length, logging_data_acked->first_message_offset, logging_data_acked->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a logging_data_acked struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param logging_data_acked C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_acked_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_logging_data_acked_t* logging_data_acked)
|
||||
{
|
||||
return mavlink_msg_logging_data_acked_pack_chan(system_id, component_id, chan, msg, logging_data_acked->target_system, logging_data_acked->target_component, logging_data_acked->sequence, logging_data_acked->length, logging_data_acked->first_message_offset, logging_data_acked->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a logging_data_acked message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system system ID of the target
|
||||
* @param target_component component ID of the target
|
||||
* @param sequence sequence number (can wrap)
|
||||
* @param length [bytes] data length
|
||||
* @param first_message_offset [bytes] offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists).
|
||||
* @param data logged data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_logging_data_acked_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t sequence, uint8_t length, uint8_t first_message_offset, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN];
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, length);
|
||||
_mav_put_uint8_t(buf, 5, first_message_offset);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 249);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_DATA_ACKED, buf, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_CRC);
|
||||
#else
|
||||
mavlink_logging_data_acked_t packet;
|
||||
packet.sequence = sequence;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.length = length;
|
||||
packet.first_message_offset = first_message_offset;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*249);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_DATA_ACKED, (const char *)&packet, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a logging_data_acked message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_logging_data_acked_send_struct(mavlink_channel_t chan, const mavlink_logging_data_acked_t* logging_data_acked)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_logging_data_acked_send(chan, logging_data_acked->target_system, logging_data_acked->target_component, logging_data_acked->sequence, logging_data_acked->length, logging_data_acked->first_message_offset, logging_data_acked->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_DATA_ACKED, (const char *)logging_data_acked, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_logging_data_acked_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t sequence, uint8_t length, uint8_t first_message_offset, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, sequence);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, length);
|
||||
_mav_put_uint8_t(buf, 5, first_message_offset);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 249);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_DATA_ACKED, buf, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_CRC);
|
||||
#else
|
||||
mavlink_logging_data_acked_t *packet = (mavlink_logging_data_acked_t *)msgbuf;
|
||||
packet->sequence = sequence;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->length = length;
|
||||
packet->first_message_offset = first_message_offset;
|
||||
mav_array_memcpy(packet->data, data, sizeof(uint8_t)*249);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOGGING_DATA_ACKED, (const char *)packet, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOGGING_DATA_ACKED UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from logging_data_acked message
|
||||
*
|
||||
* @return system ID of the target
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_logging_data_acked_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from logging_data_acked message
|
||||
*
|
||||
* @return component ID of the target
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_logging_data_acked_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sequence from logging_data_acked message
|
||||
*
|
||||
* @return sequence number (can wrap)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_acked_get_sequence(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field length from logging_data_acked message
|
||||
*
|
||||
* @return [bytes] data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_logging_data_acked_get_length(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field first_message_offset from logging_data_acked message
|
||||
*
|
||||
* @return [bytes] offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to 255 if no start exists).
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_logging_data_acked_get_first_message_offset(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from logging_data_acked message
|
||||
*
|
||||
* @return logged data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_logging_data_acked_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 249, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a logging_data_acked message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param logging_data_acked C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_logging_data_acked_decode(const mavlink_message_t* msg, mavlink_logging_data_acked_t* logging_data_acked)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
logging_data_acked->sequence = mavlink_msg_logging_data_acked_get_sequence(msg);
|
||||
logging_data_acked->target_system = mavlink_msg_logging_data_acked_get_target_system(msg);
|
||||
logging_data_acked->target_component = mavlink_msg_logging_data_acked_get_target_component(msg);
|
||||
logging_data_acked->length = mavlink_msg_logging_data_acked_get_length(msg);
|
||||
logging_data_acked->first_message_offset = mavlink_msg_logging_data_acked_get_first_message_offset(msg);
|
||||
mavlink_msg_logging_data_acked_get_data(msg, logging_data_acked->data);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN? msg->len : MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN;
|
||||
memset(logging_data_acked, 0, MAVLINK_MSG_ID_LOGGING_DATA_ACKED_LEN);
|
||||
memcpy(logging_data_acked, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
#pragma once
|
||||
// MESSAGE MANUAL_CONTROL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MANUAL_CONTROL 69
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_manual_control_t {
|
||||
int16_t x; /*< X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.*/
|
||||
int16_t y; /*< Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.*/
|
||||
int16_t z; /*< Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.*/
|
||||
int16_t r; /*< R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.*/
|
||||
uint16_t buttons; /*< A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.*/
|
||||
uint8_t target; /*< The system to be controlled.*/
|
||||
}) mavlink_manual_control_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MANUAL_CONTROL_LEN 11
|
||||
#define MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN 11
|
||||
#define MAVLINK_MSG_ID_69_LEN 11
|
||||
#define MAVLINK_MSG_ID_69_MIN_LEN 11
|
||||
|
||||
#define MAVLINK_MSG_ID_MANUAL_CONTROL_CRC 243
|
||||
#define MAVLINK_MSG_ID_69_CRC 243
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MANUAL_CONTROL { \
|
||||
69, \
|
||||
"MANUAL_CONTROL", \
|
||||
6, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_manual_control_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_manual_control_t, z) }, \
|
||||
{ "r", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_manual_control_t, r) }, \
|
||||
{ "buttons", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_manual_control_t, buttons) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MANUAL_CONTROL { \
|
||||
"MANUAL_CONTROL", \
|
||||
6, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_manual_control_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_manual_control_t, z) }, \
|
||||
{ "r", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_manual_control_t, r) }, \
|
||||
{ "buttons", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_manual_control_t, buttons) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a manual_control message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target The system to be controlled.
|
||||
* @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
|
||||
* @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
|
||||
* @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.
|
||||
* @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
|
||||
* @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN];
|
||||
_mav_put_int16_t(buf, 0, x);
|
||||
_mav_put_int16_t(buf, 2, y);
|
||||
_mav_put_int16_t(buf, 4, z);
|
||||
_mav_put_int16_t(buf, 6, r);
|
||||
_mav_put_uint16_t(buf, 8, buttons);
|
||||
_mav_put_uint8_t(buf, 10, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_manual_control_t packet;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.r = r;
|
||||
packet.buttons = buttons;
|
||||
packet.target = target;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a manual_control message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target The system to be controlled.
|
||||
* @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
|
||||
* @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
|
||||
* @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.
|
||||
* @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
|
||||
* @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target,int16_t x,int16_t y,int16_t z,int16_t r,uint16_t buttons)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN];
|
||||
_mav_put_int16_t(buf, 0, x);
|
||||
_mav_put_int16_t(buf, 2, y);
|
||||
_mav_put_int16_t(buf, 4, z);
|
||||
_mav_put_int16_t(buf, 6, r);
|
||||
_mav_put_uint16_t(buf, 8, buttons);
|
||||
_mav_put_uint8_t(buf, 10, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_manual_control_t packet;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.r = r;
|
||||
packet.buttons = buttons;
|
||||
packet.target = target;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a manual_control struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param manual_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_manual_control_t* manual_control)
|
||||
{
|
||||
return mavlink_msg_manual_control_pack(system_id, component_id, msg, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a manual_control struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param manual_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_manual_control_t* manual_control)
|
||||
{
|
||||
return mavlink_msg_manual_control_pack_chan(system_id, component_id, chan, msg, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a manual_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target The system to be controlled.
|
||||
* @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
|
||||
* @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
|
||||
* @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.
|
||||
* @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
|
||||
* @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN];
|
||||
_mav_put_int16_t(buf, 0, x);
|
||||
_mav_put_int16_t(buf, 2, y);
|
||||
_mav_put_int16_t(buf, 4, z);
|
||||
_mav_put_int16_t(buf, 6, r);
|
||||
_mav_put_uint16_t(buf, 8, buttons);
|
||||
_mav_put_uint8_t(buf, 10, target);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_manual_control_t packet;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.r = r;
|
||||
packet.buttons = buttons;
|
||||
packet.target = target;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a manual_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_manual_control_send_struct(mavlink_channel_t chan, const mavlink_manual_control_t* manual_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_manual_control_send(chan, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)manual_control, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MANUAL_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_manual_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int16_t(buf, 0, x);
|
||||
_mav_put_int16_t(buf, 2, y);
|
||||
_mav_put_int16_t(buf, 4, z);
|
||||
_mav_put_int16_t(buf, 6, r);
|
||||
_mav_put_uint16_t(buf, 8, buttons);
|
||||
_mav_put_uint8_t(buf, 10, target);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_manual_control_t *packet = (mavlink_manual_control_t *)msgbuf;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->r = r;
|
||||
packet->buttons = buttons;
|
||||
packet->target = target;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MANUAL_CONTROL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target from manual_control message
|
||||
*
|
||||
* @return The system to be controlled.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_manual_control_get_target(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from manual_control message
|
||||
*
|
||||
* @return X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_manual_control_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from manual_control message
|
||||
*
|
||||
* @return Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_manual_control_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from manual_control message
|
||||
*
|
||||
* @return Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_manual_control_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field r from manual_control message
|
||||
*
|
||||
* @return R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_manual_control_get_r(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field buttons from manual_control message
|
||||
*
|
||||
* @return A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_control_get_buttons(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a manual_control message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param manual_control C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_manual_control_decode(const mavlink_message_t* msg, mavlink_manual_control_t* manual_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
manual_control->x = mavlink_msg_manual_control_get_x(msg);
|
||||
manual_control->y = mavlink_msg_manual_control_get_y(msg);
|
||||
manual_control->z = mavlink_msg_manual_control_get_z(msg);
|
||||
manual_control->r = mavlink_msg_manual_control_get_r(msg);
|
||||
manual_control->buttons = mavlink_msg_manual_control_get_buttons(msg);
|
||||
manual_control->target = mavlink_msg_manual_control_get_target(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MANUAL_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_MANUAL_CONTROL_LEN;
|
||||
memset(manual_control, 0, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN);
|
||||
memcpy(manual_control, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
#pragma once
|
||||
// MESSAGE MANUAL_SETPOINT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MANUAL_SETPOINT 81
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_manual_setpoint_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
float roll; /*< [rad/s] Desired roll rate*/
|
||||
float pitch; /*< [rad/s] Desired pitch rate*/
|
||||
float yaw; /*< [rad/s] Desired yaw rate*/
|
||||
float thrust; /*< Collective thrust, normalized to 0 .. 1*/
|
||||
uint8_t mode_switch; /*< Flight mode switch position, 0.. 255*/
|
||||
uint8_t manual_override_switch; /*< Override mode switch position, 0.. 255*/
|
||||
}) mavlink_manual_setpoint_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN 22
|
||||
#define MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN 22
|
||||
#define MAVLINK_MSG_ID_81_LEN 22
|
||||
#define MAVLINK_MSG_ID_81_MIN_LEN 22
|
||||
|
||||
#define MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC 106
|
||||
#define MAVLINK_MSG_ID_81_CRC 106
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT { \
|
||||
81, \
|
||||
"MANUAL_SETPOINT", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_manual_setpoint_t, time_boot_ms) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_manual_setpoint_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_manual_setpoint_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_manual_setpoint_t, yaw) }, \
|
||||
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_manual_setpoint_t, thrust) }, \
|
||||
{ "mode_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_manual_setpoint_t, mode_switch) }, \
|
||||
{ "manual_override_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_manual_setpoint_t, manual_override_switch) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT { \
|
||||
"MANUAL_SETPOINT", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_manual_setpoint_t, time_boot_ms) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_manual_setpoint_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_manual_setpoint_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_manual_setpoint_t, yaw) }, \
|
||||
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_manual_setpoint_t, thrust) }, \
|
||||
{ "mode_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_manual_setpoint_t, mode_switch) }, \
|
||||
{ "manual_override_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_manual_setpoint_t, manual_override_switch) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a manual_setpoint message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param roll [rad/s] Desired roll rate
|
||||
* @param pitch [rad/s] Desired pitch rate
|
||||
* @param yaw [rad/s] Desired yaw rate
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1
|
||||
* @param mode_switch Flight mode switch position, 0.. 255
|
||||
* @param manual_override_switch Override mode switch position, 0.. 255
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
_mav_put_uint8_t(buf, 20, mode_switch);
|
||||
_mav_put_uint8_t(buf, 21, manual_override_switch);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN);
|
||||
#else
|
||||
mavlink_manual_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.thrust = thrust;
|
||||
packet.mode_switch = mode_switch;
|
||||
packet.manual_override_switch = manual_override_switch;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a manual_setpoint message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param roll [rad/s] Desired roll rate
|
||||
* @param pitch [rad/s] Desired pitch rate
|
||||
* @param yaw [rad/s] Desired yaw rate
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1
|
||||
* @param mode_switch Flight mode switch position, 0.. 255
|
||||
* @param manual_override_switch Override mode switch position, 0.. 255
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,float roll,float pitch,float yaw,float thrust,uint8_t mode_switch,uint8_t manual_override_switch)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
_mav_put_uint8_t(buf, 20, mode_switch);
|
||||
_mav_put_uint8_t(buf, 21, manual_override_switch);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN);
|
||||
#else
|
||||
mavlink_manual_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.thrust = thrust;
|
||||
packet.mode_switch = mode_switch;
|
||||
packet.manual_override_switch = manual_override_switch;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a manual_setpoint struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param manual_setpoint C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_manual_setpoint_t* manual_setpoint)
|
||||
{
|
||||
return mavlink_msg_manual_setpoint_pack(system_id, component_id, msg, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a manual_setpoint struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param manual_setpoint C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_setpoint_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_manual_setpoint_t* manual_setpoint)
|
||||
{
|
||||
return mavlink_msg_manual_setpoint_pack_chan(system_id, component_id, chan, msg, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a manual_setpoint message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param roll [rad/s] Desired roll rate
|
||||
* @param pitch [rad/s] Desired pitch rate
|
||||
* @param yaw [rad/s] Desired yaw rate
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1
|
||||
* @param mode_switch Flight mode switch position, 0.. 255
|
||||
* @param manual_override_switch Override mode switch position, 0.. 255
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_manual_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
_mav_put_uint8_t(buf, 20, mode_switch);
|
||||
_mav_put_uint8_t(buf, 21, manual_override_switch);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
|
||||
#else
|
||||
mavlink_manual_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.thrust = thrust;
|
||||
packet.mode_switch = mode_switch;
|
||||
packet.manual_override_switch = manual_override_switch;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a manual_setpoint message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_manual_setpoint_send_struct(mavlink_channel_t chan, const mavlink_manual_setpoint_t* manual_setpoint)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_manual_setpoint_send(chan, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)manual_setpoint, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_manual_setpoint_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
_mav_put_uint8_t(buf, 20, mode_switch);
|
||||
_mav_put_uint8_t(buf, 21, manual_override_switch);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
|
||||
#else
|
||||
mavlink_manual_setpoint_t *packet = (mavlink_manual_setpoint_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->roll = roll;
|
||||
packet->pitch = pitch;
|
||||
packet->yaw = yaw;
|
||||
packet->thrust = thrust;
|
||||
packet->mode_switch = mode_switch;
|
||||
packet->manual_override_switch = manual_override_switch;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MANUAL_SETPOINT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from manual_setpoint message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_manual_setpoint_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from manual_setpoint message
|
||||
*
|
||||
* @return [rad/s] Desired roll rate
|
||||
*/
|
||||
static inline float mavlink_msg_manual_setpoint_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from manual_setpoint message
|
||||
*
|
||||
* @return [rad/s] Desired pitch rate
|
||||
*/
|
||||
static inline float mavlink_msg_manual_setpoint_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from manual_setpoint message
|
||||
*
|
||||
* @return [rad/s] Desired yaw rate
|
||||
*/
|
||||
static inline float mavlink_msg_manual_setpoint_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field thrust from manual_setpoint message
|
||||
*
|
||||
* @return Collective thrust, normalized to 0 .. 1
|
||||
*/
|
||||
static inline float mavlink_msg_manual_setpoint_get_thrust(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mode_switch from manual_setpoint message
|
||||
*
|
||||
* @return Flight mode switch position, 0.. 255
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_manual_setpoint_get_mode_switch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field manual_override_switch from manual_setpoint message
|
||||
*
|
||||
* @return Override mode switch position, 0.. 255
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_manual_setpoint_get_manual_override_switch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a manual_setpoint message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param manual_setpoint C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_manual_setpoint_decode(const mavlink_message_t* msg, mavlink_manual_setpoint_t* manual_setpoint)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
manual_setpoint->time_boot_ms = mavlink_msg_manual_setpoint_get_time_boot_ms(msg);
|
||||
manual_setpoint->roll = mavlink_msg_manual_setpoint_get_roll(msg);
|
||||
manual_setpoint->pitch = mavlink_msg_manual_setpoint_get_pitch(msg);
|
||||
manual_setpoint->yaw = mavlink_msg_manual_setpoint_get_yaw(msg);
|
||||
manual_setpoint->thrust = mavlink_msg_manual_setpoint_get_thrust(msg);
|
||||
manual_setpoint->mode_switch = mavlink_msg_manual_setpoint_get_mode_switch(msg);
|
||||
manual_setpoint->manual_override_switch = mavlink_msg_manual_setpoint_get_manual_override_switch(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN? msg->len : MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN;
|
||||
memset(manual_setpoint, 0, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN);
|
||||
memcpy(manual_setpoint, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
#pragma once
|
||||
// MESSAGE MEMORY_VECT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MEMORY_VECT 249
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_memory_vect_t {
|
||||
uint16_t address; /*< Starting address of the debug variables*/
|
||||
uint8_t ver; /*< Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below*/
|
||||
uint8_t type; /*< Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14*/
|
||||
int8_t value[32]; /*< Memory contents at specified address*/
|
||||
}) mavlink_memory_vect_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MEMORY_VECT_LEN 36
|
||||
#define MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN 36
|
||||
#define MAVLINK_MSG_ID_249_LEN 36
|
||||
#define MAVLINK_MSG_ID_249_MIN_LEN 36
|
||||
|
||||
#define MAVLINK_MSG_ID_MEMORY_VECT_CRC 204
|
||||
#define MAVLINK_MSG_ID_249_CRC 204
|
||||
|
||||
#define MAVLINK_MSG_MEMORY_VECT_FIELD_VALUE_LEN 32
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MEMORY_VECT { \
|
||||
249, \
|
||||
"MEMORY_VECT", \
|
||||
4, \
|
||||
{ { "address", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_memory_vect_t, address) }, \
|
||||
{ "ver", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_memory_vect_t, ver) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_memory_vect_t, type) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_INT8_T, 32, 4, offsetof(mavlink_memory_vect_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MEMORY_VECT { \
|
||||
"MEMORY_VECT", \
|
||||
4, \
|
||||
{ { "address", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_memory_vect_t, address) }, \
|
||||
{ "ver", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_memory_vect_t, ver) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_memory_vect_t, type) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_INT8_T, 32, 4, offsetof(mavlink_memory_vect_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a memory_vect message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param address Starting address of the debug variables
|
||||
* @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below
|
||||
* @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14
|
||||
* @param value Memory contents at specified address
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_memory_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t address, uint8_t ver, uint8_t type, const int8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, address);
|
||||
_mav_put_uint8_t(buf, 2, ver);
|
||||
_mav_put_uint8_t(buf, 3, type);
|
||||
_mav_put_int8_t_array(buf, 4, value, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN);
|
||||
#else
|
||||
mavlink_memory_vect_t packet;
|
||||
packet.address = address;
|
||||
packet.ver = ver;
|
||||
packet.type = type;
|
||||
mav_array_memcpy(packet.value, value, sizeof(int8_t)*32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a memory_vect message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param address Starting address of the debug variables
|
||||
* @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below
|
||||
* @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14
|
||||
* @param value Memory contents at specified address
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_memory_vect_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t address,uint8_t ver,uint8_t type,const int8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, address);
|
||||
_mav_put_uint8_t(buf, 2, ver);
|
||||
_mav_put_uint8_t(buf, 3, type);
|
||||
_mav_put_int8_t_array(buf, 4, value, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN);
|
||||
#else
|
||||
mavlink_memory_vect_t packet;
|
||||
packet.address = address;
|
||||
packet.ver = ver;
|
||||
packet.type = type;
|
||||
mav_array_memcpy(packet.value, value, sizeof(int8_t)*32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a memory_vect struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param memory_vect C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_memory_vect_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_memory_vect_t* memory_vect)
|
||||
{
|
||||
return mavlink_msg_memory_vect_pack(system_id, component_id, msg, memory_vect->address, memory_vect->ver, memory_vect->type, memory_vect->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a memory_vect struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param memory_vect C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_memory_vect_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_memory_vect_t* memory_vect)
|
||||
{
|
||||
return mavlink_msg_memory_vect_pack_chan(system_id, component_id, chan, msg, memory_vect->address, memory_vect->ver, memory_vect->type, memory_vect->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a memory_vect message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param address Starting address of the debug variables
|
||||
* @param ver Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below
|
||||
* @param type Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14
|
||||
* @param value Memory contents at specified address
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_memory_vect_send(mavlink_channel_t chan, uint16_t address, uint8_t ver, uint8_t type, const int8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, address);
|
||||
_mav_put_uint8_t(buf, 2, ver);
|
||||
_mav_put_uint8_t(buf, 3, type);
|
||||
_mav_put_int8_t_array(buf, 4, value, 32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
|
||||
#else
|
||||
mavlink_memory_vect_t packet;
|
||||
packet.address = address;
|
||||
packet.ver = ver;
|
||||
packet.type = type;
|
||||
mav_array_memcpy(packet.value, value, sizeof(int8_t)*32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)&packet, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a memory_vect message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_memory_vect_send_struct(mavlink_channel_t chan, const mavlink_memory_vect_t* memory_vect)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_memory_vect_send(chan, memory_vect->address, memory_vect->ver, memory_vect->type, memory_vect->value);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)memory_vect, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MEMORY_VECT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_memory_vect_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t address, uint8_t ver, uint8_t type, const int8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, address);
|
||||
_mav_put_uint8_t(buf, 2, ver);
|
||||
_mav_put_uint8_t(buf, 3, type);
|
||||
_mav_put_int8_t_array(buf, 4, value, 32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
|
||||
#else
|
||||
mavlink_memory_vect_t *packet = (mavlink_memory_vect_t *)msgbuf;
|
||||
packet->address = address;
|
||||
packet->ver = ver;
|
||||
packet->type = type;
|
||||
mav_array_memcpy(packet->value, value, sizeof(int8_t)*32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)packet, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MEMORY_VECT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field address from memory_vect message
|
||||
*
|
||||
* @return Starting address of the debug variables
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_memory_vect_get_address(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ver from memory_vect message
|
||||
*
|
||||
* @return Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_memory_vect_get_ver(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field type from memory_vect message
|
||||
*
|
||||
* @return Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_memory_vect_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field value from memory_vect message
|
||||
*
|
||||
* @return Memory contents at specified address
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_memory_vect_get_value(const mavlink_message_t* msg, int8_t *value)
|
||||
{
|
||||
return _MAV_RETURN_int8_t_array(msg, value, 32, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a memory_vect message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param memory_vect C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_memory_vect_decode(const mavlink_message_t* msg, mavlink_memory_vect_t* memory_vect)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
memory_vect->address = mavlink_msg_memory_vect_get_address(msg);
|
||||
memory_vect->ver = mavlink_msg_memory_vect_get_ver(msg);
|
||||
memory_vect->type = mavlink_msg_memory_vect_get_type(msg);
|
||||
mavlink_msg_memory_vect_get_value(msg, memory_vect->value);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MEMORY_VECT_LEN? msg->len : MAVLINK_MSG_ID_MEMORY_VECT_LEN;
|
||||
memset(memory_vect, 0, MAVLINK_MSG_ID_MEMORY_VECT_LEN);
|
||||
memcpy(memory_vect, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
#pragma once
|
||||
// MESSAGE MESSAGE_INTERVAL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MESSAGE_INTERVAL 244
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_message_interval_t {
|
||||
int32_t interval_us; /*< [us] The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.*/
|
||||
uint16_t message_id; /*< The ID of the requested MAVLink message. v1.0 is limited to 254 messages.*/
|
||||
}) mavlink_message_interval_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN 6
|
||||
#define MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN 6
|
||||
#define MAVLINK_MSG_ID_244_LEN 6
|
||||
#define MAVLINK_MSG_ID_244_MIN_LEN 6
|
||||
|
||||
#define MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC 95
|
||||
#define MAVLINK_MSG_ID_244_CRC 95
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL { \
|
||||
244, \
|
||||
"MESSAGE_INTERVAL", \
|
||||
2, \
|
||||
{ { "message_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_message_interval_t, message_id) }, \
|
||||
{ "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL { \
|
||||
"MESSAGE_INTERVAL", \
|
||||
2, \
|
||||
{ { "message_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_message_interval_t, message_id) }, \
|
||||
{ "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a message_interval message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages.
|
||||
* @param interval_us [us] The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_message_interval_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t message_id, int32_t interval_us)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN];
|
||||
_mav_put_int32_t(buf, 0, interval_us);
|
||||
_mav_put_uint16_t(buf, 4, message_id);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
|
||||
#else
|
||||
mavlink_message_interval_t packet;
|
||||
packet.interval_us = interval_us;
|
||||
packet.message_id = message_id;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a message_interval message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages.
|
||||
* @param interval_us [us] The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_message_interval_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t message_id,int32_t interval_us)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN];
|
||||
_mav_put_int32_t(buf, 0, interval_us);
|
||||
_mav_put_uint16_t(buf, 4, message_id);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
|
||||
#else
|
||||
mavlink_message_interval_t packet;
|
||||
packet.interval_us = interval_us;
|
||||
packet.message_id = message_id;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a message_interval struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param message_interval C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_message_interval_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_message_interval_t* message_interval)
|
||||
{
|
||||
return mavlink_msg_message_interval_pack(system_id, component_id, msg, message_interval->message_id, message_interval->interval_us);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a message_interval struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param message_interval C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_message_interval_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_message_interval_t* message_interval)
|
||||
{
|
||||
return mavlink_msg_message_interval_pack_chan(system_id, component_id, chan, msg, message_interval->message_id, message_interval->interval_us);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a message_interval message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param message_id The ID of the requested MAVLink message. v1.0 is limited to 254 messages.
|
||||
* @param interval_us [us] The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_message_interval_send(mavlink_channel_t chan, uint16_t message_id, int32_t interval_us)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN];
|
||||
_mav_put_int32_t(buf, 0, interval_us);
|
||||
_mav_put_uint16_t(buf, 4, message_id);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
|
||||
#else
|
||||
mavlink_message_interval_t packet;
|
||||
packet.interval_us = interval_us;
|
||||
packet.message_id = message_id;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)&packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a message_interval message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_message_interval_send_struct(mavlink_channel_t chan, const mavlink_message_interval_t* message_interval)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_message_interval_send(chan, message_interval->message_id, message_interval->interval_us);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)message_interval, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_message_interval_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t message_id, int32_t interval_us)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, interval_us);
|
||||
_mav_put_uint16_t(buf, 4, message_id);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
|
||||
#else
|
||||
mavlink_message_interval_t *packet = (mavlink_message_interval_t *)msgbuf;
|
||||
packet->interval_us = interval_us;
|
||||
packet->message_id = message_id;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MESSAGE_INTERVAL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field message_id from message_interval message
|
||||
*
|
||||
* @return The ID of the requested MAVLink message. v1.0 is limited to 254 messages.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_message_interval_get_message_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field interval_us from message_interval message
|
||||
*
|
||||
* @return [us] The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_message_interval_get_interval_us(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a message_interval message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param message_interval C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_message_interval_decode(const mavlink_message_t* msg, mavlink_message_interval_t* message_interval)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
message_interval->interval_us = mavlink_msg_message_interval_get_interval_us(msg);
|
||||
message_interval->message_id = mavlink_msg_message_interval_get_message_id(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN? msg->len : MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN;
|
||||
memset(message_interval, 0, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
|
||||
memcpy(message_interval, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_ACK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ACK 47
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_ack_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t type; /*< Mission result.*/
|
||||
uint8_t mission_type; /*< Mission type.*/
|
||||
}) mavlink_mission_ack_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ACK_LEN 4
|
||||
#define MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_47_LEN 4
|
||||
#define MAVLINK_MSG_ID_47_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ACK_CRC 153
|
||||
#define MAVLINK_MSG_ID_47_CRC 153
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_ACK { \
|
||||
47, \
|
||||
"MISSION_ACK", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_ack_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_ack_t, target_component) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_ack_t, type) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_ack_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_ACK { \
|
||||
"MISSION_ACK", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_ack_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_ack_t, target_component) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_ack_t, type) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_ack_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_ack message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param type Mission result.
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t type, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, type);
|
||||
_mav_put_uint8_t(buf, 3, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ACK_LEN);
|
||||
#else
|
||||
mavlink_mission_ack_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.type = type;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ACK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_ack message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param type Mission result.
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t type,uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, type);
|
||||
_mav_put_uint8_t(buf, 3, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ACK_LEN);
|
||||
#else
|
||||
mavlink_mission_ack_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.type = type;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ACK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_ack struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_ack_t* mission_ack)
|
||||
{
|
||||
return mavlink_msg_mission_ack_pack(system_id, component_id, msg, mission_ack->target_system, mission_ack->target_component, mission_ack->type, mission_ack->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_ack struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_ack_t* mission_ack)
|
||||
{
|
||||
return mavlink_msg_mission_ack_pack_chan(system_id, component_id, chan, msg, mission_ack->target_system, mission_ack->target_component, mission_ack->type, mission_ack->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param type Mission result.
|
||||
* @param mission_type Mission type.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_ack_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t type, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, type);
|
||||
_mav_put_uint8_t(buf, 3, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
|
||||
#else
|
||||
mavlink_mission_ack_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.type = type;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_ack_send_struct(mavlink_channel_t chan, const mavlink_mission_ack_t* mission_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_ack_send(chan, mission_ack->target_system, mission_ack->target_component, mission_ack->type, mission_ack->mission_type);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)mission_ack, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_ACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t type, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, type);
|
||||
_mav_put_uint8_t(buf, 3, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
|
||||
#else
|
||||
mavlink_mission_ack_t *packet = (mavlink_mission_ack_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->type = type;
|
||||
packet->mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)packet, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_ACK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mission_ack message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_ack_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mission_ack message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_ack_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field type from mission_ack message
|
||||
*
|
||||
* @return Mission result.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_ack_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mission_type from mission_ack message
|
||||
*
|
||||
* @return Mission type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_ack_get_mission_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_ack message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_ack C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_ack_decode(const mavlink_message_t* msg, mavlink_mission_ack_t* mission_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_ack->target_system = mavlink_msg_mission_ack_get_target_system(msg);
|
||||
mission_ack->target_component = mavlink_msg_mission_ack_get_target_component(msg);
|
||||
mission_ack->type = mavlink_msg_mission_ack_get_type(msg);
|
||||
mission_ack->mission_type = mavlink_msg_mission_ack_get_mission_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ACK_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ACK_LEN;
|
||||
memset(mission_ack, 0, MAVLINK_MSG_ID_MISSION_ACK_LEN);
|
||||
memcpy(mission_ack, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_CLEAR_ALL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL 45
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_clear_all_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t mission_type; /*< Mission type.*/
|
||||
}) mavlink_mission_clear_all_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN 3
|
||||
#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN 2
|
||||
#define MAVLINK_MSG_ID_45_LEN 3
|
||||
#define MAVLINK_MSG_ID_45_MIN_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC 232
|
||||
#define MAVLINK_MSG_ID_45_CRC 232
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL { \
|
||||
45, \
|
||||
"MISSION_CLEAR_ALL", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_clear_all_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_clear_all_t, target_component) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_clear_all_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL { \
|
||||
"MISSION_CLEAR_ALL", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_clear_all_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_clear_all_t, target_component) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_clear_all_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_clear_all message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN);
|
||||
#else
|
||||
mavlink_mission_clear_all_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_clear_all message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN);
|
||||
#else
|
||||
mavlink_mission_clear_all_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_clear_all struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_clear_all C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_clear_all_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_clear_all_t* mission_clear_all)
|
||||
{
|
||||
return mavlink_msg_mission_clear_all_pack(system_id, component_id, msg, mission_clear_all->target_system, mission_clear_all->target_component, mission_clear_all->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_clear_all struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_clear_all C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_clear_all_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_clear_all_t* mission_clear_all)
|
||||
{
|
||||
return mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, chan, msg, mission_clear_all->target_system, mission_clear_all->target_component, mission_clear_all->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_clear_all message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mission_type Mission type.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_clear_all_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
|
||||
#else
|
||||
mavlink_mission_clear_all_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_clear_all message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_clear_all_send_struct(mavlink_channel_t chan, const mavlink_mission_clear_all_t* mission_clear_all)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_clear_all_send(chan, mission_clear_all->target_system, mission_clear_all->target_component, mission_clear_all->mission_type);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)mission_clear_all, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_clear_all_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
|
||||
#else
|
||||
mavlink_mission_clear_all_t *packet = (mavlink_mission_clear_all_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_CLEAR_ALL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mission_clear_all message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_clear_all_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mission_clear_all message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_clear_all_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mission_type from mission_clear_all message
|
||||
*
|
||||
* @return Mission type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_clear_all_get_mission_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_clear_all message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_clear_all C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_clear_all_decode(const mavlink_message_t* msg, mavlink_mission_clear_all_t* mission_clear_all)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_clear_all->target_system = mavlink_msg_mission_clear_all_get_target_system(msg);
|
||||
mission_clear_all->target_component = mavlink_msg_mission_clear_all_get_target_component(msg);
|
||||
mission_clear_all->mission_type = mavlink_msg_mission_clear_all_get_mission_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN? msg->len : MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN;
|
||||
memset(mission_clear_all, 0, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN);
|
||||
memcpy(mission_clear_all, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_COUNT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_COUNT 44
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_count_t {
|
||||
uint16_t count; /*< Number of mission items in the sequence*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t mission_type; /*< Mission type.*/
|
||||
}) mavlink_mission_count_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_COUNT_LEN 5
|
||||
#define MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN 4
|
||||
#define MAVLINK_MSG_ID_44_LEN 5
|
||||
#define MAVLINK_MSG_ID_44_MIN_LEN 4
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_COUNT_CRC 221
|
||||
#define MAVLINK_MSG_ID_44_CRC 221
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_COUNT { \
|
||||
44, \
|
||||
"MISSION_COUNT", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_count_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_count_t, target_component) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_count_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_COUNT { \
|
||||
"MISSION_COUNT", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_count_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_count_t, target_component) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_count_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_count message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param count Number of mission items in the sequence
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t count, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, count);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN);
|
||||
#else
|
||||
mavlink_mission_count_t packet;
|
||||
packet.count = count;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_count message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param count Number of mission items in the sequence
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_count_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t count,uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, count);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN);
|
||||
#else
|
||||
mavlink_mission_count_t packet;
|
||||
packet.count = count;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_count struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_count C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_count_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_count_t* mission_count)
|
||||
{
|
||||
return mavlink_msg_mission_count_pack(system_id, component_id, msg, mission_count->target_system, mission_count->target_component, mission_count->count, mission_count->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_count struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_count C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_count_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_count_t* mission_count)
|
||||
{
|
||||
return mavlink_msg_mission_count_pack_chan(system_id, component_id, chan, msg, mission_count->target_system, mission_count->target_component, mission_count->count, mission_count->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_count message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param count Number of mission items in the sequence
|
||||
* @param mission_type Mission type.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_count_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t count, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, count);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
|
||||
#else
|
||||
mavlink_mission_count_t packet;
|
||||
packet.count = count;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_count message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_count_send_struct(mavlink_channel_t chan, const mavlink_mission_count_t* mission_count)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_count_send(chan, mission_count->target_system, mission_count->target_component, mission_count->count, mission_count->mission_type);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)mission_count, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_COUNT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_count_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t count, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, count);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
|
||||
#else
|
||||
mavlink_mission_count_t *packet = (mavlink_mission_count_t *)msgbuf;
|
||||
packet->count = count;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)packet, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_COUNT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mission_count message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_count_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mission_count message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_count_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field count from mission_count message
|
||||
*
|
||||
* @return Number of mission items in the sequence
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_count_get_count(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mission_type from mission_count message
|
||||
*
|
||||
* @return Mission type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_count_get_mission_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_count message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_count C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_count_decode(const mavlink_message_t* msg, mavlink_mission_count_t* mission_count)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_count->count = mavlink_msg_mission_count_get_count(msg);
|
||||
mission_count->target_system = mavlink_msg_mission_count_get_target_system(msg);
|
||||
mission_count->target_component = mavlink_msg_mission_count_get_target_component(msg);
|
||||
mission_count->mission_type = mavlink_msg_mission_count_get_mission_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_COUNT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_COUNT_LEN;
|
||||
memset(mission_count, 0, MAVLINK_MSG_ID_MISSION_COUNT_LEN);
|
||||
memcpy(mission_count, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_CURRENT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_CURRENT 42
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_current_t {
|
||||
uint16_t seq; /*< Sequence*/
|
||||
}) mavlink_mission_current_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_CURRENT_LEN 2
|
||||
#define MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN 2
|
||||
#define MAVLINK_MSG_ID_42_LEN 2
|
||||
#define MAVLINK_MSG_ID_42_MIN_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_CURRENT_CRC 28
|
||||
#define MAVLINK_MSG_ID_42_CRC 28
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_CURRENT { \
|
||||
42, \
|
||||
"MISSION_CURRENT", \
|
||||
1, \
|
||||
{ { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_CURRENT { \
|
||||
"MISSION_CURRENT", \
|
||||
1, \
|
||||
{ { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_current message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param seq Sequence
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
|
||||
#else
|
||||
mavlink_mission_current_t packet;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_current message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param seq Sequence
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
|
||||
#else
|
||||
mavlink_mission_current_t packet;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_current struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_current C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_current_t* mission_current)
|
||||
{
|
||||
return mavlink_msg_mission_current_pack(system_id, component_id, msg, mission_current->seq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_current struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_current C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_current_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_current_t* mission_current)
|
||||
{
|
||||
return mavlink_msg_mission_current_pack_chan(system_id, component_id, chan, msg, mission_current->seq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_current message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param seq Sequence
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_current_send(mavlink_channel_t chan, uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
|
||||
#else
|
||||
mavlink_mission_current_t packet;
|
||||
packet.seq = seq;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_current message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_current_send_struct(mavlink_channel_t chan, const mavlink_mission_current_t* mission_current)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_current_send(chan, mission_current->seq);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)mission_current, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_CURRENT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_current_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
|
||||
#else
|
||||
mavlink_mission_current_t *packet = (mavlink_mission_current_t *)msgbuf;
|
||||
packet->seq = seq;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)packet, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_CURRENT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field seq from mission_current message
|
||||
*
|
||||
* @return Sequence
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_current_get_seq(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_current message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_current C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_current_decode(const mavlink_message_t* msg, mavlink_mission_current_t* mission_current)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_current->seq = mavlink_msg_mission_current_get_seq(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_CURRENT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_CURRENT_LEN;
|
||||
memset(mission_current, 0, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
|
||||
memcpy(mission_current, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,563 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_ITEM PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM 39
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_item_t {
|
||||
float param1; /*< PARAM1, see MAV_CMD enum*/
|
||||
float param2; /*< PARAM2, see MAV_CMD enum*/
|
||||
float param3; /*< PARAM3, see MAV_CMD enum*/
|
||||
float param4; /*< PARAM4, see MAV_CMD enum*/
|
||||
float x; /*< PARAM5 / local: X coordinate, global: latitude*/
|
||||
float y; /*< PARAM6 / local: Y coordinate, global: longitude*/
|
||||
float z; /*< PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).*/
|
||||
uint16_t seq; /*< Sequence*/
|
||||
uint16_t command; /*< The scheduled action for the waypoint.*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t frame; /*< The coordinate system of the waypoint.*/
|
||||
uint8_t current; /*< false:0, true:1*/
|
||||
uint8_t autocontinue; /*< Autocontinue to next waypoint*/
|
||||
uint8_t mission_type; /*< Mission type.*/
|
||||
}) mavlink_mission_item_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM_LEN 38
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN 37
|
||||
#define MAVLINK_MSG_ID_39_LEN 38
|
||||
#define MAVLINK_MSG_ID_39_MIN_LEN 37
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM_CRC 254
|
||||
#define MAVLINK_MSG_ID_39_CRC 254
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_ITEM { \
|
||||
39, \
|
||||
"MISSION_ITEM", \
|
||||
15, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_t, target_component) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_t, seq) }, \
|
||||
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_t, frame) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_t, command) }, \
|
||||
{ "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_t, current) }, \
|
||||
{ "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \
|
||||
{ "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_t, param4) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mission_item_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mission_item_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_t, z) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_mission_item_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_ITEM { \
|
||||
"MISSION_ITEM", \
|
||||
15, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_t, target_component) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_t, seq) }, \
|
||||
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_t, frame) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_t, command) }, \
|
||||
{ "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_t, current) }, \
|
||||
{ "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \
|
||||
{ "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_t, param4) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mission_item_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mission_item_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_t, z) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_mission_item_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_item message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
* @param frame The coordinate system of the waypoint.
|
||||
* @param command The scheduled action for the waypoint.
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue Autocontinue to next waypoint
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: X coordinate, global: latitude
|
||||
* @param y PARAM6 / local: Y coordinate, global: longitude
|
||||
* @param z PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, x);
|
||||
_mav_put_float(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, seq);
|
||||
_mav_put_uint16_t(buf, 30, command);
|
||||
_mav_put_uint8_t(buf, 32, target_system);
|
||||
_mav_put_uint8_t(buf, 33, target_component);
|
||||
_mav_put_uint8_t(buf, 34, frame);
|
||||
_mav_put_uint8_t(buf, 35, current);
|
||||
_mav_put_uint8_t(buf, 36, autocontinue);
|
||||
_mav_put_uint8_t(buf, 37, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN);
|
||||
#else
|
||||
mavlink_mission_item_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.seq = seq;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_item message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
* @param frame The coordinate system of the waypoint.
|
||||
* @param command The scheduled action for the waypoint.
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue Autocontinue to next waypoint
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: X coordinate, global: latitude
|
||||
* @param y PARAM6 / local: Y coordinate, global: longitude
|
||||
* @param z PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,float x,float y,float z,uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, x);
|
||||
_mav_put_float(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, seq);
|
||||
_mav_put_uint16_t(buf, 30, command);
|
||||
_mav_put_uint8_t(buf, 32, target_system);
|
||||
_mav_put_uint8_t(buf, 33, target_component);
|
||||
_mav_put_uint8_t(buf, 34, frame);
|
||||
_mav_put_uint8_t(buf, 35, current);
|
||||
_mav_put_uint8_t(buf, 36, autocontinue);
|
||||
_mav_put_uint8_t(buf, 37, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN);
|
||||
#else
|
||||
mavlink_mission_item_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.seq = seq;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_item struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_item C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_item_t* mission_item)
|
||||
{
|
||||
return mavlink_msg_mission_item_pack(system_id, component_id, msg, mission_item->target_system, mission_item->target_component, mission_item->seq, mission_item->frame, mission_item->command, mission_item->current, mission_item->autocontinue, mission_item->param1, mission_item->param2, mission_item->param3, mission_item->param4, mission_item->x, mission_item->y, mission_item->z, mission_item->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_item struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_item C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_item_t* mission_item)
|
||||
{
|
||||
return mavlink_msg_mission_item_pack_chan(system_id, component_id, chan, msg, mission_item->target_system, mission_item->target_component, mission_item->seq, mission_item->frame, mission_item->command, mission_item->current, mission_item->autocontinue, mission_item->param1, mission_item->param2, mission_item->param3, mission_item->param4, mission_item->x, mission_item->y, mission_item->z, mission_item->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_item message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
* @param frame The coordinate system of the waypoint.
|
||||
* @param command The scheduled action for the waypoint.
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue Autocontinue to next waypoint
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: X coordinate, global: latitude
|
||||
* @param y PARAM6 / local: Y coordinate, global: longitude
|
||||
* @param z PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).
|
||||
* @param mission_type Mission type.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_item_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, x);
|
||||
_mav_put_float(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, seq);
|
||||
_mav_put_uint16_t(buf, 30, command);
|
||||
_mav_put_uint8_t(buf, 32, target_system);
|
||||
_mav_put_uint8_t(buf, 33, target_component);
|
||||
_mav_put_uint8_t(buf, 34, frame);
|
||||
_mav_put_uint8_t(buf, 35, current);
|
||||
_mav_put_uint8_t(buf, 36, autocontinue);
|
||||
_mav_put_uint8_t(buf, 37, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
|
||||
#else
|
||||
mavlink_mission_item_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.seq = seq;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_item message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_item_send_struct(mavlink_channel_t chan, const mavlink_mission_item_t* mission_item)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_item_send(chan, mission_item->target_system, mission_item->target_component, mission_item->seq, mission_item->frame, mission_item->command, mission_item->current, mission_item->autocontinue, mission_item->param1, mission_item->param2, mission_item->param3, mission_item->param4, mission_item->x, mission_item->y, mission_item->z, mission_item->mission_type);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)mission_item, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_ITEM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_item_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, x);
|
||||
_mav_put_float(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, seq);
|
||||
_mav_put_uint16_t(buf, 30, command);
|
||||
_mav_put_uint8_t(buf, 32, target_system);
|
||||
_mav_put_uint8_t(buf, 33, target_component);
|
||||
_mav_put_uint8_t(buf, 34, frame);
|
||||
_mav_put_uint8_t(buf, 35, current);
|
||||
_mav_put_uint8_t(buf, 36, autocontinue);
|
||||
_mav_put_uint8_t(buf, 37, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
|
||||
#else
|
||||
mavlink_mission_item_t *packet = (mavlink_mission_item_t *)msgbuf;
|
||||
packet->param1 = param1;
|
||||
packet->param2 = param2;
|
||||
packet->param3 = param3;
|
||||
packet->param4 = param4;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->seq = seq;
|
||||
packet->command = command;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->frame = frame;
|
||||
packet->current = current;
|
||||
packet->autocontinue = autocontinue;
|
||||
packet->mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_ITEM UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mission_item message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mission_item message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field seq from mission_item message
|
||||
*
|
||||
* @return Sequence
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_get_seq(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field frame from mission_item message
|
||||
*
|
||||
* @return The coordinate system of the waypoint.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_get_frame(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field command from mission_item message
|
||||
*
|
||||
* @return The scheduled action for the waypoint.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_get_command(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current from mission_item message
|
||||
*
|
||||
* @return false:0, true:1
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_get_current(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 35);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field autocontinue from mission_item message
|
||||
*
|
||||
* @return Autocontinue to next waypoint
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_get_autocontinue(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param1 from mission_item message
|
||||
*
|
||||
* @return PARAM1, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_param1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param2 from mission_item message
|
||||
*
|
||||
* @return PARAM2, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_param2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param3 from mission_item message
|
||||
*
|
||||
* @return PARAM3, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_param3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param4 from mission_item message
|
||||
*
|
||||
* @return PARAM4, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_param4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from mission_item message
|
||||
*
|
||||
* @return PARAM5 / local: X coordinate, global: latitude
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from mission_item message
|
||||
*
|
||||
* @return PARAM6 / local: Y coordinate, global: longitude
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from mission_item message
|
||||
*
|
||||
* @return PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mission_type from mission_item message
|
||||
*
|
||||
* @return Mission type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_get_mission_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 37);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_item message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_item C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_item_decode(const mavlink_message_t* msg, mavlink_mission_item_t* mission_item)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_item->param1 = mavlink_msg_mission_item_get_param1(msg);
|
||||
mission_item->param2 = mavlink_msg_mission_item_get_param2(msg);
|
||||
mission_item->param3 = mavlink_msg_mission_item_get_param3(msg);
|
||||
mission_item->param4 = mavlink_msg_mission_item_get_param4(msg);
|
||||
mission_item->x = mavlink_msg_mission_item_get_x(msg);
|
||||
mission_item->y = mavlink_msg_mission_item_get_y(msg);
|
||||
mission_item->z = mavlink_msg_mission_item_get_z(msg);
|
||||
mission_item->seq = mavlink_msg_mission_item_get_seq(msg);
|
||||
mission_item->command = mavlink_msg_mission_item_get_command(msg);
|
||||
mission_item->target_system = mavlink_msg_mission_item_get_target_system(msg);
|
||||
mission_item->target_component = mavlink_msg_mission_item_get_target_component(msg);
|
||||
mission_item->frame = mavlink_msg_mission_item_get_frame(msg);
|
||||
mission_item->current = mavlink_msg_mission_item_get_current(msg);
|
||||
mission_item->autocontinue = mavlink_msg_mission_item_get_autocontinue(msg);
|
||||
mission_item->mission_type = mavlink_msg_mission_item_get_mission_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ITEM_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ITEM_LEN;
|
||||
memset(mission_item, 0, MAVLINK_MSG_ID_MISSION_ITEM_LEN);
|
||||
memcpy(mission_item, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,563 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_ITEM_INT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM_INT 73
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_item_int_t {
|
||||
float param1; /*< PARAM1, see MAV_CMD enum*/
|
||||
float param2; /*< PARAM2, see MAV_CMD enum*/
|
||||
float param3; /*< PARAM3, see MAV_CMD enum*/
|
||||
float param4; /*< PARAM4, see MAV_CMD enum*/
|
||||
int32_t x; /*< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*/
|
||||
int32_t y; /*< PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7*/
|
||||
float z; /*< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.*/
|
||||
uint16_t seq; /*< Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).*/
|
||||
uint16_t command; /*< The scheduled action for the waypoint.*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t frame; /*< The coordinate system of the waypoint.*/
|
||||
uint8_t current; /*< false:0, true:1*/
|
||||
uint8_t autocontinue; /*< Autocontinue to next waypoint*/
|
||||
uint8_t mission_type; /*< Mission type.*/
|
||||
}) mavlink_mission_item_int_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN 38
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN 37
|
||||
#define MAVLINK_MSG_ID_73_LEN 38
|
||||
#define MAVLINK_MSG_ID_73_MIN_LEN 37
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC 38
|
||||
#define MAVLINK_MSG_ID_73_CRC 38
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT { \
|
||||
73, \
|
||||
"MISSION_ITEM_INT", \
|
||||
15, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_int_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_int_t, target_component) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_int_t, seq) }, \
|
||||
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_int_t, frame) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_int_t, command) }, \
|
||||
{ "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_int_t, current) }, \
|
||||
{ "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_int_t, autocontinue) }, \
|
||||
{ "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_int_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_int_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_int_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_int_t, param4) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_mission_item_int_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_mission_item_int_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_int_t, z) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_mission_item_int_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT { \
|
||||
"MISSION_ITEM_INT", \
|
||||
15, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_int_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_int_t, target_component) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_int_t, seq) }, \
|
||||
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_int_t, frame) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_int_t, command) }, \
|
||||
{ "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_int_t, current) }, \
|
||||
{ "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_int_t, autocontinue) }, \
|
||||
{ "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_int_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_int_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_int_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_int_t, param4) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_mission_item_int_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_mission_item_int_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_int_t, z) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_mission_item_int_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_item_int message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).
|
||||
* @param frame The coordinate system of the waypoint.
|
||||
* @param command The scheduled action for the waypoint.
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue Autocontinue to next waypoint
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
* @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7
|
||||
* @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, seq);
|
||||
_mav_put_uint16_t(buf, 30, command);
|
||||
_mav_put_uint8_t(buf, 32, target_system);
|
||||
_mav_put_uint8_t(buf, 33, target_component);
|
||||
_mav_put_uint8_t(buf, 34, frame);
|
||||
_mav_put_uint8_t(buf, 35, current);
|
||||
_mav_put_uint8_t(buf, 36, autocontinue);
|
||||
_mav_put_uint8_t(buf, 37, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN);
|
||||
#else
|
||||
mavlink_mission_item_int_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.seq = seq;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_item_int message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).
|
||||
* @param frame The coordinate system of the waypoint.
|
||||
* @param command The scheduled action for the waypoint.
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue Autocontinue to next waypoint
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
* @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7
|
||||
* @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,int32_t x,int32_t y,float z,uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, seq);
|
||||
_mav_put_uint16_t(buf, 30, command);
|
||||
_mav_put_uint8_t(buf, 32, target_system);
|
||||
_mav_put_uint8_t(buf, 33, target_component);
|
||||
_mav_put_uint8_t(buf, 34, frame);
|
||||
_mav_put_uint8_t(buf, 35, current);
|
||||
_mav_put_uint8_t(buf, 36, autocontinue);
|
||||
_mav_put_uint8_t(buf, 37, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN);
|
||||
#else
|
||||
mavlink_mission_item_int_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.seq = seq;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_item_int struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_item_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_item_int_t* mission_item_int)
|
||||
{
|
||||
return mavlink_msg_mission_item_int_pack(system_id, component_id, msg, mission_item_int->target_system, mission_item_int->target_component, mission_item_int->seq, mission_item_int->frame, mission_item_int->command, mission_item_int->current, mission_item_int->autocontinue, mission_item_int->param1, mission_item_int->param2, mission_item_int->param3, mission_item_int->param4, mission_item_int->x, mission_item_int->y, mission_item_int->z, mission_item_int->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_item_int struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_item_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_item_int_t* mission_item_int)
|
||||
{
|
||||
return mavlink_msg_mission_item_int_pack_chan(system_id, component_id, chan, msg, mission_item_int->target_system, mission_item_int->target_component, mission_item_int->seq, mission_item_int->frame, mission_item_int->command, mission_item_int->current, mission_item_int->autocontinue, mission_item_int->param1, mission_item_int->param2, mission_item_int->param3, mission_item_int->param4, mission_item_int->x, mission_item_int->y, mission_item_int->z, mission_item_int->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_item_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).
|
||||
* @param frame The coordinate system of the waypoint.
|
||||
* @param command The scheduled action for the waypoint.
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue Autocontinue to next waypoint
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
* @param y PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7
|
||||
* @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
|
||||
* @param mission_type Mission type.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_item_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, seq);
|
||||
_mav_put_uint16_t(buf, 30, command);
|
||||
_mav_put_uint8_t(buf, 32, target_system);
|
||||
_mav_put_uint8_t(buf, 33, target_component);
|
||||
_mav_put_uint8_t(buf, 34, frame);
|
||||
_mav_put_uint8_t(buf, 35, current);
|
||||
_mav_put_uint8_t(buf, 36, autocontinue);
|
||||
_mav_put_uint8_t(buf, 37, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
|
||||
#else
|
||||
mavlink_mission_item_int_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.seq = seq;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_item_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_item_int_send_struct(mavlink_channel_t chan, const mavlink_mission_item_int_t* mission_item_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_item_int_send(chan, mission_item_int->target_system, mission_item_int->target_component, mission_item_int->seq, mission_item_int->frame, mission_item_int->command, mission_item_int->current, mission_item_int->autocontinue, mission_item_int->param1, mission_item_int->param2, mission_item_int->param3, mission_item_int->param4, mission_item_int->x, mission_item_int->y, mission_item_int->z, mission_item_int->mission_type);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)mission_item_int, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_item_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, seq);
|
||||
_mav_put_uint16_t(buf, 30, command);
|
||||
_mav_put_uint8_t(buf, 32, target_system);
|
||||
_mav_put_uint8_t(buf, 33, target_component);
|
||||
_mav_put_uint8_t(buf, 34, frame);
|
||||
_mav_put_uint8_t(buf, 35, current);
|
||||
_mav_put_uint8_t(buf, 36, autocontinue);
|
||||
_mav_put_uint8_t(buf, 37, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
|
||||
#else
|
||||
mavlink_mission_item_int_t *packet = (mavlink_mission_item_int_t *)msgbuf;
|
||||
packet->param1 = param1;
|
||||
packet->param2 = param2;
|
||||
packet->param3 = param3;
|
||||
packet->param4 = param4;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->seq = seq;
|
||||
packet->command = command;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->frame = frame;
|
||||
packet->current = current;
|
||||
packet->autocontinue = autocontinue;
|
||||
packet->mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_ITEM_INT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mission_item_int message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_int_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mission_item_int message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_int_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field seq from mission_item_int message
|
||||
*
|
||||
* @return Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_int_get_seq(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field frame from mission_item_int message
|
||||
*
|
||||
* @return The coordinate system of the waypoint.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_int_get_frame(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field command from mission_item_int message
|
||||
*
|
||||
* @return The scheduled action for the waypoint.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_int_get_command(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current from mission_item_int message
|
||||
*
|
||||
* @return false:0, true:1
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_int_get_current(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 35);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field autocontinue from mission_item_int message
|
||||
*
|
||||
* @return Autocontinue to next waypoint
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_int_get_autocontinue(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param1 from mission_item_int message
|
||||
*
|
||||
* @return PARAM1, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_int_get_param1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param2 from mission_item_int message
|
||||
*
|
||||
* @return PARAM2, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_int_get_param2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param3 from mission_item_int message
|
||||
*
|
||||
* @return PARAM3, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_int_get_param3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param4 from mission_item_int message
|
||||
*
|
||||
* @return PARAM4, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_int_get_param4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from mission_item_int message
|
||||
*
|
||||
* @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_mission_item_int_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from mission_item_int message
|
||||
*
|
||||
* @return PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_mission_item_int_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from mission_item_int message
|
||||
*
|
||||
* @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_int_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mission_type from mission_item_int message
|
||||
*
|
||||
* @return Mission type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_item_int_get_mission_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 37);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_item_int message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_item_int C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_item_int_decode(const mavlink_message_t* msg, mavlink_mission_item_int_t* mission_item_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_item_int->param1 = mavlink_msg_mission_item_int_get_param1(msg);
|
||||
mission_item_int->param2 = mavlink_msg_mission_item_int_get_param2(msg);
|
||||
mission_item_int->param3 = mavlink_msg_mission_item_int_get_param3(msg);
|
||||
mission_item_int->param4 = mavlink_msg_mission_item_int_get_param4(msg);
|
||||
mission_item_int->x = mavlink_msg_mission_item_int_get_x(msg);
|
||||
mission_item_int->y = mavlink_msg_mission_item_int_get_y(msg);
|
||||
mission_item_int->z = mavlink_msg_mission_item_int_get_z(msg);
|
||||
mission_item_int->seq = mavlink_msg_mission_item_int_get_seq(msg);
|
||||
mission_item_int->command = mavlink_msg_mission_item_int_get_command(msg);
|
||||
mission_item_int->target_system = mavlink_msg_mission_item_int_get_target_system(msg);
|
||||
mission_item_int->target_component = mavlink_msg_mission_item_int_get_target_component(msg);
|
||||
mission_item_int->frame = mavlink_msg_mission_item_int_get_frame(msg);
|
||||
mission_item_int->current = mavlink_msg_mission_item_int_get_current(msg);
|
||||
mission_item_int->autocontinue = mavlink_msg_mission_item_int_get_autocontinue(msg);
|
||||
mission_item_int->mission_type = mavlink_msg_mission_item_int_get_mission_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN;
|
||||
memset(mission_item_int, 0, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN);
|
||||
memcpy(mission_item_int, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_ITEM_REACHED PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM_REACHED 46
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_item_reached_t {
|
||||
uint16_t seq; /*< Sequence*/
|
||||
}) mavlink_mission_item_reached_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN 2
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN 2
|
||||
#define MAVLINK_MSG_ID_46_LEN 2
|
||||
#define MAVLINK_MSG_ID_46_MIN_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC 11
|
||||
#define MAVLINK_MSG_ID_46_CRC 11
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED { \
|
||||
46, \
|
||||
"MISSION_ITEM_REACHED", \
|
||||
1, \
|
||||
{ { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_item_reached_t, seq) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED { \
|
||||
"MISSION_ITEM_REACHED", \
|
||||
1, \
|
||||
{ { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_item_reached_t, seq) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_item_reached message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param seq Sequence
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
|
||||
#else
|
||||
mavlink_mission_item_reached_t packet;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_item_reached message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param seq Sequence
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_reached_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
|
||||
#else
|
||||
mavlink_mission_item_reached_t packet;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_item_reached struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_item_reached C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_reached_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_item_reached_t* mission_item_reached)
|
||||
{
|
||||
return mavlink_msg_mission_item_reached_pack(system_id, component_id, msg, mission_item_reached->seq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_item_reached struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_item_reached C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_reached_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_item_reached_t* mission_item_reached)
|
||||
{
|
||||
return mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, chan, msg, mission_item_reached->seq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_item_reached message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param seq Sequence
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_item_reached_send(mavlink_channel_t chan, uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
|
||||
#else
|
||||
mavlink_mission_item_reached_t packet;
|
||||
packet.seq = seq;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_item_reached message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_item_reached_send_struct(mavlink_channel_t chan, const mavlink_mission_item_reached_t* mission_item_reached)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_item_reached_send(chan, mission_item_reached->seq);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)mission_item_reached, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_item_reached_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
|
||||
#else
|
||||
mavlink_mission_item_reached_t *packet = (mavlink_mission_item_reached_t *)msgbuf;
|
||||
packet->seq = seq;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_ITEM_REACHED UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field seq from mission_item_reached message
|
||||
*
|
||||
* @return Sequence
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_reached_get_seq(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_item_reached message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_item_reached C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_item_reached_decode(const mavlink_message_t* msg, mavlink_mission_item_reached_t* mission_item_reached)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_item_reached->seq = mavlink_msg_mission_item_reached_get_seq(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN;
|
||||
memset(mission_item_reached, 0, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
|
||||
memcpy(mission_item_reached, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_REQUEST PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST 40
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_request_t {
|
||||
uint16_t seq; /*< Sequence*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t mission_type; /*< Mission type.*/
|
||||
}) mavlink_mission_request_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_LEN 5
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN 4
|
||||
#define MAVLINK_MSG_ID_40_LEN 5
|
||||
#define MAVLINK_MSG_ID_40_MIN_LEN 4
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_CRC 230
|
||||
#define MAVLINK_MSG_ID_40_CRC 230
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST { \
|
||||
40, \
|
||||
"MISSION_REQUEST", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_t, target_component) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST { \
|
||||
"MISSION_REQUEST", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_t, target_component) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_request message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN);
|
||||
#else
|
||||
mavlink_mission_request_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_request message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN);
|
||||
#else
|
||||
mavlink_mission_request_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_request struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_request C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_t* mission_request)
|
||||
{
|
||||
return mavlink_msg_mission_request_pack(system_id, component_id, msg, mission_request->target_system, mission_request->target_component, mission_request->seq, mission_request->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_request struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_request C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_t* mission_request)
|
||||
{
|
||||
return mavlink_msg_mission_request_pack_chan(system_id, component_id, chan, msg, mission_request->target_system, mission_request->target_component, mission_request->seq, mission_request->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_request message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
* @param mission_type Mission type.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_request_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
|
||||
#else
|
||||
mavlink_mission_request_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_request message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_send_struct(mavlink_channel_t chan, const mavlink_mission_request_t* mission_request)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_request_send(chan, mission_request->target_system, mission_request->target_component, mission_request->seq, mission_request->mission_type);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)mission_request, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_REQUEST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
|
||||
#else
|
||||
mavlink_mission_request_t *packet = (mavlink_mission_request_t *)msgbuf;
|
||||
packet->seq = seq;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_REQUEST UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mission_request message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mission_request message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field seq from mission_request message
|
||||
*
|
||||
* @return Sequence
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_get_seq(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mission_type from mission_request message
|
||||
*
|
||||
* @return Mission type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_get_mission_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_request message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_request C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_decode(const mavlink_message_t* msg, mavlink_mission_request_t* mission_request)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_request->seq = mavlink_msg_mission_request_get_seq(msg);
|
||||
mission_request->target_system = mavlink_msg_mission_request_get_target_system(msg);
|
||||
mission_request->target_component = mavlink_msg_mission_request_get_target_component(msg);
|
||||
mission_request->mission_type = mavlink_msg_mission_request_get_mission_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_LEN;
|
||||
memset(mission_request, 0, MAVLINK_MSG_ID_MISSION_REQUEST_LEN);
|
||||
memcpy(mission_request, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_REQUEST_INT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_INT 51
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_request_int_t {
|
||||
uint16_t seq; /*< Sequence*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t mission_type; /*< Mission type.*/
|
||||
}) mavlink_mission_request_int_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN 5
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN 4
|
||||
#define MAVLINK_MSG_ID_51_LEN 5
|
||||
#define MAVLINK_MSG_ID_51_MIN_LEN 4
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC 196
|
||||
#define MAVLINK_MSG_ID_51_CRC 196
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT { \
|
||||
51, \
|
||||
"MISSION_REQUEST_INT", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_int_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_int_t, target_component) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_int_t, seq) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_int_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT { \
|
||||
"MISSION_REQUEST_INT", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_int_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_int_t, target_component) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_int_t, seq) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_int_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_request_int message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN);
|
||||
#else
|
||||
mavlink_mission_request_int_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_request_int message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN);
|
||||
#else
|
||||
mavlink_mission_request_int_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_request_int struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_request_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_int_t* mission_request_int)
|
||||
{
|
||||
return mavlink_msg_mission_request_int_pack(system_id, component_id, msg, mission_request_int->target_system, mission_request_int->target_component, mission_request_int->seq, mission_request_int->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_request_int struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_request_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_int_t* mission_request_int)
|
||||
{
|
||||
return mavlink_msg_mission_request_int_pack_chan(system_id, component_id, chan, msg, mission_request_int->target_system, mission_request_int->target_component, mission_request_int->seq, mission_request_int->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_request_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
* @param mission_type Mission type.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_request_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
|
||||
#else
|
||||
mavlink_mission_request_int_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_request_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_int_send_struct(mavlink_channel_t chan, const mavlink_mission_request_int_t* mission_request_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_request_int_send(chan, mission_request_int->target_system, mission_request_int->target_component, mission_request_int->seq, mission_request_int->mission_type);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)mission_request_int, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_uint8_t(buf, 4, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
|
||||
#else
|
||||
mavlink_mission_request_int_t *packet = (mavlink_mission_request_int_t *)msgbuf;
|
||||
packet->seq = seq;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_REQUEST_INT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mission_request_int message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_int_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mission_request_int message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_int_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field seq from mission_request_int message
|
||||
*
|
||||
* @return Sequence
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_int_get_seq(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mission_type from mission_request_int message
|
||||
*
|
||||
* @return Mission type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_int_get_mission_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_request_int message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_request_int C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_int_decode(const mavlink_message_t* msg, mavlink_mission_request_int_t* mission_request_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_request_int->seq = mavlink_msg_mission_request_int_get_seq(msg);
|
||||
mission_request_int->target_system = mavlink_msg_mission_request_int_get_target_system(msg);
|
||||
mission_request_int->target_component = mavlink_msg_mission_request_int_get_target_component(msg);
|
||||
mission_request_int->mission_type = mavlink_msg_mission_request_int_get_mission_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN;
|
||||
memset(mission_request_int, 0, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN);
|
||||
memcpy(mission_request_int, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_REQUEST_LIST PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST 43
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_request_list_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t mission_type; /*< Mission type.*/
|
||||
}) mavlink_mission_request_list_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN 3
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN 2
|
||||
#define MAVLINK_MSG_ID_43_LEN 3
|
||||
#define MAVLINK_MSG_ID_43_MIN_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC 132
|
||||
#define MAVLINK_MSG_ID_43_CRC 132
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST { \
|
||||
43, \
|
||||
"MISSION_REQUEST_LIST", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_request_list_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_request_list_t, target_component) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_list_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST { \
|
||||
"MISSION_REQUEST_LIST", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_request_list_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_request_list_t, target_component) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_list_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_request_list message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
|
||||
#else
|
||||
mavlink_mission_request_list_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_request_list message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
|
||||
#else
|
||||
mavlink_mission_request_list_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_request_list struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_request_list C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_list_t* mission_request_list)
|
||||
{
|
||||
return mavlink_msg_mission_request_list_pack(system_id, component_id, msg, mission_request_list->target_system, mission_request_list->target_component, mission_request_list->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_request_list struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_request_list C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_list_t* mission_request_list)
|
||||
{
|
||||
return mavlink_msg_mission_request_list_pack_chan(system_id, component_id, chan, msg, mission_request_list->target_system, mission_request_list->target_component, mission_request_list->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_request_list message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mission_type Mission type.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
|
||||
#else
|
||||
mavlink_mission_request_list_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_request_list message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_list_send_struct(mavlink_channel_t chan, const mavlink_mission_request_list_t* mission_request_list)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_request_list_send(chan, mission_request_list->target_system, mission_request_list->target_component, mission_request_list->mission_type);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)mission_request_list, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
|
||||
#else
|
||||
mavlink_mission_request_list_t *packet = (mavlink_mission_request_list_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_REQUEST_LIST UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mission_request_list message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_list_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mission_request_list message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_list_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mission_type from mission_request_list message
|
||||
*
|
||||
* @return Mission type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_list_get_mission_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_request_list message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_request_list C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_list_decode(const mavlink_message_t* msg, mavlink_mission_request_list_t* mission_request_list)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_request_list->target_system = mavlink_msg_mission_request_list_get_target_system(msg);
|
||||
mission_request_list->target_component = mavlink_msg_mission_request_list_get_target_component(msg);
|
||||
mission_request_list->mission_type = mavlink_msg_mission_request_list_get_mission_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN;
|
||||
memset(mission_request_list, 0, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
|
||||
memcpy(mission_request_list, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_REQUEST_PARTIAL_LIST PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST 37
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_request_partial_list_t {
|
||||
int16_t start_index; /*< Start index, 0 by default*/
|
||||
int16_t end_index; /*< End index, -1 by default (-1: send list to end). Else a valid index of the list*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t mission_type; /*< Mission type.*/
|
||||
}) mavlink_mission_request_partial_list_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN 7
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN 6
|
||||
#define MAVLINK_MSG_ID_37_LEN 7
|
||||
#define MAVLINK_MSG_ID_37_MIN_LEN 6
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC 212
|
||||
#define MAVLINK_MSG_ID_37_CRC 212
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST { \
|
||||
37, \
|
||||
"MISSION_REQUEST_PARTIAL_LIST", \
|
||||
5, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_request_partial_list_t, target_component) }, \
|
||||
{ "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \
|
||||
{ "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_mission_request_partial_list_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST { \
|
||||
"MISSION_REQUEST_PARTIAL_LIST", \
|
||||
5, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_request_partial_list_t, target_component) }, \
|
||||
{ "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \
|
||||
{ "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_mission_request_partial_list_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_request_partial_list message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start_index Start index, 0 by default
|
||||
* @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN];
|
||||
_mav_put_int16_t(buf, 0, start_index);
|
||||
_mav_put_int16_t(buf, 2, end_index);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN);
|
||||
#else
|
||||
mavlink_mission_request_partial_list_t packet;
|
||||
packet.start_index = start_index;
|
||||
packet.end_index = end_index;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_request_partial_list message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start_index Start index, 0 by default
|
||||
* @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index,uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN];
|
||||
_mav_put_int16_t(buf, 0, start_index);
|
||||
_mav_put_int16_t(buf, 2, end_index);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN);
|
||||
#else
|
||||
mavlink_mission_request_partial_list_t packet;
|
||||
packet.start_index = start_index;
|
||||
packet.end_index = end_index;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_request_partial_list struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_request_partial_list C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_partial_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_partial_list_t* mission_request_partial_list)
|
||||
{
|
||||
return mavlink_msg_mission_request_partial_list_pack(system_id, component_id, msg, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index, mission_request_partial_list->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_request_partial_list struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_request_partial_list C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_request_partial_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_partial_list_t* mission_request_partial_list)
|
||||
{
|
||||
return mavlink_msg_mission_request_partial_list_pack_chan(system_id, component_id, chan, msg, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index, mission_request_partial_list->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_request_partial_list message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start_index Start index, 0 by default
|
||||
* @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list
|
||||
* @param mission_type Mission type.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_request_partial_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN];
|
||||
_mav_put_int16_t(buf, 0, start_index);
|
||||
_mav_put_int16_t(buf, 2, end_index);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
|
||||
#else
|
||||
mavlink_mission_request_partial_list_t packet;
|
||||
packet.start_index = start_index;
|
||||
packet.end_index = end_index;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_request_partial_list message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_partial_list_send_struct(mavlink_channel_t chan, const mavlink_mission_request_partial_list_t* mission_request_partial_list)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_request_partial_list_send(chan, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index, mission_request_partial_list->mission_type);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)mission_request_partial_list, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_partial_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int16_t(buf, 0, start_index);
|
||||
_mav_put_int16_t(buf, 2, end_index);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
|
||||
#else
|
||||
mavlink_mission_request_partial_list_t *packet = (mavlink_mission_request_partial_list_t *)msgbuf;
|
||||
packet->start_index = start_index;
|
||||
packet->end_index = end_index;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_REQUEST_PARTIAL_LIST UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mission_request_partial_list message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mission_request_partial_list message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field start_index from mission_request_partial_list message
|
||||
*
|
||||
* @return Start index, 0 by default
|
||||
*/
|
||||
static inline int16_t mavlink_msg_mission_request_partial_list_get_start_index(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field end_index from mission_request_partial_list message
|
||||
*
|
||||
* @return End index, -1 by default (-1: send list to end). Else a valid index of the list
|
||||
*/
|
||||
static inline int16_t mavlink_msg_mission_request_partial_list_get_end_index(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mission_type from mission_request_partial_list message
|
||||
*
|
||||
* @return Mission type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_request_partial_list_get_mission_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_request_partial_list message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_request_partial_list C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_request_partial_list_decode(const mavlink_message_t* msg, mavlink_mission_request_partial_list_t* mission_request_partial_list)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_request_partial_list->start_index = mavlink_msg_mission_request_partial_list_get_start_index(msg);
|
||||
mission_request_partial_list->end_index = mavlink_msg_mission_request_partial_list_get_end_index(msg);
|
||||
mission_request_partial_list->target_system = mavlink_msg_mission_request_partial_list_get_target_system(msg);
|
||||
mission_request_partial_list->target_component = mavlink_msg_mission_request_partial_list_get_target_component(msg);
|
||||
mission_request_partial_list->mission_type = mavlink_msg_mission_request_partial_list_get_mission_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN;
|
||||
memset(mission_request_partial_list, 0, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN);
|
||||
memcpy(mission_request_partial_list, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_SET_CURRENT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_SET_CURRENT 41
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_set_current_t {
|
||||
uint16_t seq; /*< Sequence*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
}) mavlink_mission_set_current_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN 4
|
||||
#define MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN 4
|
||||
#define MAVLINK_MSG_ID_41_LEN 4
|
||||
#define MAVLINK_MSG_ID_41_MIN_LEN 4
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC 28
|
||||
#define MAVLINK_MSG_ID_41_CRC 28
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT { \
|
||||
41, \
|
||||
"MISSION_SET_CURRENT", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_set_current_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_set_current_t, target_component) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT { \
|
||||
"MISSION_SET_CURRENT", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_set_current_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_set_current_t, target_component) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_set_current message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_set_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN);
|
||||
#else
|
||||
mavlink_mission_set_current_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_set_current message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_set_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN);
|
||||
#else
|
||||
mavlink_mission_set_current_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_set_current struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_set_current C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_set_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_set_current_t* mission_set_current)
|
||||
{
|
||||
return mavlink_msg_mission_set_current_pack(system_id, component_id, msg, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_set_current struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_set_current C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_set_current_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_set_current_t* mission_set_current)
|
||||
{
|
||||
return mavlink_msg_mission_set_current_pack_chan(system_id, component_id, chan, msg, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_set_current message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seq Sequence
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_set_current_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
|
||||
#else
|
||||
mavlink_mission_set_current_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_set_current message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_set_current_send_struct(mavlink_channel_t chan, const mavlink_mission_set_current_t* mission_set_current)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_set_current_send(chan, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)mission_set_current, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_set_current_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
|
||||
#else
|
||||
mavlink_mission_set_current_t *packet = (mavlink_mission_set_current_t *)msgbuf;
|
||||
packet->seq = seq;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_SET_CURRENT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mission_set_current message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_set_current_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mission_set_current message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_set_current_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field seq from mission_set_current message
|
||||
*
|
||||
* @return Sequence
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_set_current_get_seq(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_set_current message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_set_current C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_set_current_decode(const mavlink_message_t* msg, mavlink_mission_set_current_t* mission_set_current)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_set_current->seq = mavlink_msg_mission_set_current_get_seq(msg);
|
||||
mission_set_current->target_system = mavlink_msg_mission_set_current_get_target_system(msg);
|
||||
mission_set_current->target_component = mavlink_msg_mission_set_current_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN;
|
||||
memset(mission_set_current, 0, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN);
|
||||
memcpy(mission_set_current, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
#pragma once
|
||||
// MESSAGE MISSION_WRITE_PARTIAL_LIST PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST 38
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mission_write_partial_list_t {
|
||||
int16_t start_index; /*< Start index, 0 by default and smaller / equal to the largest index of the current onboard list.*/
|
||||
int16_t end_index; /*< End index, equal or greater than start index.*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t mission_type; /*< Mission type.*/
|
||||
}) mavlink_mission_write_partial_list_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN 7
|
||||
#define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN 6
|
||||
#define MAVLINK_MSG_ID_38_LEN 7
|
||||
#define MAVLINK_MSG_ID_38_MIN_LEN 6
|
||||
|
||||
#define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC 9
|
||||
#define MAVLINK_MSG_ID_38_CRC 9
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST { \
|
||||
38, \
|
||||
"MISSION_WRITE_PARTIAL_LIST", \
|
||||
5, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_write_partial_list_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_write_partial_list_t, target_component) }, \
|
||||
{ "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \
|
||||
{ "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_write_partial_list_t, end_index) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_mission_write_partial_list_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST { \
|
||||
"MISSION_WRITE_PARTIAL_LIST", \
|
||||
5, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_write_partial_list_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_write_partial_list_t, target_component) }, \
|
||||
{ "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \
|
||||
{ "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_write_partial_list_t, end_index) }, \
|
||||
{ "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_mission_write_partial_list_t, mission_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_write_partial_list message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start_index Start index, 0 by default and smaller / equal to the largest index of the current onboard list.
|
||||
* @param end_index End index, equal or greater than start index.
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN];
|
||||
_mav_put_int16_t(buf, 0, start_index);
|
||||
_mav_put_int16_t(buf, 2, end_index);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
|
||||
#else
|
||||
mavlink_mission_write_partial_list_t packet;
|
||||
packet.start_index = start_index;
|
||||
packet.end_index = end_index;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mission_write_partial_list message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start_index Start index, 0 by default and smaller / equal to the largest index of the current onboard list.
|
||||
* @param end_index End index, equal or greater than start index.
|
||||
* @param mission_type Mission type.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index,uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN];
|
||||
_mav_put_int16_t(buf, 0, start_index);
|
||||
_mav_put_int16_t(buf, 2, end_index);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, mission_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
|
||||
#else
|
||||
mavlink_mission_write_partial_list_t packet;
|
||||
packet.start_index = start_index;
|
||||
packet.end_index = end_index;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_write_partial_list struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_write_partial_list C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_write_partial_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_write_partial_list_t* mission_write_partial_list)
|
||||
{
|
||||
return mavlink_msg_mission_write_partial_list_pack(system_id, component_id, msg, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index, mission_write_partial_list->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mission_write_partial_list struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mission_write_partial_list C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_write_partial_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_write_partial_list_t* mission_write_partial_list)
|
||||
{
|
||||
return mavlink_msg_mission_write_partial_list_pack_chan(system_id, component_id, chan, msg, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index, mission_write_partial_list->mission_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_write_partial_list message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start_index Start index, 0 by default and smaller / equal to the largest index of the current onboard list.
|
||||
* @param end_index End index, equal or greater than start index.
|
||||
* @param mission_type Mission type.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mission_write_partial_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN];
|
||||
_mav_put_int16_t(buf, 0, start_index);
|
||||
_mav_put_int16_t(buf, 2, end_index);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
|
||||
#else
|
||||
mavlink_mission_write_partial_list_t packet;
|
||||
packet.start_index = start_index;
|
||||
packet.end_index = end_index;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mission_write_partial_list message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mission_write_partial_list_send_struct(mavlink_channel_t chan, const mavlink_mission_write_partial_list_t* mission_write_partial_list)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mission_write_partial_list_send(chan, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index, mission_write_partial_list->mission_type);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)mission_write_partial_list, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mission_write_partial_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index, uint8_t mission_type)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int16_t(buf, 0, start_index);
|
||||
_mav_put_int16_t(buf, 2, end_index);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, mission_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
|
||||
#else
|
||||
mavlink_mission_write_partial_list_t *packet = (mavlink_mission_write_partial_list_t *)msgbuf;
|
||||
packet->start_index = start_index;
|
||||
packet->end_index = end_index;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->mission_type = mission_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MISSION_WRITE_PARTIAL_LIST UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mission_write_partial_list message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mission_write_partial_list message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field start_index from mission_write_partial_list message
|
||||
*
|
||||
* @return Start index, 0 by default and smaller / equal to the largest index of the current onboard list.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_mission_write_partial_list_get_start_index(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field end_index from mission_write_partial_list message
|
||||
*
|
||||
* @return End index, equal or greater than start index.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_mission_write_partial_list_get_end_index(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mission_type from mission_write_partial_list message
|
||||
*
|
||||
* @return Mission type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mission_write_partial_list_get_mission_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mission_write_partial_list message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mission_write_partial_list C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mission_write_partial_list_decode(const mavlink_message_t* msg, mavlink_mission_write_partial_list_t* mission_write_partial_list)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mission_write_partial_list->start_index = mavlink_msg_mission_write_partial_list_get_start_index(msg);
|
||||
mission_write_partial_list->end_index = mavlink_msg_mission_write_partial_list_get_end_index(msg);
|
||||
mission_write_partial_list->target_system = mavlink_msg_mission_write_partial_list_get_target_system(msg);
|
||||
mission_write_partial_list->target_component = mavlink_msg_mission_write_partial_list_get_target_component(msg);
|
||||
mission_write_partial_list->mission_type = mavlink_msg_mission_write_partial_list_get_mission_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN;
|
||||
memset(mission_write_partial_list, 0, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
|
||||
memcpy(mission_write_partial_list, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
#pragma once
|
||||
// MESSAGE MOUNT_ORIENTATION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_ORIENTATION 265
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mount_orientation_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
float roll; /*< [deg] Roll in global frame (set to NaN for invalid).*/
|
||||
float pitch; /*< [deg] Pitch in global frame (set to NaN for invalid).*/
|
||||
float yaw; /*< [deg] Yaw relative to vehicle(set to NaN for invalid).*/
|
||||
float yaw_absolute; /*< [deg] Yaw in absolute frame, North is 0 (set to NaN for invalid).*/
|
||||
}) mavlink_mount_orientation_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN 20
|
||||
#define MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN 16
|
||||
#define MAVLINK_MSG_ID_265_LEN 20
|
||||
#define MAVLINK_MSG_ID_265_MIN_LEN 16
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_ORIENTATION_CRC 26
|
||||
#define MAVLINK_MSG_ID_265_CRC 26
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MOUNT_ORIENTATION { \
|
||||
265, \
|
||||
"MOUNT_ORIENTATION", \
|
||||
5, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_mount_orientation_t, time_boot_ms) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mount_orientation_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mount_orientation_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mount_orientation_t, yaw) }, \
|
||||
{ "yaw_absolute", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mount_orientation_t, yaw_absolute) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MOUNT_ORIENTATION { \
|
||||
"MOUNT_ORIENTATION", \
|
||||
5, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_mount_orientation_t, time_boot_ms) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mount_orientation_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mount_orientation_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mount_orientation_t, yaw) }, \
|
||||
{ "yaw_absolute", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mount_orientation_t, yaw_absolute) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mount_orientation message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param roll [deg] Roll in global frame (set to NaN for invalid).
|
||||
* @param pitch [deg] Pitch in global frame (set to NaN for invalid).
|
||||
* @param yaw [deg] Yaw relative to vehicle(set to NaN for invalid).
|
||||
* @param yaw_absolute [deg] Yaw in absolute frame, North is 0 (set to NaN for invalid).
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_orientation_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, float roll, float pitch, float yaw, float yaw_absolute)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, yaw_absolute);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN);
|
||||
#else
|
||||
mavlink_mount_orientation_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.yaw_absolute = yaw_absolute;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_ORIENTATION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mount_orientation message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param roll [deg] Roll in global frame (set to NaN for invalid).
|
||||
* @param pitch [deg] Pitch in global frame (set to NaN for invalid).
|
||||
* @param yaw [deg] Yaw relative to vehicle(set to NaN for invalid).
|
||||
* @param yaw_absolute [deg] Yaw in absolute frame, North is 0 (set to NaN for invalid).
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_orientation_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,float roll,float pitch,float yaw,float yaw_absolute)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, yaw_absolute);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN);
|
||||
#else
|
||||
mavlink_mount_orientation_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.yaw_absolute = yaw_absolute;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_ORIENTATION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mount_orientation struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mount_orientation C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_orientation_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_orientation_t* mount_orientation)
|
||||
{
|
||||
return mavlink_msg_mount_orientation_pack(system_id, component_id, msg, mount_orientation->time_boot_ms, mount_orientation->roll, mount_orientation->pitch, mount_orientation->yaw, mount_orientation->yaw_absolute);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mount_orientation struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mount_orientation C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_orientation_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mount_orientation_t* mount_orientation)
|
||||
{
|
||||
return mavlink_msg_mount_orientation_pack_chan(system_id, component_id, chan, msg, mount_orientation->time_boot_ms, mount_orientation->roll, mount_orientation->pitch, mount_orientation->yaw, mount_orientation->yaw_absolute);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mount_orientation message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param roll [deg] Roll in global frame (set to NaN for invalid).
|
||||
* @param pitch [deg] Pitch in global frame (set to NaN for invalid).
|
||||
* @param yaw [deg] Yaw relative to vehicle(set to NaN for invalid).
|
||||
* @param yaw_absolute [deg] Yaw in absolute frame, North is 0 (set to NaN for invalid).
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mount_orientation_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float yaw_absolute)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, yaw_absolute);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_ORIENTATION, buf, MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_CRC);
|
||||
#else
|
||||
mavlink_mount_orientation_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.yaw_absolute = yaw_absolute;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_ORIENTATION, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mount_orientation message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mount_orientation_send_struct(mavlink_channel_t chan, const mavlink_mount_orientation_t* mount_orientation)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mount_orientation_send(chan, mount_orientation->time_boot_ms, mount_orientation->roll, mount_orientation->pitch, mount_orientation->yaw, mount_orientation->yaw_absolute);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_ORIENTATION, (const char *)mount_orientation, MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mount_orientation_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float yaw_absolute)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, yaw_absolute);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_ORIENTATION, buf, MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_CRC);
|
||||
#else
|
||||
mavlink_mount_orientation_t *packet = (mavlink_mount_orientation_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->roll = roll;
|
||||
packet->pitch = pitch;
|
||||
packet->yaw = yaw;
|
||||
packet->yaw_absolute = yaw_absolute;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_ORIENTATION, (const char *)packet, MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN, MAVLINK_MSG_ID_MOUNT_ORIENTATION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MOUNT_ORIENTATION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from mount_orientation message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_mount_orientation_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from mount_orientation message
|
||||
*
|
||||
* @return [deg] Roll in global frame (set to NaN for invalid).
|
||||
*/
|
||||
static inline float mavlink_msg_mount_orientation_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from mount_orientation message
|
||||
*
|
||||
* @return [deg] Pitch in global frame (set to NaN for invalid).
|
||||
*/
|
||||
static inline float mavlink_msg_mount_orientation_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from mount_orientation message
|
||||
*
|
||||
* @return [deg] Yaw relative to vehicle(set to NaN for invalid).
|
||||
*/
|
||||
static inline float mavlink_msg_mount_orientation_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw_absolute from mount_orientation message
|
||||
*
|
||||
* @return [deg] Yaw in absolute frame, North is 0 (set to NaN for invalid).
|
||||
*/
|
||||
static inline float mavlink_msg_mount_orientation_get_yaw_absolute(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mount_orientation message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mount_orientation C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mount_orientation_decode(const mavlink_message_t* msg, mavlink_mount_orientation_t* mount_orientation)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mount_orientation->time_boot_ms = mavlink_msg_mount_orientation_get_time_boot_ms(msg);
|
||||
mount_orientation->roll = mavlink_msg_mount_orientation_get_roll(msg);
|
||||
mount_orientation->pitch = mavlink_msg_mount_orientation_get_pitch(msg);
|
||||
mount_orientation->yaw = mavlink_msg_mount_orientation_get_yaw(msg);
|
||||
mount_orientation->yaw_absolute = mavlink_msg_mount_orientation_get_yaw_absolute(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN? msg->len : MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN;
|
||||
memset(mount_orientation, 0, MAVLINK_MSG_ID_MOUNT_ORIENTATION_LEN);
|
||||
memcpy(mount_orientation, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
#pragma once
|
||||
// MESSAGE NAMED_VALUE_FLOAT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT 251
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_named_value_float_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
float value; /*< Floating point value*/
|
||||
char name[10]; /*< Name of the debug variable*/
|
||||
}) mavlink_named_value_float_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN 18
|
||||
#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN 18
|
||||
#define MAVLINK_MSG_ID_251_LEN 18
|
||||
#define MAVLINK_MSG_ID_251_MIN_LEN 18
|
||||
|
||||
#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC 170
|
||||
#define MAVLINK_MSG_ID_251_CRC 170
|
||||
|
||||
#define MAVLINK_MSG_NAMED_VALUE_FLOAT_FIELD_NAME_LEN 10
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT { \
|
||||
251, \
|
||||
"NAMED_VALUE_FLOAT", \
|
||||
3, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_float_t, time_boot_ms) }, \
|
||||
{ "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_float_t, name) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_named_value_float_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT { \
|
||||
"NAMED_VALUE_FLOAT", \
|
||||
3, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_float_t, time_boot_ms) }, \
|
||||
{ "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_float_t, name) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_named_value_float_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a named_value_float message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param name Name of the debug variable
|
||||
* @param value Floating point value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, const char *name, float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN);
|
||||
#else
|
||||
mavlink_named_value_float_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a named_value_float message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param name Name of the debug variable
|
||||
* @param value Floating point value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,const char *name,float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN);
|
||||
#else
|
||||
mavlink_named_value_float_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a named_value_float struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param named_value_float C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_named_value_float_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_named_value_float_t* named_value_float)
|
||||
{
|
||||
return mavlink_msg_named_value_float_pack(system_id, component_id, msg, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a named_value_float struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param named_value_float C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_named_value_float_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_named_value_float_t* named_value_float)
|
||||
{
|
||||
return mavlink_msg_named_value_float_pack_chan(system_id, component_id, chan, msg, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a named_value_float message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param name Name of the debug variable
|
||||
* @param value Floating point value
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_named_value_float_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
|
||||
#else
|
||||
mavlink_named_value_float_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a named_value_float message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_named_value_float_send_struct(mavlink_channel_t chan, const mavlink_named_value_float_t* named_value_float)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_named_value_float_send(chan, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)named_value_float, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_named_value_float_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
|
||||
#else
|
||||
mavlink_named_value_float_t *packet = (mavlink_named_value_float_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->value = value;
|
||||
mav_array_memcpy(packet->name, name, sizeof(char)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE NAMED_VALUE_FLOAT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from named_value_float message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_named_value_float_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field name from named_value_float message
|
||||
*
|
||||
* @return Name of the debug variable
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_named_value_float_get_name(const mavlink_message_t* msg, char *name)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, name, 10, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field value from named_value_float message
|
||||
*
|
||||
* @return Floating point value
|
||||
*/
|
||||
static inline float mavlink_msg_named_value_float_get_value(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a named_value_float message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param named_value_float C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_named_value_float_decode(const mavlink_message_t* msg, mavlink_named_value_float_t* named_value_float)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
named_value_float->time_boot_ms = mavlink_msg_named_value_float_get_time_boot_ms(msg);
|
||||
named_value_float->value = mavlink_msg_named_value_float_get_value(msg);
|
||||
mavlink_msg_named_value_float_get_name(msg, named_value_float->name);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN? msg->len : MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN;
|
||||
memset(named_value_float, 0, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN);
|
||||
memcpy(named_value_float, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
#pragma once
|
||||
// MESSAGE NAMED_VALUE_INT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_NAMED_VALUE_INT 252
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_named_value_int_t {
|
||||
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
|
||||
int32_t value; /*< Signed integer value*/
|
||||
char name[10]; /*< Name of the debug variable*/
|
||||
}) mavlink_named_value_int_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN 18
|
||||
#define MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN 18
|
||||
#define MAVLINK_MSG_ID_252_LEN 18
|
||||
#define MAVLINK_MSG_ID_252_MIN_LEN 18
|
||||
|
||||
#define MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC 44
|
||||
#define MAVLINK_MSG_ID_252_CRC 44
|
||||
|
||||
#define MAVLINK_MSG_NAMED_VALUE_INT_FIELD_NAME_LEN 10
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT { \
|
||||
252, \
|
||||
"NAMED_VALUE_INT", \
|
||||
3, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_int_t, time_boot_ms) }, \
|
||||
{ "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_int_t, name) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_named_value_int_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT { \
|
||||
"NAMED_VALUE_INT", \
|
||||
3, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_int_t, time_boot_ms) }, \
|
||||
{ "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_int_t, name) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_named_value_int_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a named_value_int message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param name Name of the debug variable
|
||||
* @param value Signed integer value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, const char *name, int32_t value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN);
|
||||
#else
|
||||
mavlink_named_value_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a named_value_int message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param name Name of the debug variable
|
||||
* @param value Signed integer value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,const char *name,int32_t value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN);
|
||||
#else
|
||||
mavlink_named_value_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a named_value_int struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param named_value_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_named_value_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_named_value_int_t* named_value_int)
|
||||
{
|
||||
return mavlink_msg_named_value_int_pack(system_id, component_id, msg, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a named_value_int struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param named_value_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_named_value_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_named_value_int_t* named_value_int)
|
||||
{
|
||||
return mavlink_msg_named_value_int_pack_chan(system_id, component_id, chan, msg, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a named_value_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms [ms] Timestamp (time since system boot).
|
||||
* @param name Name of the debug variable
|
||||
* @param value Signed integer value
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_named_value_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, int32_t value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
|
||||
#else
|
||||
mavlink_named_value_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a named_value_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_named_value_int_send_struct(mavlink_channel_t chan, const mavlink_named_value_int_t* named_value_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_named_value_int_send(chan, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)named_value_int, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_named_value_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, int32_t value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
|
||||
#else
|
||||
mavlink_named_value_int_t *packet = (mavlink_named_value_int_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->value = value;
|
||||
mav_array_memcpy(packet->name, name, sizeof(char)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE NAMED_VALUE_INT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from named_value_int message
|
||||
*
|
||||
* @return [ms] Timestamp (time since system boot).
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_named_value_int_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field name from named_value_int message
|
||||
*
|
||||
* @return Name of the debug variable
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_named_value_int_get_name(const mavlink_message_t* msg, char *name)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, name, 10, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field value from named_value_int message
|
||||
*
|
||||
* @return Signed integer value
|
||||
*/
|
||||
static inline int32_t mavlink_msg_named_value_int_get_value(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a named_value_int message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param named_value_int C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_named_value_int_decode(const mavlink_message_t* msg, mavlink_named_value_int_t* named_value_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
named_value_int->time_boot_ms = mavlink_msg_named_value_int_get_time_boot_ms(msg);
|
||||
named_value_int->value = mavlink_msg_named_value_int_get_value(msg);
|
||||
mavlink_msg_named_value_int_get_name(msg, named_value_int->name);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN? msg->len : MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN;
|
||||
memset(named_value_int, 0, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN);
|
||||
memcpy(named_value_int, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,388 @@
|
||||
#pragma once
|
||||
// MESSAGE NAV_CONTROLLER_OUTPUT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT 62
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_nav_controller_output_t {
|
||||
float nav_roll; /*< [deg] Current desired roll*/
|
||||
float nav_pitch; /*< [deg] Current desired pitch*/
|
||||
float alt_error; /*< [m] Current altitude error*/
|
||||
float aspd_error; /*< [m/s] Current airspeed error*/
|
||||
float xtrack_error; /*< [m] Current crosstrack error on x-y plane*/
|
||||
int16_t nav_bearing; /*< [deg] Current desired heading*/
|
||||
int16_t target_bearing; /*< [deg] Bearing to current waypoint/target*/
|
||||
uint16_t wp_dist; /*< [m] Distance to active waypoint*/
|
||||
}) mavlink_nav_controller_output_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN 26
|
||||
#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN 26
|
||||
#define MAVLINK_MSG_ID_62_LEN 26
|
||||
#define MAVLINK_MSG_ID_62_MIN_LEN 26
|
||||
|
||||
#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC 183
|
||||
#define MAVLINK_MSG_ID_62_CRC 183
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT { \
|
||||
62, \
|
||||
"NAV_CONTROLLER_OUTPUT", \
|
||||
8, \
|
||||
{ { "nav_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_nav_controller_output_t, nav_roll) }, \
|
||||
{ "nav_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_nav_controller_output_t, nav_pitch) }, \
|
||||
{ "nav_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_nav_controller_output_t, nav_bearing) }, \
|
||||
{ "target_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_nav_controller_output_t, target_bearing) }, \
|
||||
{ "wp_dist", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_nav_controller_output_t, wp_dist) }, \
|
||||
{ "alt_error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_nav_controller_output_t, alt_error) }, \
|
||||
{ "aspd_error", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_nav_controller_output_t, aspd_error) }, \
|
||||
{ "xtrack_error", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_nav_controller_output_t, xtrack_error) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT { \
|
||||
"NAV_CONTROLLER_OUTPUT", \
|
||||
8, \
|
||||
{ { "nav_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_nav_controller_output_t, nav_roll) }, \
|
||||
{ "nav_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_nav_controller_output_t, nav_pitch) }, \
|
||||
{ "nav_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_nav_controller_output_t, nav_bearing) }, \
|
||||
{ "target_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_nav_controller_output_t, target_bearing) }, \
|
||||
{ "wp_dist", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_nav_controller_output_t, wp_dist) }, \
|
||||
{ "alt_error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_nav_controller_output_t, alt_error) }, \
|
||||
{ "aspd_error", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_nav_controller_output_t, aspd_error) }, \
|
||||
{ "xtrack_error", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_nav_controller_output_t, xtrack_error) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a nav_controller_output message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param nav_roll [deg] Current desired roll
|
||||
* @param nav_pitch [deg] Current desired pitch
|
||||
* @param nav_bearing [deg] Current desired heading
|
||||
* @param target_bearing [deg] Bearing to current waypoint/target
|
||||
* @param wp_dist [m] Distance to active waypoint
|
||||
* @param alt_error [m] Current altitude error
|
||||
* @param aspd_error [m/s] Current airspeed error
|
||||
* @param xtrack_error [m] Current crosstrack error on x-y plane
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN];
|
||||
_mav_put_float(buf, 0, nav_roll);
|
||||
_mav_put_float(buf, 4, nav_pitch);
|
||||
_mav_put_float(buf, 8, alt_error);
|
||||
_mav_put_float(buf, 12, aspd_error);
|
||||
_mav_put_float(buf, 16, xtrack_error);
|
||||
_mav_put_int16_t(buf, 20, nav_bearing);
|
||||
_mav_put_int16_t(buf, 22, target_bearing);
|
||||
_mav_put_uint16_t(buf, 24, wp_dist);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN);
|
||||
#else
|
||||
mavlink_nav_controller_output_t packet;
|
||||
packet.nav_roll = nav_roll;
|
||||
packet.nav_pitch = nav_pitch;
|
||||
packet.alt_error = alt_error;
|
||||
packet.aspd_error = aspd_error;
|
||||
packet.xtrack_error = xtrack_error;
|
||||
packet.nav_bearing = nav_bearing;
|
||||
packet.target_bearing = target_bearing;
|
||||
packet.wp_dist = wp_dist;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a nav_controller_output message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param nav_roll [deg] Current desired roll
|
||||
* @param nav_pitch [deg] Current desired pitch
|
||||
* @param nav_bearing [deg] Current desired heading
|
||||
* @param target_bearing [deg] Bearing to current waypoint/target
|
||||
* @param wp_dist [m] Distance to active waypoint
|
||||
* @param alt_error [m] Current altitude error
|
||||
* @param aspd_error [m/s] Current airspeed error
|
||||
* @param xtrack_error [m] Current crosstrack error on x-y plane
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float nav_roll,float nav_pitch,int16_t nav_bearing,int16_t target_bearing,uint16_t wp_dist,float alt_error,float aspd_error,float xtrack_error)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN];
|
||||
_mav_put_float(buf, 0, nav_roll);
|
||||
_mav_put_float(buf, 4, nav_pitch);
|
||||
_mav_put_float(buf, 8, alt_error);
|
||||
_mav_put_float(buf, 12, aspd_error);
|
||||
_mav_put_float(buf, 16, xtrack_error);
|
||||
_mav_put_int16_t(buf, 20, nav_bearing);
|
||||
_mav_put_int16_t(buf, 22, target_bearing);
|
||||
_mav_put_uint16_t(buf, 24, wp_dist);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN);
|
||||
#else
|
||||
mavlink_nav_controller_output_t packet;
|
||||
packet.nav_roll = nav_roll;
|
||||
packet.nav_pitch = nav_pitch;
|
||||
packet.alt_error = alt_error;
|
||||
packet.aspd_error = aspd_error;
|
||||
packet.xtrack_error = xtrack_error;
|
||||
packet.nav_bearing = nav_bearing;
|
||||
packet.target_bearing = target_bearing;
|
||||
packet.wp_dist = wp_dist;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a nav_controller_output struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param nav_controller_output C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_nav_controller_output_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_nav_controller_output_t* nav_controller_output)
|
||||
{
|
||||
return mavlink_msg_nav_controller_output_pack(system_id, component_id, msg, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a nav_controller_output struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param nav_controller_output C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_nav_controller_output_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_nav_controller_output_t* nav_controller_output)
|
||||
{
|
||||
return mavlink_msg_nav_controller_output_pack_chan(system_id, component_id, chan, msg, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a nav_controller_output message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param nav_roll [deg] Current desired roll
|
||||
* @param nav_pitch [deg] Current desired pitch
|
||||
* @param nav_bearing [deg] Current desired heading
|
||||
* @param target_bearing [deg] Bearing to current waypoint/target
|
||||
* @param wp_dist [m] Distance to active waypoint
|
||||
* @param alt_error [m] Current altitude error
|
||||
* @param aspd_error [m/s] Current airspeed error
|
||||
* @param xtrack_error [m] Current crosstrack error on x-y plane
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_nav_controller_output_send(mavlink_channel_t chan, float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN];
|
||||
_mav_put_float(buf, 0, nav_roll);
|
||||
_mav_put_float(buf, 4, nav_pitch);
|
||||
_mav_put_float(buf, 8, alt_error);
|
||||
_mav_put_float(buf, 12, aspd_error);
|
||||
_mav_put_float(buf, 16, xtrack_error);
|
||||
_mav_put_int16_t(buf, 20, nav_bearing);
|
||||
_mav_put_int16_t(buf, 22, target_bearing);
|
||||
_mav_put_uint16_t(buf, 24, wp_dist);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
|
||||
#else
|
||||
mavlink_nav_controller_output_t packet;
|
||||
packet.nav_roll = nav_roll;
|
||||
packet.nav_pitch = nav_pitch;
|
||||
packet.alt_error = alt_error;
|
||||
packet.aspd_error = aspd_error;
|
||||
packet.xtrack_error = xtrack_error;
|
||||
packet.nav_bearing = nav_bearing;
|
||||
packet.target_bearing = target_bearing;
|
||||
packet.wp_dist = wp_dist;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)&packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a nav_controller_output message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_nav_controller_output_send_struct(mavlink_channel_t chan, const mavlink_nav_controller_output_t* nav_controller_output)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_nav_controller_output_send(chan, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)nav_controller_output, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_nav_controller_output_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, nav_roll);
|
||||
_mav_put_float(buf, 4, nav_pitch);
|
||||
_mav_put_float(buf, 8, alt_error);
|
||||
_mav_put_float(buf, 12, aspd_error);
|
||||
_mav_put_float(buf, 16, xtrack_error);
|
||||
_mav_put_int16_t(buf, 20, nav_bearing);
|
||||
_mav_put_int16_t(buf, 22, target_bearing);
|
||||
_mav_put_uint16_t(buf, 24, wp_dist);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
|
||||
#else
|
||||
mavlink_nav_controller_output_t *packet = (mavlink_nav_controller_output_t *)msgbuf;
|
||||
packet->nav_roll = nav_roll;
|
||||
packet->nav_pitch = nav_pitch;
|
||||
packet->alt_error = alt_error;
|
||||
packet->aspd_error = aspd_error;
|
||||
packet->xtrack_error = xtrack_error;
|
||||
packet->nav_bearing = nav_bearing;
|
||||
packet->target_bearing = target_bearing;
|
||||
packet->wp_dist = wp_dist;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE NAV_CONTROLLER_OUTPUT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field nav_roll from nav_controller_output message
|
||||
*
|
||||
* @return [deg] Current desired roll
|
||||
*/
|
||||
static inline float mavlink_msg_nav_controller_output_get_nav_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field nav_pitch from nav_controller_output message
|
||||
*
|
||||
* @return [deg] Current desired pitch
|
||||
*/
|
||||
static inline float mavlink_msg_nav_controller_output_get_nav_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field nav_bearing from nav_controller_output message
|
||||
*
|
||||
* @return [deg] Current desired heading
|
||||
*/
|
||||
static inline int16_t mavlink_msg_nav_controller_output_get_nav_bearing(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_bearing from nav_controller_output message
|
||||
*
|
||||
* @return [deg] Bearing to current waypoint/target
|
||||
*/
|
||||
static inline int16_t mavlink_msg_nav_controller_output_get_target_bearing(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field wp_dist from nav_controller_output message
|
||||
*
|
||||
* @return [m] Distance to active waypoint
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_nav_controller_output_get_wp_dist(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt_error from nav_controller_output message
|
||||
*
|
||||
* @return [m] Current altitude error
|
||||
*/
|
||||
static inline float mavlink_msg_nav_controller_output_get_alt_error(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field aspd_error from nav_controller_output message
|
||||
*
|
||||
* @return [m/s] Current airspeed error
|
||||
*/
|
||||
static inline float mavlink_msg_nav_controller_output_get_aspd_error(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xtrack_error from nav_controller_output message
|
||||
*
|
||||
* @return [m] Current crosstrack error on x-y plane
|
||||
*/
|
||||
static inline float mavlink_msg_nav_controller_output_get_xtrack_error(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a nav_controller_output message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param nav_controller_output C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_nav_controller_output_decode(const mavlink_message_t* msg, mavlink_nav_controller_output_t* nav_controller_output)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
nav_controller_output->nav_roll = mavlink_msg_nav_controller_output_get_nav_roll(msg);
|
||||
nav_controller_output->nav_pitch = mavlink_msg_nav_controller_output_get_nav_pitch(msg);
|
||||
nav_controller_output->alt_error = mavlink_msg_nav_controller_output_get_alt_error(msg);
|
||||
nav_controller_output->aspd_error = mavlink_msg_nav_controller_output_get_aspd_error(msg);
|
||||
nav_controller_output->xtrack_error = mavlink_msg_nav_controller_output_get_xtrack_error(msg);
|
||||
nav_controller_output->nav_bearing = mavlink_msg_nav_controller_output_get_nav_bearing(msg);
|
||||
nav_controller_output->target_bearing = mavlink_msg_nav_controller_output_get_target_bearing(msg);
|
||||
nav_controller_output->wp_dist = mavlink_msg_nav_controller_output_get_wp_dist(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN? msg->len : MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN;
|
||||
memset(nav_controller_output, 0, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN);
|
||||
memcpy(nav_controller_output, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,330 @@
|
||||
#pragma once
|
||||
// MESSAGE OBSTACLE_DISTANCE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_OBSTACLE_DISTANCE 330
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_obstacle_distance_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
uint16_t distances[72]; /*< [cm] Distance of obstacles around the UAV with index 0 corresponding to local North. A value of 0 means that the obstacle is right in front of the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm.*/
|
||||
uint16_t min_distance; /*< [cm] Minimum distance the sensor can measure.*/
|
||||
uint16_t max_distance; /*< [cm] Maximum distance the sensor can measure.*/
|
||||
uint8_t sensor_type; /*< Class id of the distance sensor type.*/
|
||||
uint8_t increment; /*< [deg] Angular width in degrees of each array element.*/
|
||||
}) mavlink_obstacle_distance_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN 158
|
||||
#define MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN 158
|
||||
#define MAVLINK_MSG_ID_330_LEN 158
|
||||
#define MAVLINK_MSG_ID_330_MIN_LEN 158
|
||||
|
||||
#define MAVLINK_MSG_ID_OBSTACLE_DISTANCE_CRC 23
|
||||
#define MAVLINK_MSG_ID_330_CRC 23
|
||||
|
||||
#define MAVLINK_MSG_OBSTACLE_DISTANCE_FIELD_DISTANCES_LEN 72
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_OBSTACLE_DISTANCE { \
|
||||
330, \
|
||||
"OBSTACLE_DISTANCE", \
|
||||
6, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_obstacle_distance_t, time_usec) }, \
|
||||
{ "sensor_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 156, offsetof(mavlink_obstacle_distance_t, sensor_type) }, \
|
||||
{ "distances", NULL, MAVLINK_TYPE_UINT16_T, 72, 8, offsetof(mavlink_obstacle_distance_t, distances) }, \
|
||||
{ "increment", NULL, MAVLINK_TYPE_UINT8_T, 0, 157, offsetof(mavlink_obstacle_distance_t, increment) }, \
|
||||
{ "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 152, offsetof(mavlink_obstacle_distance_t, min_distance) }, \
|
||||
{ "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 154, offsetof(mavlink_obstacle_distance_t, max_distance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_OBSTACLE_DISTANCE { \
|
||||
"OBSTACLE_DISTANCE", \
|
||||
6, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_obstacle_distance_t, time_usec) }, \
|
||||
{ "sensor_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 156, offsetof(mavlink_obstacle_distance_t, sensor_type) }, \
|
||||
{ "distances", NULL, MAVLINK_TYPE_UINT16_T, 72, 8, offsetof(mavlink_obstacle_distance_t, distances) }, \
|
||||
{ "increment", NULL, MAVLINK_TYPE_UINT8_T, 0, 157, offsetof(mavlink_obstacle_distance_t, increment) }, \
|
||||
{ "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 152, offsetof(mavlink_obstacle_distance_t, min_distance) }, \
|
||||
{ "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 154, offsetof(mavlink_obstacle_distance_t, max_distance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a obstacle_distance message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_type Class id of the distance sensor type.
|
||||
* @param distances [cm] Distance of obstacles around the UAV with index 0 corresponding to local North. A value of 0 means that the obstacle is right in front of the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm.
|
||||
* @param increment [deg] Angular width in degrees of each array element.
|
||||
* @param min_distance [cm] Minimum distance the sensor can measure.
|
||||
* @param max_distance [cm] Maximum distance the sensor can measure.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_obstacle_distance_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t sensor_type, const uint16_t *distances, uint8_t increment, uint16_t min_distance, uint16_t max_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint16_t(buf, 152, min_distance);
|
||||
_mav_put_uint16_t(buf, 154, max_distance);
|
||||
_mav_put_uint8_t(buf, 156, sensor_type);
|
||||
_mav_put_uint8_t(buf, 157, increment);
|
||||
_mav_put_uint16_t_array(buf, 8, distances, 72);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN);
|
||||
#else
|
||||
mavlink_obstacle_distance_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.min_distance = min_distance;
|
||||
packet.max_distance = max_distance;
|
||||
packet.sensor_type = sensor_type;
|
||||
packet.increment = increment;
|
||||
mav_array_memcpy(packet.distances, distances, sizeof(uint16_t)*72);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_OBSTACLE_DISTANCE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a obstacle_distance message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_type Class id of the distance sensor type.
|
||||
* @param distances [cm] Distance of obstacles around the UAV with index 0 corresponding to local North. A value of 0 means that the obstacle is right in front of the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm.
|
||||
* @param increment [deg] Angular width in degrees of each array element.
|
||||
* @param min_distance [cm] Minimum distance the sensor can measure.
|
||||
* @param max_distance [cm] Maximum distance the sensor can measure.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_obstacle_distance_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t sensor_type,const uint16_t *distances,uint8_t increment,uint16_t min_distance,uint16_t max_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint16_t(buf, 152, min_distance);
|
||||
_mav_put_uint16_t(buf, 154, max_distance);
|
||||
_mav_put_uint8_t(buf, 156, sensor_type);
|
||||
_mav_put_uint8_t(buf, 157, increment);
|
||||
_mav_put_uint16_t_array(buf, 8, distances, 72);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN);
|
||||
#else
|
||||
mavlink_obstacle_distance_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.min_distance = min_distance;
|
||||
packet.max_distance = max_distance;
|
||||
packet.sensor_type = sensor_type;
|
||||
packet.increment = increment;
|
||||
mav_array_memcpy(packet.distances, distances, sizeof(uint16_t)*72);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_OBSTACLE_DISTANCE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a obstacle_distance struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param obstacle_distance C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_obstacle_distance_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obstacle_distance_t* obstacle_distance)
|
||||
{
|
||||
return mavlink_msg_obstacle_distance_pack(system_id, component_id, msg, obstacle_distance->time_usec, obstacle_distance->sensor_type, obstacle_distance->distances, obstacle_distance->increment, obstacle_distance->min_distance, obstacle_distance->max_distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a obstacle_distance struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param obstacle_distance C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_obstacle_distance_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_obstacle_distance_t* obstacle_distance)
|
||||
{
|
||||
return mavlink_msg_obstacle_distance_pack_chan(system_id, component_id, chan, msg, obstacle_distance->time_usec, obstacle_distance->sensor_type, obstacle_distance->distances, obstacle_distance->increment, obstacle_distance->min_distance, obstacle_distance->max_distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a obstacle_distance message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_type Class id of the distance sensor type.
|
||||
* @param distances [cm] Distance of obstacles around the UAV with index 0 corresponding to local North. A value of 0 means that the obstacle is right in front of the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm.
|
||||
* @param increment [deg] Angular width in degrees of each array element.
|
||||
* @param min_distance [cm] Minimum distance the sensor can measure.
|
||||
* @param max_distance [cm] Maximum distance the sensor can measure.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_obstacle_distance_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_type, const uint16_t *distances, uint8_t increment, uint16_t min_distance, uint16_t max_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint16_t(buf, 152, min_distance);
|
||||
_mav_put_uint16_t(buf, 154, max_distance);
|
||||
_mav_put_uint8_t(buf, 156, sensor_type);
|
||||
_mav_put_uint8_t(buf, 157, increment);
|
||||
_mav_put_uint16_t_array(buf, 8, distances, 72);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBSTACLE_DISTANCE, buf, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_CRC);
|
||||
#else
|
||||
mavlink_obstacle_distance_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.min_distance = min_distance;
|
||||
packet.max_distance = max_distance;
|
||||
packet.sensor_type = sensor_type;
|
||||
packet.increment = increment;
|
||||
mav_array_memcpy(packet.distances, distances, sizeof(uint16_t)*72);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBSTACLE_DISTANCE, (const char *)&packet, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a obstacle_distance message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_obstacle_distance_send_struct(mavlink_channel_t chan, const mavlink_obstacle_distance_t* obstacle_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_obstacle_distance_send(chan, obstacle_distance->time_usec, obstacle_distance->sensor_type, obstacle_distance->distances, obstacle_distance->increment, obstacle_distance->min_distance, obstacle_distance->max_distance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBSTACLE_DISTANCE, (const char *)obstacle_distance, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_obstacle_distance_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_type, const uint16_t *distances, uint8_t increment, uint16_t min_distance, uint16_t max_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint16_t(buf, 152, min_distance);
|
||||
_mav_put_uint16_t(buf, 154, max_distance);
|
||||
_mav_put_uint8_t(buf, 156, sensor_type);
|
||||
_mav_put_uint8_t(buf, 157, increment);
|
||||
_mav_put_uint16_t_array(buf, 8, distances, 72);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBSTACLE_DISTANCE, buf, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_CRC);
|
||||
#else
|
||||
mavlink_obstacle_distance_t *packet = (mavlink_obstacle_distance_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->min_distance = min_distance;
|
||||
packet->max_distance = max_distance;
|
||||
packet->sensor_type = sensor_type;
|
||||
packet->increment = increment;
|
||||
mav_array_memcpy(packet->distances, distances, sizeof(uint16_t)*72);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBSTACLE_DISTANCE, (const char *)packet, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE OBSTACLE_DISTANCE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from obstacle_distance message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_obstacle_distance_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sensor_type from obstacle_distance message
|
||||
*
|
||||
* @return Class id of the distance sensor type.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_obstacle_distance_get_sensor_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 156);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field distances from obstacle_distance message
|
||||
*
|
||||
* @return [cm] Distance of obstacles around the UAV with index 0 corresponding to local North. A value of 0 means that the obstacle is right in front of the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_obstacle_distance_get_distances(const mavlink_message_t* msg, uint16_t *distances)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t_array(msg, distances, 72, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field increment from obstacle_distance message
|
||||
*
|
||||
* @return [deg] Angular width in degrees of each array element.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_obstacle_distance_get_increment(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 157);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field min_distance from obstacle_distance message
|
||||
*
|
||||
* @return [cm] Minimum distance the sensor can measure.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_obstacle_distance_get_min_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 152);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field max_distance from obstacle_distance message
|
||||
*
|
||||
* @return [cm] Maximum distance the sensor can measure.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_obstacle_distance_get_max_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 154);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a obstacle_distance message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param obstacle_distance C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_obstacle_distance_decode(const mavlink_message_t* msg, mavlink_obstacle_distance_t* obstacle_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
obstacle_distance->time_usec = mavlink_msg_obstacle_distance_get_time_usec(msg);
|
||||
mavlink_msg_obstacle_distance_get_distances(msg, obstacle_distance->distances);
|
||||
obstacle_distance->min_distance = mavlink_msg_obstacle_distance_get_min_distance(msg);
|
||||
obstacle_distance->max_distance = mavlink_msg_obstacle_distance_get_max_distance(msg);
|
||||
obstacle_distance->sensor_type = mavlink_msg_obstacle_distance_get_sensor_type(msg);
|
||||
obstacle_distance->increment = mavlink_msg_obstacle_distance_get_increment(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN? msg->len : MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN;
|
||||
memset(obstacle_distance, 0, MAVLINK_MSG_ID_OBSTACLE_DISTANCE_LEN);
|
||||
memcpy(obstacle_distance, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,557 @@
|
||||
#pragma once
|
||||
// MESSAGE ODOMETRY PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ODOMETRY 331
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_odometry_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float x; /*< [m] X Position*/
|
||||
float y; /*< [m] Y Position*/
|
||||
float z; /*< [m] Z Position*/
|
||||
float q[4]; /*< Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)*/
|
||||
float vx; /*< [m/s] X linear speed*/
|
||||
float vy; /*< [m/s] Y linear speed*/
|
||||
float vz; /*< [m/s] Z linear speed*/
|
||||
float rollspeed; /*< [rad/s] Roll angular speed*/
|
||||
float pitchspeed; /*< [rad/s] Pitch angular speed*/
|
||||
float yawspeed; /*< [rad/s] Yaw angular speed*/
|
||||
float pose_covariance[21]; /*< Pose (states: x, y, z, roll, pitch, yaw) covariance matrix upper right triangle (first six entries are the first ROW, next five entries are the second ROW, etc.)*/
|
||||
float twist_covariance[21]; /*< Twist (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed) covariance matrix upper right triangle (first six entries are the first ROW, next five entries are the second ROW, etc.)*/
|
||||
uint8_t frame_id; /*< Coordinate frame of reference for the pose data.*/
|
||||
uint8_t child_frame_id; /*< Coordinate frame of reference for the velocity in free space (twist) data.*/
|
||||
}) mavlink_odometry_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ODOMETRY_LEN 230
|
||||
#define MAVLINK_MSG_ID_ODOMETRY_MIN_LEN 230
|
||||
#define MAVLINK_MSG_ID_331_LEN 230
|
||||
#define MAVLINK_MSG_ID_331_MIN_LEN 230
|
||||
|
||||
#define MAVLINK_MSG_ID_ODOMETRY_CRC 58
|
||||
#define MAVLINK_MSG_ID_331_CRC 58
|
||||
|
||||
#define MAVLINK_MSG_ODOMETRY_FIELD_Q_LEN 4
|
||||
#define MAVLINK_MSG_ODOMETRY_FIELD_POSE_COVARIANCE_LEN 21
|
||||
#define MAVLINK_MSG_ODOMETRY_FIELD_TWIST_COVARIANCE_LEN 21
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ODOMETRY { \
|
||||
331, \
|
||||
"ODOMETRY", \
|
||||
15, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_odometry_t, time_usec) }, \
|
||||
{ "frame_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 228, offsetof(mavlink_odometry_t, frame_id) }, \
|
||||
{ "child_frame_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 229, offsetof(mavlink_odometry_t, child_frame_id) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_odometry_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_odometry_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_odometry_t, z) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 20, offsetof(mavlink_odometry_t, q) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_odometry_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_odometry_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_odometry_t, vz) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_odometry_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_odometry_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_odometry_t, yawspeed) }, \
|
||||
{ "pose_covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 60, offsetof(mavlink_odometry_t, pose_covariance) }, \
|
||||
{ "twist_covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 144, offsetof(mavlink_odometry_t, twist_covariance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ODOMETRY { \
|
||||
"ODOMETRY", \
|
||||
15, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_odometry_t, time_usec) }, \
|
||||
{ "frame_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 228, offsetof(mavlink_odometry_t, frame_id) }, \
|
||||
{ "child_frame_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 229, offsetof(mavlink_odometry_t, child_frame_id) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_odometry_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_odometry_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_odometry_t, z) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 20, offsetof(mavlink_odometry_t, q) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_odometry_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_odometry_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_odometry_t, vz) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_odometry_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_odometry_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_odometry_t, yawspeed) }, \
|
||||
{ "pose_covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 60, offsetof(mavlink_odometry_t, pose_covariance) }, \
|
||||
{ "twist_covariance", NULL, MAVLINK_TYPE_FLOAT, 21, 144, offsetof(mavlink_odometry_t, twist_covariance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a odometry message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param frame_id Coordinate frame of reference for the pose data.
|
||||
* @param child_frame_id Coordinate frame of reference for the velocity in free space (twist) data.
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
* @param vx [m/s] X linear speed
|
||||
* @param vy [m/s] Y linear speed
|
||||
* @param vz [m/s] Z linear speed
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
* @param pose_covariance Pose (states: x, y, z, roll, pitch, yaw) covariance matrix upper right triangle (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
* @param twist_covariance Twist (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed) covariance matrix upper right triangle (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_odometry_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t frame_id, uint8_t child_frame_id, float x, float y, float z, const float *q, float vx, float vy, float vz, float rollspeed, float pitchspeed, float yawspeed, const float *pose_covariance, const float *twist_covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ODOMETRY_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 36, vx);
|
||||
_mav_put_float(buf, 40, vy);
|
||||
_mav_put_float(buf, 44, vz);
|
||||
_mav_put_float(buf, 48, rollspeed);
|
||||
_mav_put_float(buf, 52, pitchspeed);
|
||||
_mav_put_float(buf, 56, yawspeed);
|
||||
_mav_put_uint8_t(buf, 228, frame_id);
|
||||
_mav_put_uint8_t(buf, 229, child_frame_id);
|
||||
_mav_put_float_array(buf, 20, q, 4);
|
||||
_mav_put_float_array(buf, 60, pose_covariance, 21);
|
||||
_mav_put_float_array(buf, 144, twist_covariance, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ODOMETRY_LEN);
|
||||
#else
|
||||
mavlink_odometry_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
packet.frame_id = frame_id;
|
||||
packet.child_frame_id = child_frame_id;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.pose_covariance, pose_covariance, sizeof(float)*21);
|
||||
mav_array_memcpy(packet.twist_covariance, twist_covariance, sizeof(float)*21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ODOMETRY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ODOMETRY;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ODOMETRY_MIN_LEN, MAVLINK_MSG_ID_ODOMETRY_LEN, MAVLINK_MSG_ID_ODOMETRY_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a odometry message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param frame_id Coordinate frame of reference for the pose data.
|
||||
* @param child_frame_id Coordinate frame of reference for the velocity in free space (twist) data.
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
* @param vx [m/s] X linear speed
|
||||
* @param vy [m/s] Y linear speed
|
||||
* @param vz [m/s] Z linear speed
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
* @param pose_covariance Pose (states: x, y, z, roll, pitch, yaw) covariance matrix upper right triangle (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
* @param twist_covariance Twist (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed) covariance matrix upper right triangle (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_odometry_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t frame_id,uint8_t child_frame_id,float x,float y,float z,const float *q,float vx,float vy,float vz,float rollspeed,float pitchspeed,float yawspeed,const float *pose_covariance,const float *twist_covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ODOMETRY_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 36, vx);
|
||||
_mav_put_float(buf, 40, vy);
|
||||
_mav_put_float(buf, 44, vz);
|
||||
_mav_put_float(buf, 48, rollspeed);
|
||||
_mav_put_float(buf, 52, pitchspeed);
|
||||
_mav_put_float(buf, 56, yawspeed);
|
||||
_mav_put_uint8_t(buf, 228, frame_id);
|
||||
_mav_put_uint8_t(buf, 229, child_frame_id);
|
||||
_mav_put_float_array(buf, 20, q, 4);
|
||||
_mav_put_float_array(buf, 60, pose_covariance, 21);
|
||||
_mav_put_float_array(buf, 144, twist_covariance, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ODOMETRY_LEN);
|
||||
#else
|
||||
mavlink_odometry_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
packet.frame_id = frame_id;
|
||||
packet.child_frame_id = child_frame_id;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.pose_covariance, pose_covariance, sizeof(float)*21);
|
||||
mav_array_memcpy(packet.twist_covariance, twist_covariance, sizeof(float)*21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ODOMETRY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ODOMETRY;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ODOMETRY_MIN_LEN, MAVLINK_MSG_ID_ODOMETRY_LEN, MAVLINK_MSG_ID_ODOMETRY_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a odometry struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param odometry C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_odometry_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_odometry_t* odometry)
|
||||
{
|
||||
return mavlink_msg_odometry_pack(system_id, component_id, msg, odometry->time_usec, odometry->frame_id, odometry->child_frame_id, odometry->x, odometry->y, odometry->z, odometry->q, odometry->vx, odometry->vy, odometry->vz, odometry->rollspeed, odometry->pitchspeed, odometry->yawspeed, odometry->pose_covariance, odometry->twist_covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a odometry struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param odometry C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_odometry_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_odometry_t* odometry)
|
||||
{
|
||||
return mavlink_msg_odometry_pack_chan(system_id, component_id, chan, msg, odometry->time_usec, odometry->frame_id, odometry->child_frame_id, odometry->x, odometry->y, odometry->z, odometry->q, odometry->vx, odometry->vy, odometry->vz, odometry->rollspeed, odometry->pitchspeed, odometry->yawspeed, odometry->pose_covariance, odometry->twist_covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a odometry message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param frame_id Coordinate frame of reference for the pose data.
|
||||
* @param child_frame_id Coordinate frame of reference for the velocity in free space (twist) data.
|
||||
* @param x [m] X Position
|
||||
* @param y [m] Y Position
|
||||
* @param z [m] Z Position
|
||||
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
* @param vx [m/s] X linear speed
|
||||
* @param vy [m/s] Y linear speed
|
||||
* @param vz [m/s] Z linear speed
|
||||
* @param rollspeed [rad/s] Roll angular speed
|
||||
* @param pitchspeed [rad/s] Pitch angular speed
|
||||
* @param yawspeed [rad/s] Yaw angular speed
|
||||
* @param pose_covariance Pose (states: x, y, z, roll, pitch, yaw) covariance matrix upper right triangle (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
* @param twist_covariance Twist (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed) covariance matrix upper right triangle (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_odometry_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t frame_id, uint8_t child_frame_id, float x, float y, float z, const float *q, float vx, float vy, float vz, float rollspeed, float pitchspeed, float yawspeed, const float *pose_covariance, const float *twist_covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ODOMETRY_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 36, vx);
|
||||
_mav_put_float(buf, 40, vy);
|
||||
_mav_put_float(buf, 44, vz);
|
||||
_mav_put_float(buf, 48, rollspeed);
|
||||
_mav_put_float(buf, 52, pitchspeed);
|
||||
_mav_put_float(buf, 56, yawspeed);
|
||||
_mav_put_uint8_t(buf, 228, frame_id);
|
||||
_mav_put_uint8_t(buf, 229, child_frame_id);
|
||||
_mav_put_float_array(buf, 20, q, 4);
|
||||
_mav_put_float_array(buf, 60, pose_covariance, 21);
|
||||
_mav_put_float_array(buf, 144, twist_covariance, 21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ODOMETRY, buf, MAVLINK_MSG_ID_ODOMETRY_MIN_LEN, MAVLINK_MSG_ID_ODOMETRY_LEN, MAVLINK_MSG_ID_ODOMETRY_CRC);
|
||||
#else
|
||||
mavlink_odometry_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
packet.frame_id = frame_id;
|
||||
packet.child_frame_id = child_frame_id;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.pose_covariance, pose_covariance, sizeof(float)*21);
|
||||
mav_array_memcpy(packet.twist_covariance, twist_covariance, sizeof(float)*21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ODOMETRY, (const char *)&packet, MAVLINK_MSG_ID_ODOMETRY_MIN_LEN, MAVLINK_MSG_ID_ODOMETRY_LEN, MAVLINK_MSG_ID_ODOMETRY_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a odometry message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_odometry_send_struct(mavlink_channel_t chan, const mavlink_odometry_t* odometry)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_odometry_send(chan, odometry->time_usec, odometry->frame_id, odometry->child_frame_id, odometry->x, odometry->y, odometry->z, odometry->q, odometry->vx, odometry->vy, odometry->vz, odometry->rollspeed, odometry->pitchspeed, odometry->yawspeed, odometry->pose_covariance, odometry->twist_covariance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ODOMETRY, (const char *)odometry, MAVLINK_MSG_ID_ODOMETRY_MIN_LEN, MAVLINK_MSG_ID_ODOMETRY_LEN, MAVLINK_MSG_ID_ODOMETRY_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ODOMETRY_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_odometry_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t frame_id, uint8_t child_frame_id, float x, float y, float z, const float *q, float vx, float vy, float vz, float rollspeed, float pitchspeed, float yawspeed, const float *pose_covariance, const float *twist_covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 36, vx);
|
||||
_mav_put_float(buf, 40, vy);
|
||||
_mav_put_float(buf, 44, vz);
|
||||
_mav_put_float(buf, 48, rollspeed);
|
||||
_mav_put_float(buf, 52, pitchspeed);
|
||||
_mav_put_float(buf, 56, yawspeed);
|
||||
_mav_put_uint8_t(buf, 228, frame_id);
|
||||
_mav_put_uint8_t(buf, 229, child_frame_id);
|
||||
_mav_put_float_array(buf, 20, q, 4);
|
||||
_mav_put_float_array(buf, 60, pose_covariance, 21);
|
||||
_mav_put_float_array(buf, 144, twist_covariance, 21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ODOMETRY, buf, MAVLINK_MSG_ID_ODOMETRY_MIN_LEN, MAVLINK_MSG_ID_ODOMETRY_LEN, MAVLINK_MSG_ID_ODOMETRY_CRC);
|
||||
#else
|
||||
mavlink_odometry_t *packet = (mavlink_odometry_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->vx = vx;
|
||||
packet->vy = vy;
|
||||
packet->vz = vz;
|
||||
packet->rollspeed = rollspeed;
|
||||
packet->pitchspeed = pitchspeed;
|
||||
packet->yawspeed = yawspeed;
|
||||
packet->frame_id = frame_id;
|
||||
packet->child_frame_id = child_frame_id;
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet->pose_covariance, pose_covariance, sizeof(float)*21);
|
||||
mav_array_memcpy(packet->twist_covariance, twist_covariance, sizeof(float)*21);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ODOMETRY, (const char *)packet, MAVLINK_MSG_ID_ODOMETRY_MIN_LEN, MAVLINK_MSG_ID_ODOMETRY_LEN, MAVLINK_MSG_ID_ODOMETRY_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ODOMETRY UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from odometry message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_odometry_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field frame_id from odometry message
|
||||
*
|
||||
* @return Coordinate frame of reference for the pose data.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_odometry_get_frame_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 228);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field child_frame_id from odometry message
|
||||
*
|
||||
* @return Coordinate frame of reference for the velocity in free space (twist) data.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_odometry_get_child_frame_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 229);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from odometry message
|
||||
*
|
||||
* @return [m] X Position
|
||||
*/
|
||||
static inline float mavlink_msg_odometry_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from odometry message
|
||||
*
|
||||
* @return [m] Y Position
|
||||
*/
|
||||
static inline float mavlink_msg_odometry_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from odometry message
|
||||
*
|
||||
* @return [m] Z Position
|
||||
*/
|
||||
static inline float mavlink_msg_odometry_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from odometry message
|
||||
*
|
||||
* @return Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_odometry_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vx from odometry message
|
||||
*
|
||||
* @return [m/s] X linear speed
|
||||
*/
|
||||
static inline float mavlink_msg_odometry_get_vx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vy from odometry message
|
||||
*
|
||||
* @return [m/s] Y linear speed
|
||||
*/
|
||||
static inline float mavlink_msg_odometry_get_vy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vz from odometry message
|
||||
*
|
||||
* @return [m/s] Z linear speed
|
||||
*/
|
||||
static inline float mavlink_msg_odometry_get_vz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rollspeed from odometry message
|
||||
*
|
||||
* @return [rad/s] Roll angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_odometry_get_rollspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitchspeed from odometry message
|
||||
*
|
||||
* @return [rad/s] Pitch angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_odometry_get_pitchspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yawspeed from odometry message
|
||||
*
|
||||
* @return [rad/s] Yaw angular speed
|
||||
*/
|
||||
static inline float mavlink_msg_odometry_get_yawspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 56);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pose_covariance from odometry message
|
||||
*
|
||||
* @return Pose (states: x, y, z, roll, pitch, yaw) covariance matrix upper right triangle (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_odometry_get_pose_covariance(const mavlink_message_t* msg, float *pose_covariance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, pose_covariance, 21, 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field twist_covariance from odometry message
|
||||
*
|
||||
* @return Twist (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed) covariance matrix upper right triangle (first six entries are the first ROW, next five entries are the second ROW, etc.)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_odometry_get_twist_covariance(const mavlink_message_t* msg, float *twist_covariance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, twist_covariance, 21, 144);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a odometry message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param odometry C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_odometry_decode(const mavlink_message_t* msg, mavlink_odometry_t* odometry)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
odometry->time_usec = mavlink_msg_odometry_get_time_usec(msg);
|
||||
odometry->x = mavlink_msg_odometry_get_x(msg);
|
||||
odometry->y = mavlink_msg_odometry_get_y(msg);
|
||||
odometry->z = mavlink_msg_odometry_get_z(msg);
|
||||
mavlink_msg_odometry_get_q(msg, odometry->q);
|
||||
odometry->vx = mavlink_msg_odometry_get_vx(msg);
|
||||
odometry->vy = mavlink_msg_odometry_get_vy(msg);
|
||||
odometry->vz = mavlink_msg_odometry_get_vz(msg);
|
||||
odometry->rollspeed = mavlink_msg_odometry_get_rollspeed(msg);
|
||||
odometry->pitchspeed = mavlink_msg_odometry_get_pitchspeed(msg);
|
||||
odometry->yawspeed = mavlink_msg_odometry_get_yawspeed(msg);
|
||||
mavlink_msg_odometry_get_pose_covariance(msg, odometry->pose_covariance);
|
||||
mavlink_msg_odometry_get_twist_covariance(msg, odometry->twist_covariance);
|
||||
odometry->frame_id = mavlink_msg_odometry_get_frame_id(msg);
|
||||
odometry->child_frame_id = mavlink_msg_odometry_get_child_frame_id(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ODOMETRY_LEN? msg->len : MAVLINK_MSG_ID_ODOMETRY_LEN;
|
||||
memset(odometry, 0, MAVLINK_MSG_ID_ODOMETRY_LEN);
|
||||
memcpy(odometry, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,438 @@
|
||||
#pragma once
|
||||
// MESSAGE OPTICAL_FLOW PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_OPTICAL_FLOW 100
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_optical_flow_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
float flow_comp_m_x; /*< [m] Flow in x-sensor direction, angular-speed compensated*/
|
||||
float flow_comp_m_y; /*< [m] Flow in y-sensor direction, angular-speed compensated*/
|
||||
float ground_distance; /*< [m] Ground distance. Positive value: distance known. Negative value: Unknown distance*/
|
||||
int16_t flow_x; /*< [dpix] Flow in x-sensor direction*/
|
||||
int16_t flow_y; /*< [dpix] Flow in y-sensor direction*/
|
||||
uint8_t sensor_id; /*< Sensor ID*/
|
||||
uint8_t quality; /*< Optical flow quality / confidence. 0: bad, 255: maximum quality*/
|
||||
float flow_rate_x; /*< [rad/s] Flow rate about X axis*/
|
||||
float flow_rate_y; /*< [rad/s] Flow rate about Y axis*/
|
||||
}) mavlink_optical_flow_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 34
|
||||
#define MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN 26
|
||||
#define MAVLINK_MSG_ID_100_LEN 34
|
||||
#define MAVLINK_MSG_ID_100_MIN_LEN 26
|
||||
|
||||
#define MAVLINK_MSG_ID_OPTICAL_FLOW_CRC 175
|
||||
#define MAVLINK_MSG_ID_100_CRC 175
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \
|
||||
100, \
|
||||
"OPTICAL_FLOW", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \
|
||||
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_optical_flow_t, sensor_id) }, \
|
||||
{ "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_optical_flow_t, flow_x) }, \
|
||||
{ "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_optical_flow_t, flow_y) }, \
|
||||
{ "flow_comp_m_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, flow_comp_m_x) }, \
|
||||
{ "flow_comp_m_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_t, flow_comp_m_y) }, \
|
||||
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_optical_flow_t, quality) }, \
|
||||
{ "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \
|
||||
{ "flow_rate_x", NULL, MAVLINK_TYPE_FLOAT, 0, 26, offsetof(mavlink_optical_flow_t, flow_rate_x) }, \
|
||||
{ "flow_rate_y", NULL, MAVLINK_TYPE_FLOAT, 0, 30, offsetof(mavlink_optical_flow_t, flow_rate_y) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \
|
||||
"OPTICAL_FLOW", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \
|
||||
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_optical_flow_t, sensor_id) }, \
|
||||
{ "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_optical_flow_t, flow_x) }, \
|
||||
{ "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_optical_flow_t, flow_y) }, \
|
||||
{ "flow_comp_m_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, flow_comp_m_x) }, \
|
||||
{ "flow_comp_m_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_t, flow_comp_m_y) }, \
|
||||
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_optical_flow_t, quality) }, \
|
||||
{ "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \
|
||||
{ "flow_rate_x", NULL, MAVLINK_TYPE_FLOAT, 0, 26, offsetof(mavlink_optical_flow_t, flow_rate_x) }, \
|
||||
{ "flow_rate_y", NULL, MAVLINK_TYPE_FLOAT, 0, 30, offsetof(mavlink_optical_flow_t, flow_rate_y) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a optical_flow message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_id Sensor ID
|
||||
* @param flow_x [dpix] Flow in x-sensor direction
|
||||
* @param flow_y [dpix] Flow in y-sensor direction
|
||||
* @param flow_comp_m_x [m] Flow in x-sensor direction, angular-speed compensated
|
||||
* @param flow_comp_m_y [m] Flow in y-sensor direction, angular-speed compensated
|
||||
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
* @param ground_distance [m] Ground distance. Positive value: distance known. Negative value: Unknown distance
|
||||
* @param flow_rate_x [rad/s] Flow rate about X axis
|
||||
* @param flow_rate_y [rad/s] Flow rate about Y axis
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance, float flow_rate_x, float flow_rate_y)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, flow_comp_m_x);
|
||||
_mav_put_float(buf, 12, flow_comp_m_y);
|
||||
_mav_put_float(buf, 16, ground_distance);
|
||||
_mav_put_int16_t(buf, 20, flow_x);
|
||||
_mav_put_int16_t(buf, 22, flow_y);
|
||||
_mav_put_uint8_t(buf, 24, sensor_id);
|
||||
_mav_put_uint8_t(buf, 25, quality);
|
||||
_mav_put_float(buf, 26, flow_rate_x);
|
||||
_mav_put_float(buf, 30, flow_rate_y);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN);
|
||||
#else
|
||||
mavlink_optical_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.flow_comp_m_x = flow_comp_m_x;
|
||||
packet.flow_comp_m_y = flow_comp_m_y;
|
||||
packet.ground_distance = ground_distance;
|
||||
packet.flow_x = flow_x;
|
||||
packet.flow_y = flow_y;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
packet.flow_rate_x = flow_rate_x;
|
||||
packet.flow_rate_y = flow_rate_y;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a optical_flow message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_id Sensor ID
|
||||
* @param flow_x [dpix] Flow in x-sensor direction
|
||||
* @param flow_y [dpix] Flow in y-sensor direction
|
||||
* @param flow_comp_m_x [m] Flow in x-sensor direction, angular-speed compensated
|
||||
* @param flow_comp_m_y [m] Flow in y-sensor direction, angular-speed compensated
|
||||
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
* @param ground_distance [m] Ground distance. Positive value: distance known. Negative value: Unknown distance
|
||||
* @param flow_rate_x [rad/s] Flow rate about X axis
|
||||
* @param flow_rate_y [rad/s] Flow rate about Y axis
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t sensor_id,int16_t flow_x,int16_t flow_y,float flow_comp_m_x,float flow_comp_m_y,uint8_t quality,float ground_distance,float flow_rate_x,float flow_rate_y)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, flow_comp_m_x);
|
||||
_mav_put_float(buf, 12, flow_comp_m_y);
|
||||
_mav_put_float(buf, 16, ground_distance);
|
||||
_mav_put_int16_t(buf, 20, flow_x);
|
||||
_mav_put_int16_t(buf, 22, flow_y);
|
||||
_mav_put_uint8_t(buf, 24, sensor_id);
|
||||
_mav_put_uint8_t(buf, 25, quality);
|
||||
_mav_put_float(buf, 26, flow_rate_x);
|
||||
_mav_put_float(buf, 30, flow_rate_y);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN);
|
||||
#else
|
||||
mavlink_optical_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.flow_comp_m_x = flow_comp_m_x;
|
||||
packet.flow_comp_m_y = flow_comp_m_y;
|
||||
packet.ground_distance = ground_distance;
|
||||
packet.flow_x = flow_x;
|
||||
packet.flow_y = flow_y;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
packet.flow_rate_x = flow_rate_x;
|
||||
packet.flow_rate_y = flow_rate_y;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a optical_flow struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param optical_flow C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_optical_flow_t* optical_flow)
|
||||
{
|
||||
return mavlink_msg_optical_flow_pack(system_id, component_id, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance, optical_flow->flow_rate_x, optical_flow->flow_rate_y);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a optical_flow struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param optical_flow C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_optical_flow_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_optical_flow_t* optical_flow)
|
||||
{
|
||||
return mavlink_msg_optical_flow_pack_chan(system_id, component_id, chan, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance, optical_flow->flow_rate_x, optical_flow->flow_rate_y);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a optical_flow message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_id Sensor ID
|
||||
* @param flow_x [dpix] Flow in x-sensor direction
|
||||
* @param flow_y [dpix] Flow in y-sensor direction
|
||||
* @param flow_comp_m_x [m] Flow in x-sensor direction, angular-speed compensated
|
||||
* @param flow_comp_m_y [m] Flow in y-sensor direction, angular-speed compensated
|
||||
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
* @param ground_distance [m] Ground distance. Positive value: distance known. Negative value: Unknown distance
|
||||
* @param flow_rate_x [rad/s] Flow rate about X axis
|
||||
* @param flow_rate_y [rad/s] Flow rate about Y axis
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance, float flow_rate_x, float flow_rate_y)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, flow_comp_m_x);
|
||||
_mav_put_float(buf, 12, flow_comp_m_y);
|
||||
_mav_put_float(buf, 16, ground_distance);
|
||||
_mav_put_int16_t(buf, 20, flow_x);
|
||||
_mav_put_int16_t(buf, 22, flow_y);
|
||||
_mav_put_uint8_t(buf, 24, sensor_id);
|
||||
_mav_put_uint8_t(buf, 25, quality);
|
||||
_mav_put_float(buf, 26, flow_rate_x);
|
||||
_mav_put_float(buf, 30, flow_rate_y);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
|
||||
#else
|
||||
mavlink_optical_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.flow_comp_m_x = flow_comp_m_x;
|
||||
packet.flow_comp_m_y = flow_comp_m_y;
|
||||
packet.ground_distance = ground_distance;
|
||||
packet.flow_x = flow_x;
|
||||
packet.flow_y = flow_y;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
packet.flow_rate_x = flow_rate_x;
|
||||
packet.flow_rate_y = flow_rate_y;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a optical_flow message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_optical_flow_send_struct(mavlink_channel_t chan, const mavlink_optical_flow_t* optical_flow)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_optical_flow_send(chan, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance, optical_flow->flow_rate_x, optical_flow->flow_rate_y);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)optical_flow, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_OPTICAL_FLOW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_optical_flow_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance, float flow_rate_x, float flow_rate_y)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, flow_comp_m_x);
|
||||
_mav_put_float(buf, 12, flow_comp_m_y);
|
||||
_mav_put_float(buf, 16, ground_distance);
|
||||
_mav_put_int16_t(buf, 20, flow_x);
|
||||
_mav_put_int16_t(buf, 22, flow_y);
|
||||
_mav_put_uint8_t(buf, 24, sensor_id);
|
||||
_mav_put_uint8_t(buf, 25, quality);
|
||||
_mav_put_float(buf, 26, flow_rate_x);
|
||||
_mav_put_float(buf, 30, flow_rate_y);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
|
||||
#else
|
||||
mavlink_optical_flow_t *packet = (mavlink_optical_flow_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->flow_comp_m_x = flow_comp_m_x;
|
||||
packet->flow_comp_m_y = flow_comp_m_y;
|
||||
packet->ground_distance = ground_distance;
|
||||
packet->flow_x = flow_x;
|
||||
packet->flow_y = flow_y;
|
||||
packet->sensor_id = sensor_id;
|
||||
packet->quality = quality;
|
||||
packet->flow_rate_x = flow_rate_x;
|
||||
packet->flow_rate_y = flow_rate_y;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)packet, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE OPTICAL_FLOW UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from optical_flow message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_optical_flow_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sensor_id from optical_flow message
|
||||
*
|
||||
* @return Sensor ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flow_x from optical_flow message
|
||||
*
|
||||
* @return [dpix] Flow in x-sensor direction
|
||||
*/
|
||||
static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flow_y from optical_flow message
|
||||
*
|
||||
* @return [dpix] Flow in y-sensor direction
|
||||
*/
|
||||
static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flow_comp_m_x from optical_flow message
|
||||
*
|
||||
* @return [m] Flow in x-sensor direction, angular-speed compensated
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_get_flow_comp_m_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flow_comp_m_y from optical_flow message
|
||||
*
|
||||
* @return [m] Flow in y-sensor direction, angular-speed compensated
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_get_flow_comp_m_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field quality from optical_flow message
|
||||
*
|
||||
* @return Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_optical_flow_get_quality(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 25);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ground_distance from optical_flow message
|
||||
*
|
||||
* @return [m] Ground distance. Positive value: distance known. Negative value: Unknown distance
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_get_ground_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flow_rate_x from optical_flow message
|
||||
*
|
||||
* @return [rad/s] Flow rate about X axis
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_get_flow_rate_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flow_rate_y from optical_flow message
|
||||
*
|
||||
* @return [rad/s] Flow rate about Y axis
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_get_flow_rate_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a optical_flow message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param optical_flow C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_optical_flow_decode(const mavlink_message_t* msg, mavlink_optical_flow_t* optical_flow)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
optical_flow->time_usec = mavlink_msg_optical_flow_get_time_usec(msg);
|
||||
optical_flow->flow_comp_m_x = mavlink_msg_optical_flow_get_flow_comp_m_x(msg);
|
||||
optical_flow->flow_comp_m_y = mavlink_msg_optical_flow_get_flow_comp_m_y(msg);
|
||||
optical_flow->ground_distance = mavlink_msg_optical_flow_get_ground_distance(msg);
|
||||
optical_flow->flow_x = mavlink_msg_optical_flow_get_flow_x(msg);
|
||||
optical_flow->flow_y = mavlink_msg_optical_flow_get_flow_y(msg);
|
||||
optical_flow->sensor_id = mavlink_msg_optical_flow_get_sensor_id(msg);
|
||||
optical_flow->quality = mavlink_msg_optical_flow_get_quality(msg);
|
||||
optical_flow->flow_rate_x = mavlink_msg_optical_flow_get_flow_rate_x(msg);
|
||||
optical_flow->flow_rate_y = mavlink_msg_optical_flow_get_flow_rate_y(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_OPTICAL_FLOW_LEN? msg->len : MAVLINK_MSG_ID_OPTICAL_FLOW_LEN;
|
||||
memset(optical_flow, 0, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN);
|
||||
memcpy(optical_flow, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,488 @@
|
||||
#pragma once
|
||||
// MESSAGE OPTICAL_FLOW_RAD PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD 106
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_optical_flow_rad_t {
|
||||
uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.*/
|
||||
uint32_t integration_time_us; /*< [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.*/
|
||||
float integrated_x; /*< [rad] Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)*/
|
||||
float integrated_y; /*< [rad] Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)*/
|
||||
float integrated_xgyro; /*< [rad] RH rotation around X axis*/
|
||||
float integrated_ygyro; /*< [rad] RH rotation around Y axis*/
|
||||
float integrated_zgyro; /*< [rad] RH rotation around Z axis*/
|
||||
uint32_t time_delta_distance_us; /*< [us] Time since the distance was sampled.*/
|
||||
float distance; /*< [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.*/
|
||||
int16_t temperature; /*< [cdegC] Temperature*/
|
||||
uint8_t sensor_id; /*< Sensor ID*/
|
||||
uint8_t quality; /*< Optical flow quality / confidence. 0: no valid flow, 255: maximum quality*/
|
||||
}) mavlink_optical_flow_rad_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN 44
|
||||
#define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN 44
|
||||
#define MAVLINK_MSG_ID_106_LEN 44
|
||||
#define MAVLINK_MSG_ID_106_MIN_LEN 44
|
||||
|
||||
#define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC 138
|
||||
#define MAVLINK_MSG_ID_106_CRC 138
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD { \
|
||||
106, \
|
||||
"OPTICAL_FLOW_RAD", \
|
||||
12, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_rad_t, time_usec) }, \
|
||||
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_optical_flow_rad_t, sensor_id) }, \
|
||||
{ "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_optical_flow_rad_t, integration_time_us) }, \
|
||||
{ "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_rad_t, integrated_x) }, \
|
||||
{ "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_rad_t, integrated_y) }, \
|
||||
{ "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_optical_flow_rad_t, integrated_xgyro) }, \
|
||||
{ "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_optical_flow_rad_t, integrated_ygyro) }, \
|
||||
{ "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_optical_flow_rad_t, integrated_zgyro) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_optical_flow_rad_t, temperature) }, \
|
||||
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_optical_flow_rad_t, quality) }, \
|
||||
{ "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_optical_flow_rad_t, time_delta_distance_us) }, \
|
||||
{ "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_optical_flow_rad_t, distance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD { \
|
||||
"OPTICAL_FLOW_RAD", \
|
||||
12, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_rad_t, time_usec) }, \
|
||||
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_optical_flow_rad_t, sensor_id) }, \
|
||||
{ "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_optical_flow_rad_t, integration_time_us) }, \
|
||||
{ "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_rad_t, integrated_x) }, \
|
||||
{ "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_rad_t, integrated_y) }, \
|
||||
{ "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_optical_flow_rad_t, integrated_xgyro) }, \
|
||||
{ "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_optical_flow_rad_t, integrated_ygyro) }, \
|
||||
{ "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_optical_flow_rad_t, integrated_zgyro) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_optical_flow_rad_t, temperature) }, \
|
||||
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_optical_flow_rad_t, quality) }, \
|
||||
{ "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_optical_flow_rad_t, time_delta_distance_us) }, \
|
||||
{ "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_optical_flow_rad_t, distance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a optical_flow_rad message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_id Sensor ID
|
||||
* @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
|
||||
* @param integrated_x [rad] Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
|
||||
* @param integrated_y [rad] Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
|
||||
* @param integrated_xgyro [rad] RH rotation around X axis
|
||||
* @param integrated_ygyro [rad] RH rotation around Y axis
|
||||
* @param integrated_zgyro [rad] RH rotation around Z axis
|
||||
* @param temperature [cdegC] Temperature
|
||||
* @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
|
||||
* @param time_delta_distance_us [us] Time since the distance was sampled.
|
||||
* @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_optical_flow_rad_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, integration_time_us);
|
||||
_mav_put_float(buf, 12, integrated_x);
|
||||
_mav_put_float(buf, 16, integrated_y);
|
||||
_mav_put_float(buf, 20, integrated_xgyro);
|
||||
_mav_put_float(buf, 24, integrated_ygyro);
|
||||
_mav_put_float(buf, 28, integrated_zgyro);
|
||||
_mav_put_uint32_t(buf, 32, time_delta_distance_us);
|
||||
_mav_put_float(buf, 36, distance);
|
||||
_mav_put_int16_t(buf, 40, temperature);
|
||||
_mav_put_uint8_t(buf, 42, sensor_id);
|
||||
_mav_put_uint8_t(buf, 43, quality);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN);
|
||||
#else
|
||||
mavlink_optical_flow_rad_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.integration_time_us = integration_time_us;
|
||||
packet.integrated_x = integrated_x;
|
||||
packet.integrated_y = integrated_y;
|
||||
packet.integrated_xgyro = integrated_xgyro;
|
||||
packet.integrated_ygyro = integrated_ygyro;
|
||||
packet.integrated_zgyro = integrated_zgyro;
|
||||
packet.time_delta_distance_us = time_delta_distance_us;
|
||||
packet.distance = distance;
|
||||
packet.temperature = temperature;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW_RAD;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a optical_flow_rad message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_id Sensor ID
|
||||
* @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
|
||||
* @param integrated_x [rad] Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
|
||||
* @param integrated_y [rad] Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
|
||||
* @param integrated_xgyro [rad] RH rotation around X axis
|
||||
* @param integrated_ygyro [rad] RH rotation around Y axis
|
||||
* @param integrated_zgyro [rad] RH rotation around Z axis
|
||||
* @param temperature [cdegC] Temperature
|
||||
* @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
|
||||
* @param time_delta_distance_us [us] Time since the distance was sampled.
|
||||
* @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_optical_flow_rad_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t sensor_id,uint32_t integration_time_us,float integrated_x,float integrated_y,float integrated_xgyro,float integrated_ygyro,float integrated_zgyro,int16_t temperature,uint8_t quality,uint32_t time_delta_distance_us,float distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, integration_time_us);
|
||||
_mav_put_float(buf, 12, integrated_x);
|
||||
_mav_put_float(buf, 16, integrated_y);
|
||||
_mav_put_float(buf, 20, integrated_xgyro);
|
||||
_mav_put_float(buf, 24, integrated_ygyro);
|
||||
_mav_put_float(buf, 28, integrated_zgyro);
|
||||
_mav_put_uint32_t(buf, 32, time_delta_distance_us);
|
||||
_mav_put_float(buf, 36, distance);
|
||||
_mav_put_int16_t(buf, 40, temperature);
|
||||
_mav_put_uint8_t(buf, 42, sensor_id);
|
||||
_mav_put_uint8_t(buf, 43, quality);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN);
|
||||
#else
|
||||
mavlink_optical_flow_rad_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.integration_time_us = integration_time_us;
|
||||
packet.integrated_x = integrated_x;
|
||||
packet.integrated_y = integrated_y;
|
||||
packet.integrated_xgyro = integrated_xgyro;
|
||||
packet.integrated_ygyro = integrated_ygyro;
|
||||
packet.integrated_zgyro = integrated_zgyro;
|
||||
packet.time_delta_distance_us = time_delta_distance_us;
|
||||
packet.distance = distance;
|
||||
packet.temperature = temperature;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW_RAD;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a optical_flow_rad struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param optical_flow_rad C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_optical_flow_rad_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_optical_flow_rad_t* optical_flow_rad)
|
||||
{
|
||||
return mavlink_msg_optical_flow_rad_pack(system_id, component_id, msg, optical_flow_rad->time_usec, optical_flow_rad->sensor_id, optical_flow_rad->integration_time_us, optical_flow_rad->integrated_x, optical_flow_rad->integrated_y, optical_flow_rad->integrated_xgyro, optical_flow_rad->integrated_ygyro, optical_flow_rad->integrated_zgyro, optical_flow_rad->temperature, optical_flow_rad->quality, optical_flow_rad->time_delta_distance_us, optical_flow_rad->distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a optical_flow_rad struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param optical_flow_rad C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_optical_flow_rad_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_optical_flow_rad_t* optical_flow_rad)
|
||||
{
|
||||
return mavlink_msg_optical_flow_rad_pack_chan(system_id, component_id, chan, msg, optical_flow_rad->time_usec, optical_flow_rad->sensor_id, optical_flow_rad->integration_time_us, optical_flow_rad->integrated_x, optical_flow_rad->integrated_y, optical_flow_rad->integrated_xgyro, optical_flow_rad->integrated_ygyro, optical_flow_rad->integrated_zgyro, optical_flow_rad->temperature, optical_flow_rad->quality, optical_flow_rad->time_delta_distance_us, optical_flow_rad->distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a optical_flow_rad message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
* @param sensor_id Sensor ID
|
||||
* @param integration_time_us [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
|
||||
* @param integrated_x [rad] Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
|
||||
* @param integrated_y [rad] Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
|
||||
* @param integrated_xgyro [rad] RH rotation around X axis
|
||||
* @param integrated_ygyro [rad] RH rotation around Y axis
|
||||
* @param integrated_zgyro [rad] RH rotation around Z axis
|
||||
* @param temperature [cdegC] Temperature
|
||||
* @param quality Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
|
||||
* @param time_delta_distance_us [us] Time since the distance was sampled.
|
||||
* @param distance [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_optical_flow_rad_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, integration_time_us);
|
||||
_mav_put_float(buf, 12, integrated_x);
|
||||
_mav_put_float(buf, 16, integrated_y);
|
||||
_mav_put_float(buf, 20, integrated_xgyro);
|
||||
_mav_put_float(buf, 24, integrated_ygyro);
|
||||
_mav_put_float(buf, 28, integrated_zgyro);
|
||||
_mav_put_uint32_t(buf, 32, time_delta_distance_us);
|
||||
_mav_put_float(buf, 36, distance);
|
||||
_mav_put_int16_t(buf, 40, temperature);
|
||||
_mav_put_uint8_t(buf, 42, sensor_id);
|
||||
_mav_put_uint8_t(buf, 43, quality);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
|
||||
#else
|
||||
mavlink_optical_flow_rad_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.integration_time_us = integration_time_us;
|
||||
packet.integrated_x = integrated_x;
|
||||
packet.integrated_y = integrated_y;
|
||||
packet.integrated_xgyro = integrated_xgyro;
|
||||
packet.integrated_ygyro = integrated_ygyro;
|
||||
packet.integrated_zgyro = integrated_zgyro;
|
||||
packet.time_delta_distance_us = time_delta_distance_us;
|
||||
packet.distance = distance;
|
||||
packet.temperature = temperature;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a optical_flow_rad message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_optical_flow_rad_send_struct(mavlink_channel_t chan, const mavlink_optical_flow_rad_t* optical_flow_rad)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_optical_flow_rad_send(chan, optical_flow_rad->time_usec, optical_flow_rad->sensor_id, optical_flow_rad->integration_time_us, optical_flow_rad->integrated_x, optical_flow_rad->integrated_y, optical_flow_rad->integrated_xgyro, optical_flow_rad->integrated_ygyro, optical_flow_rad->integrated_zgyro, optical_flow_rad->temperature, optical_flow_rad->quality, optical_flow_rad->time_delta_distance_us, optical_flow_rad->distance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)optical_flow_rad, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_optical_flow_rad_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, integration_time_us);
|
||||
_mav_put_float(buf, 12, integrated_x);
|
||||
_mav_put_float(buf, 16, integrated_y);
|
||||
_mav_put_float(buf, 20, integrated_xgyro);
|
||||
_mav_put_float(buf, 24, integrated_ygyro);
|
||||
_mav_put_float(buf, 28, integrated_zgyro);
|
||||
_mav_put_uint32_t(buf, 32, time_delta_distance_us);
|
||||
_mav_put_float(buf, 36, distance);
|
||||
_mav_put_int16_t(buf, 40, temperature);
|
||||
_mav_put_uint8_t(buf, 42, sensor_id);
|
||||
_mav_put_uint8_t(buf, 43, quality);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
|
||||
#else
|
||||
mavlink_optical_flow_rad_t *packet = (mavlink_optical_flow_rad_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->integration_time_us = integration_time_us;
|
||||
packet->integrated_x = integrated_x;
|
||||
packet->integrated_y = integrated_y;
|
||||
packet->integrated_xgyro = integrated_xgyro;
|
||||
packet->integrated_ygyro = integrated_ygyro;
|
||||
packet->integrated_zgyro = integrated_zgyro;
|
||||
packet->time_delta_distance_us = time_delta_distance_us;
|
||||
packet->distance = distance;
|
||||
packet->temperature = temperature;
|
||||
packet->sensor_id = sensor_id;
|
||||
packet->quality = quality;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE OPTICAL_FLOW_RAD UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from optical_flow_rad message
|
||||
*
|
||||
* @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_optical_flow_rad_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sensor_id from optical_flow_rad message
|
||||
*
|
||||
* @return Sensor ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_optical_flow_rad_get_sensor_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 42);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integration_time_us from optical_flow_rad message
|
||||
*
|
||||
* @return [us] Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_optical_flow_rad_get_integration_time_us(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integrated_x from optical_flow_rad message
|
||||
*
|
||||
* @return [rad] Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_rad_get_integrated_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integrated_y from optical_flow_rad message
|
||||
*
|
||||
* @return [rad] Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_rad_get_integrated_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integrated_xgyro from optical_flow_rad message
|
||||
*
|
||||
* @return [rad] RH rotation around X axis
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_rad_get_integrated_xgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integrated_ygyro from optical_flow_rad message
|
||||
*
|
||||
* @return [rad] RH rotation around Y axis
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_rad_get_integrated_ygyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field integrated_zgyro from optical_flow_rad message
|
||||
*
|
||||
* @return [rad] RH rotation around Z axis
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_rad_get_integrated_zgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field temperature from optical_flow_rad message
|
||||
*
|
||||
* @return [cdegC] Temperature
|
||||
*/
|
||||
static inline int16_t mavlink_msg_optical_flow_rad_get_temperature(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field quality from optical_flow_rad message
|
||||
*
|
||||
* @return Optical flow quality / confidence. 0: no valid flow, 255: maximum quality
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_optical_flow_rad_get_quality(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 43);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_delta_distance_us from optical_flow_rad message
|
||||
*
|
||||
* @return [us] Time since the distance was sampled.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_optical_flow_rad_get_time_delta_distance_us(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field distance from optical_flow_rad message
|
||||
*
|
||||
* @return [m] Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_rad_get_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a optical_flow_rad message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param optical_flow_rad C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_optical_flow_rad_decode(const mavlink_message_t* msg, mavlink_optical_flow_rad_t* optical_flow_rad)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
optical_flow_rad->time_usec = mavlink_msg_optical_flow_rad_get_time_usec(msg);
|
||||
optical_flow_rad->integration_time_us = mavlink_msg_optical_flow_rad_get_integration_time_us(msg);
|
||||
optical_flow_rad->integrated_x = mavlink_msg_optical_flow_rad_get_integrated_x(msg);
|
||||
optical_flow_rad->integrated_y = mavlink_msg_optical_flow_rad_get_integrated_y(msg);
|
||||
optical_flow_rad->integrated_xgyro = mavlink_msg_optical_flow_rad_get_integrated_xgyro(msg);
|
||||
optical_flow_rad->integrated_ygyro = mavlink_msg_optical_flow_rad_get_integrated_ygyro(msg);
|
||||
optical_flow_rad->integrated_zgyro = mavlink_msg_optical_flow_rad_get_integrated_zgyro(msg);
|
||||
optical_flow_rad->time_delta_distance_us = mavlink_msg_optical_flow_rad_get_time_delta_distance_us(msg);
|
||||
optical_flow_rad->distance = mavlink_msg_optical_flow_rad_get_distance(msg);
|
||||
optical_flow_rad->temperature = mavlink_msg_optical_flow_rad_get_temperature(msg);
|
||||
optical_flow_rad->sensor_id = mavlink_msg_optical_flow_rad_get_sensor_id(msg);
|
||||
optical_flow_rad->quality = mavlink_msg_optical_flow_rad_get_quality(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN? msg->len : MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN;
|
||||
memset(optical_flow_rad, 0, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN);
|
||||
memcpy(optical_flow_rad, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user