Commit 0ab8d14e authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

Update to mavlink v2.0

parent eb671e42
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/** @file
* @brief MAVLink comm protocol built from CAstral.xml
* @brief MAVLink comm protocol built from common.xml
* @see http://mavlink.org
*/
#pragma once
#ifndef MAVLINK_H
#define MAVLINK_H
#define MAVLINK_PRIMARY_XML_HASH 6031851515892169057
#define MAVLINK_PRIMARY_XML_HASH -4223721478284723775
#ifndef MAVLINK_STX
#define MAVLINK_STX 253
......@@ -29,6 +29,6 @@
#endif
#include "version.h"
#include "CAstral.h"
#include "common.h"
#endif // MAVLINK_H
......@@ -5,7 +5,7 @@
typedef struct __mavlink_actuator_control_target_t {
uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
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 of 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;
......@@ -47,7 +47,7 @@ typedef struct __mavlink_actuator_control_target_t {
* @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 Timestamp (micros since boot or Unix epoch)
* @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 of 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)
......@@ -79,7 +79,7 @@ static inline uint16_t mavlink_msg_actuator_control_target_pack(uint8_t system_i
* @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 Timestamp (micros since boot or Unix epoch)
* @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 of 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)
......@@ -137,7 +137,7 @@ static inline uint16_t mavlink_msg_actuator_control_target_encode_chan(uint8_t s
* @brief Send a actuator_control_target message
* @param chan MAVLink channel to send the message
*
* @param time_usec Timestamp (micros since boot or Unix epoch)
* @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 of 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.
*/
......@@ -208,7 +208,7 @@ static inline void mavlink_msg_actuator_control_target_send_buf(mavlink_message_
/**
* @brief Get field time_usec from actuator_control_target message
*
* @return Timestamp (micros since boot or Unix epoch)
* @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 of the number.
*/
static inline uint64_t mavlink_msg_actuator_control_target_get_time_usec(const mavlink_message_t* msg)
{
......
// MESSAGE ACTUATOR_CONTROL_TARGET support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief ACTUATOR_CONTROL_TARGET message
*
* Set the vehicle attitude and body angular rates.
*/
struct ACTUATOR_CONTROL_TARGET : mavlink::Message {
static constexpr msgid_t MSG_ID = 140;
static constexpr size_t LENGTH = 41;
static constexpr size_t MIN_LENGTH = 41;
static constexpr uint8_t CRC_EXTRA = 181;
static constexpr auto NAME = "ACTUATOR_CONTROL_TARGET";
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 of the number. */
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. */
std::array<float, 8> 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. */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_usec: " << time_usec << std::endl;
ss << " group_mlx: " << +group_mlx << std::endl;
ss << " controls: [" << to_string(controls) << "]" << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_usec; // offset: 0
map << controls; // offset: 8
map << group_mlx; // offset: 40
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_usec; // offset: 0
map >> controls; // offset: 8
map >> group_mlx; // offset: 40
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
// MESSAGE ACTUATOR_OUTPUT_STATUS support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief ACTUATOR_OUTPUT_STATUS message
*
* The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW.
*/
struct ACTUATOR_OUTPUT_STATUS : mavlink::Message {
static constexpr msgid_t MSG_ID = 375;
static constexpr size_t LENGTH = 140;
static constexpr size_t MIN_LENGTH = 140;
static constexpr uint8_t CRC_EXTRA = 251;
static constexpr auto NAME = "ACTUATOR_OUTPUT_STATUS";
uint64_t time_usec; /*< [us] Timestamp (since system boot). */
uint32_t active; /*< Active outputs */
std::array<float, 32> actuator; /*< Servo / motor output array values. Zero values indicate unused channels. */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_usec: " << time_usec << std::endl;
ss << " active: " << active << std::endl;
ss << " actuator: [" << to_string(actuator) << "]" << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_usec; // offset: 0
map << active; // offset: 8
map << actuator; // offset: 12
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_usec; // offset: 0
map >> active; // offset: 8
map >> actuator; // offset: 12
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
......@@ -6,18 +6,18 @@
typedef struct __mavlink_adsb_vehicle_t {
uint32_t ICAO_address; /*< ICAO address*/
int32_t lat; /*< Latitude, expressed as degrees * 1E7*/
int32_t lon; /*< Longitude, expressed as degrees * 1E7*/
int32_t altitude; /*< Altitude(ASL) in millimeters*/
uint16_t heading; /*< Course over ground in centidegrees*/
uint16_t hor_velocity; /*< The horizontal velocity in centimeters/second*/
int16_t ver_velocity; /*< The vertical velocity in centimeters/second, positive is up*/
uint16_t flags; /*< Flags to indicate various statuses including valid data fields*/
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; /*< Type from ADSB_ALTITUDE_TYPE enum*/
uint8_t altitude_type; /*< ADSB altitude type.*/
char callsign[9]; /*< The callsign, 8+null*/
uint8_t emitter_type; /*< Type from ADSB_EMITTER_TYPE enum*/
uint8_t tslc; /*< Time since last communication in seconds*/
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
......@@ -78,17 +78,17 @@ typedef struct __mavlink_adsb_vehicle_t {
* @param msg The MAVLink message to compress the data into
*
* @param ICAO_address ICAO address
* @param lat Latitude, expressed as degrees * 1E7
* @param lon Longitude, expressed as degrees * 1E7
* @param altitude_type Type from ADSB_ALTITUDE_TYPE enum
* @param altitude Altitude(ASL) in millimeters
* @param heading Course over ground in centidegrees
* @param hor_velocity The horizontal velocity in centimeters/second
* @param ver_velocity The vertical velocity in centimeters/second, positive is up
* @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 Type from ADSB_EMITTER_TYPE enum
* @param tslc Time since last communication in seconds
* @param flags Flags to indicate various statuses including valid data fields
* @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)
*/
......@@ -140,17 +140,17 @@ static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t
* @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 Latitude, expressed as degrees * 1E7
* @param lon Longitude, expressed as degrees * 1E7
* @param altitude_type Type from ADSB_ALTITUDE_TYPE enum
* @param altitude Altitude(ASL) in millimeters
* @param heading Course over ground in centidegrees
* @param hor_velocity The horizontal velocity in centimeters/second
* @param ver_velocity The vertical velocity in centimeters/second, positive is up
* @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 Type from ADSB_EMITTER_TYPE enum
* @param tslc Time since last communication in seconds
* @param flags Flags to indicate various statuses including valid data fields
* @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)
*/
......@@ -228,17 +228,17 @@ static inline uint16_t mavlink_msg_adsb_vehicle_encode_chan(uint8_t system_id, u
* @param chan MAVLink channel to send the message
*
* @param ICAO_address ICAO address
* @param lat Latitude, expressed as degrees * 1E7
* @param lon Longitude, expressed as degrees * 1E7
* @param altitude_type Type from ADSB_ALTITUDE_TYPE enum
* @param altitude Altitude(ASL) in millimeters
* @param heading Course over ground in centidegrees
* @param hor_velocity The horizontal velocity in centimeters/second
* @param ver_velocity The vertical velocity in centimeters/second, positive is up
* @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 Type from ADSB_EMITTER_TYPE enum
* @param tslc Time since last communication in seconds
* @param flags Flags to indicate various statuses including valid data fields
* @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
......@@ -358,7 +358,7 @@ static inline uint32_t mavlink_msg_adsb_vehicle_get_ICAO_address(const mavlink_m
/**
* @brief Get field lat from adsb_vehicle message
*
* @return Latitude, expressed as degrees * 1E7
* @return [degE7] Latitude
*/
static inline int32_t mavlink_msg_adsb_vehicle_get_lat(const mavlink_message_t* msg)
{
......@@ -368,7 +368,7 @@ static inline int32_t mavlink_msg_adsb_vehicle_get_lat(const mavlink_message_t*
/**
* @brief Get field lon from adsb_vehicle message
*
* @return Longitude, expressed as degrees * 1E7
* @return [degE7] Longitude
*/
static inline int32_t mavlink_msg_adsb_vehicle_get_lon(const mavlink_message_t* msg)
{
......@@ -378,7 +378,7 @@ static inline int32_t mavlink_msg_adsb_vehicle_get_lon(const mavlink_message_t*
/**
* @brief Get field altitude_type from adsb_vehicle message
*
* @return Type from ADSB_ALTITUDE_TYPE enum
* @return ADSB altitude type.
*/
static inline uint8_t mavlink_msg_adsb_vehicle_get_altitude_type(const mavlink_message_t* msg)
{
......@@ -388,7 +388,7 @@ static inline uint8_t mavlink_msg_adsb_vehicle_get_altitude_type(const mavlink_m
/**
* @brief Get field altitude from adsb_vehicle message
*
* @return Altitude(ASL) in millimeters
* @return [mm] Altitude(ASL)
*/
static inline int32_t mavlink_msg_adsb_vehicle_get_altitude(const mavlink_message_t* msg)
{
......@@ -398,7 +398,7 @@ static inline int32_t mavlink_msg_adsb_vehicle_get_altitude(const mavlink_messag
/**
* @brief Get field heading from adsb_vehicle message
*
* @return Course over ground in centidegrees
* @return [cdeg] Course over ground
*/
static inline uint16_t mavlink_msg_adsb_vehicle_get_heading(const mavlink_message_t* msg)
{
......@@ -408,7 +408,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_heading(const mavlink_messag
/**
* @brief Get field hor_velocity from adsb_vehicle message
*
* @return The horizontal velocity in centimeters/second
* @return [cm/s] The horizontal velocity
*/
static inline uint16_t mavlink_msg_adsb_vehicle_get_hor_velocity(const mavlink_message_t* msg)
{
......@@ -418,7 +418,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_hor_velocity(const mavlink_m
/**
* @brief Get field ver_velocity from adsb_vehicle message
*
* @return The vertical velocity in centimeters/second, positive is up
* @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)
{
......@@ -438,7 +438,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_callsign(const mavlink_messa
/**
* @brief Get field emitter_type from adsb_vehicle message
*
* @return Type from ADSB_EMITTER_TYPE enum
* @return ADSB emitter type.
*/
static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(const mavlink_message_t* msg)
{
......@@ -448,7 +448,7 @@ static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(const mavlink_me
/**
* @brief Get field tslc from adsb_vehicle message
*
* @return Time since last communication in seconds
* @return [s] Time since last communication in seconds
*/
static inline uint8_t mavlink_msg_adsb_vehicle_get_tslc(const mavlink_message_t* msg)
{
......@@ -458,7 +458,7 @@ static inline uint8_t mavlink_msg_adsb_vehicle_get_tslc(const mavlink_message_t*
/**
* @brief Get field flags from adsb_vehicle message
*
* @return Flags to indicate various statuses including valid data fields
* @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)
{
......
// MESSAGE ADSB_VEHICLE support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief ADSB_VEHICLE message
*
* The location and information of an ADSB vehicle
*/
struct ADSB_VEHICLE : mavlink::Message {
static constexpr msgid_t MSG_ID = 246;
static constexpr size_t LENGTH = 38;
static constexpr size_t MIN_LENGTH = 38;
static constexpr uint8_t CRC_EXTRA = 184;
static constexpr auto NAME = "ADSB_VEHICLE";
uint32_t ICAO_address; /*< ICAO address */
int32_t lat; /*< [degE7] Latitude */
int32_t lon; /*< [degE7] Longitude */
uint8_t altitude_type; /*< ADSB altitude type. */
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 */
std::array<char, 9> callsign; /*< The callsign, 8+null */
uint8_t emitter_type; /*< ADSB emitter type. */
uint8_t tslc; /*< [s] Time since last communication in seconds */
uint16_t flags; /*< Bitmap to indicate various statuses including valid data fields */
uint16_t squawk; /*< Squawk code */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " ICAO_address: " << ICAO_address << std::endl;
ss << " lat: " << lat << std::endl;
ss << " lon: " << lon << std::endl;
ss << " altitude_type: " << +altitude_type << std::endl;
ss << " altitude: " << altitude << std::endl;
ss << " heading: " << heading << std::endl;
ss << " hor_velocity: " << hor_velocity << std::endl;
ss << " ver_velocity: " << ver_velocity << std::endl;
ss << " callsign: \"" << to_string(callsign) << "\"" << std::endl;
ss << " emitter_type: " << +emitter_type << std::endl;
ss << " tslc: " << +tslc << std::endl;
ss << " flags: " << flags << std::endl;
ss << " squawk: " << squawk << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << ICAO_address; // offset: 0
map << lat; // offset: 4
map << lon; // offset: 8
map << altitude; // offset: 12
map << heading; // offset: 16
map << hor_velocity; // offset: 18
map << ver_velocity; // offset: 20
map << flags; // offset: 22
map << squawk; // offset: 24
map << altitude_type; // offset: 26
map << callsign; // offset: 27
map << emitter_type; // offset: 36
map << tslc; // offset: 37
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> ICAO_address; // offset: 0
map >> lat; // offset: 4
map >> lon; // offset: 8
map >> altitude; // offset: 12
map >> heading; // offset: 16
map >> hor_velocity; // offset: 18
map >> ver_velocity; // offset: 20
map >> flags; // offset: 22
map >> squawk; // offset: 24
map >> altitude_type; // offset: 26
map >> callsign; // offset: 27
map >> emitter_type; // offset: 36
map >> tslc; // offset: 37
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
This diff is collapsed.
// MESSAGE AIS_VESSEL support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief AIS_VESSEL message
*
* The location and information of an AIS vessel
*/
struct AIS_VESSEL : mavlink::Message {
static constexpr msgid_t MSG_ID = 301;
static constexpr size_t LENGTH = 58;
static constexpr size_t MIN_LENGTH = 58;
static constexpr uint8_t CRC_EXTRA = 243;
static constexpr auto NAME = "AIS_VESSEL";
uint32_t MMSI; /*< Mobile Marine Service Identifier, 9 decimal digits */
int32_t lat; /*< [degE7] Latitude */
int32_t lon; /*< [degE7] Longitude */
uint16_t COG; /*< [cdeg] Course over ground */
uint16_t heading; /*< [cdeg] True heading */
uint16_t velocity; /*< [cm/s] Speed over ground */
int8_t turn_rate; /*< [cdeg/s] Turn rate */
uint8_t navigational_status; /*< Navigational status */
uint8_t type; /*< Type of vessels */
uint16_t dimension_bow; /*< [m] Distance from lat/lon location to bow */
uint16_t dimension_stern; /*< [m] Distance from lat/lon location to stern */
uint8_t dimension_port; /*< [m] Distance from lat/lon location to port side */
uint8_t dimension_starboard; /*< [m] Distance from lat/lon location to starboard side */
std::array<char, 7> callsign; /*< The vessel callsign */
std::array<char, 20> name; /*< The vessel name */
uint16_t tslc; /*< [s] Time since last communication in seconds */
uint16_t flags; /*< Bitmask to indicate various statuses including valid data fields */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " MMSI: " << MMSI << std::endl;
ss << " lat: " << lat << std::endl;
ss << " lon: " << lon << std::endl;
ss << " COG: " << COG << std::endl;
ss << " heading: " << heading << std::endl;
ss << " velocity: " << velocity << std::endl;
ss << " turn_rate: " << +turn_rate << std::endl;
ss << " navigational_status: " << +navigational_status << std::endl;
ss << " type: " << +type << std::endl;
ss << " dimension_bow: " << dimension_bow << std::endl;
ss << " dimension_stern: " << dimension_stern << std::endl;
ss << " dimension_port: " << +dimension_port << std::endl;
ss << " dimension_starboard: " << +dimension_starboard << std::endl;
ss << " callsign: \"" << to_string(callsign) << "\"" << std::endl;
ss << " name: \"" << to_string(name) << "\"" << std::endl;
ss << " tslc: " << tslc << std::endl;
ss << " flags: " << flags << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << MMSI; // offset: 0
map << lat; // offset: 4
map << lon; // offset: 8
map << COG; // offset: 12
map << heading; // offset: 14
map << velocity; // offset: 16
map << dimension_bow; // offset: 18
map << dimension_stern; // offset: 20
map << tslc; // offset: 22
map << flags; // offset: 24
map << turn_rate; // offset: 26
map << navigational_status; // offset: 27
map << type; // offset: 28
map << dimension_port; // offset: 29
map << dimension_starboard; // offset: 30
map << callsign; // offset: 31
map << name; // offset: 38
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> MMSI; // offset: 0
map >> lat; // offset: 4
map >> lon; // offset: 8
map >> COG; // offset: 12
map >> heading; // offset: 14
map >> velocity; // offset: 16
map >> dimension_bow; // offset: 18
map >> dimension_stern; // offset: 20
map >> tslc; // offset: 22
map >> flags; // offset: 24
map >> turn_rate; // offset: 26
map >> navigational_status; // offset: 27
map >> type; // offset: 28
map >> dimension_port; // offset: 29
map >> dimension_starboard; // offset: 30
map >> callsign; // offset: 31
map >> name; // offset: 38
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
// MESSAGE ALTITUDE support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief ALTITUDE message
*
* The current system altitude.
*/
struct ALTITUDE : mavlink::Message {
static constexpr msgid_t MSG_ID = 141;
static constexpr size_t LENGTH = 32;
static constexpr size_t MIN_LENGTH = 32;
static constexpr uint8_t CRC_EXTRA = 47;
static constexpr auto NAME = "ALTITUDE";
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 of 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 MSL 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. */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_usec: " << time_usec << std::endl;
ss << " altitude_monotonic: " << altitude_monotonic << std::endl;
ss << " altitude_amsl: " << altitude_amsl << std::endl;
ss << " altitude_local: " << altitude_local << std::endl;
ss << " altitude_relative: " << altitude_relative << std::endl;
ss << " altitude_terrain: " << altitude_terrain << std::endl;
ss << " bottom_clearance: " << bottom_clearance << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_usec; // offset: 0
map << altitude_monotonic; // offset: 8
map << altitude_amsl; // offset: 12
map << altitude_local; // offset: 16
map << altitude_relative; // offset: 20
map << altitude_terrain; // offset: 24
map << bottom_clearance; // offset: 28
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_usec; // offset: 0
map >> altitude_monotonic; // offset: 8
map >> altitude_amsl; // offset: 12
map >> altitude_local; // offset: 16
map >> altitude_relative; // offset: 20
map >> altitude_terrain; // offset: 24
map >> bottom_clearance; // offset: 28
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
......@@ -5,11 +5,11 @@
typedef struct __mavlink_att_pos_mocap_t {
uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
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 of the number.*/
float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
float x; /*< X position in meters (NED)*/
float y; /*< Y position in meters (NED)*/
float z; /*< Z position in meters (NED)*/
float x; /*< [m] X position (NED)*/
float y; /*< [m] Y position (NED)*/
float z; /*< [m] Z position (NED)*/
float covariance[21]; /*< Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.*/
} mavlink_att_pos_mocap_t;
......@@ -57,11 +57,11 @@ typedef struct __mavlink_att_pos_mocap_t {
* @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 Timestamp (micros since boot or Unix epoch)
* @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 of the number.
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
* @param x X position in meters (NED)
* @param y Y position in meters (NED)
* @param z Z position in meters (NED)
* @param x [m] X position (NED)
* @param y [m] Y position (NED)
* @param z [m] Z position (NED)
* @param covariance Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.
* @return length of the message in bytes (excluding serial stream start sign)
*/
......@@ -98,11 +98,11 @@ static inline uint16_t mavlink_msg_att_pos_mocap_pack(uint8_t system_id, uint8_t
* @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 Timestamp (micros since boot or Unix epoch)
* @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 of the number.
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
* @param x X position in meters (NED)
* @param y Y position in meters (NED)
* @param z Z position in meters (NED)
* @param x [m] X position (NED)
* @param y [m] Y position (NED)
* @param z [m] Z position (NED)
* @param covariance Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.
* @return length of the message in bytes (excluding serial stream start sign)
*/
......@@ -165,11 +165,11 @@ static inline uint16_t mavlink_msg_att_pos_mocap_encode_chan(uint8_t system_id,
* @brief Send a att_pos_mocap message
* @param chan MAVLink channel to send the message
*
* @param time_usec Timestamp (micros since boot or Unix epoch)
* @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 of the number.
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
* @param x X position in meters (NED)
* @param y Y position in meters (NED)
* @param z Z position in meters (NED)
* @param x [m] X position (NED)
* @param y [m] Y position (NED)
* @param z [m] Z position (NED)
* @param covariance Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
......@@ -251,7 +251,7 @@ static inline void mavlink_msg_att_pos_mocap_send_buf(mavlink_message_t *msgbuf,
/**
* @brief Get field time_usec from att_pos_mocap message
*
* @return Timestamp (micros since boot or Unix epoch)
* @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 of the number.
*/
static inline uint64_t mavlink_msg_att_pos_mocap_get_time_usec(const mavlink_message_t* msg)
{
......@@ -271,7 +271,7 @@ static inline uint16_t mavlink_msg_att_pos_mocap_get_q(const mavlink_message_t*
/**
* @brief Get field x from att_pos_mocap message
*
* @return X position in meters (NED)
* @return [m] X position (NED)
*/
static inline float mavlink_msg_att_pos_mocap_get_x(const mavlink_message_t* msg)
{
......@@ -281,7 +281,7 @@ static inline float mavlink_msg_att_pos_mocap_get_x(const mavlink_message_t* msg
/**
* @brief Get field y from att_pos_mocap message
*
* @return Y position in meters (NED)
* @return [m] Y position (NED)
*/
static inline float mavlink_msg_att_pos_mocap_get_y(const mavlink_message_t* msg)
{
......@@ -291,7 +291,7 @@ static inline float mavlink_msg_att_pos_mocap_get_y(const mavlink_message_t* msg
/**
* @brief Get field z from att_pos_mocap message
*
* @return Z position in meters (NED)
* @return [m] Z position (NED)
*/
static inline float mavlink_msg_att_pos_mocap_get_z(const mavlink_message_t* msg)
{
......
// MESSAGE ATT_POS_MOCAP support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief ATT_POS_MOCAP message
*
* Motion capture attitude and position
*/
struct ATT_POS_MOCAP : mavlink::Message {
static constexpr msgid_t MSG_ID = 138;
static constexpr size_t LENGTH = 120;
static constexpr size_t MIN_LENGTH = 36;
static constexpr uint8_t CRC_EXTRA = 109;
static constexpr auto NAME = "ATT_POS_MOCAP";
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 of the number. */
std::array<float, 4> q; /*< 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) */
std::array<float, 21> covariance; /*< Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_usec: " << time_usec << std::endl;
ss << " q: [" << to_string(q) << "]" << std::endl;
ss << " x: " << x << std::endl;
ss << " y: " << y << std::endl;
ss << " z: " << z << std::endl;
ss << " covariance: [" << to_string(covariance) << "]" << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_usec; // offset: 0
map << q; // offset: 8
map << x; // offset: 24
map << y; // offset: 28
map << z; // offset: 32
map << covariance; // offset: 36
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_usec; // offset: 0
map >> q; // offset: 8
map >> x; // offset: 24
map >> y; // offset: 28
map >> z; // offset: 32
map >> covariance; // offset: 36
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
......@@ -5,13 +5,13 @@
typedef struct __mavlink_attitude_t {
uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
float roll; /*< Roll angle (rad, -pi..+pi)*/
float pitch; /*< Pitch angle (rad, -pi..+pi)*/
float yaw; /*< Yaw angle (rad, -pi..+pi)*/
float rollspeed; /*< Roll angular speed (rad/s)*/
float pitchspeed; /*< Pitch angular speed (rad/s)*/
float yawspeed; /*< Yaw angular speed (rad/s)*/
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
......@@ -59,13 +59,13 @@ typedef struct __mavlink_attitude_t {
* @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 Timestamp (milliseconds since system boot)
* @param roll Roll angle (rad, -pi..+pi)
* @param pitch Pitch angle (rad, -pi..+pi)
* @param yaw Yaw angle (rad, -pi..+pi)
* @param rollspeed Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @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,
......@@ -105,13 +105,13 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp
* @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 Timestamp (milliseconds since system boot)
* @param roll Roll angle (rad, -pi..+pi)
* @param pitch Pitch angle (rad, -pi..+pi)
* @param yaw Yaw angle (rad, -pi..+pi)
* @param rollspeed Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @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,
......@@ -177,13 +177,13 @@ static inline uint16_t mavlink_msg_attitude_encode_chan(uint8_t system_id, uint8
* @brief Send a attitude message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param roll Roll angle (rad, -pi..+pi)
* @param pitch Pitch angle (rad, -pi..+pi)
* @param yaw Yaw angle (rad, -pi..+pi)
* @param rollspeed Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @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
......@@ -272,7 +272,7 @@ static inline void mavlink_msg_attitude_send_buf(mavlink_message_t *msgbuf, mavl
/**
* @brief Get field time_boot_ms from attitude message
*
* @return Timestamp (milliseconds since system boot)
* @return [ms] Timestamp (time since system boot).
*/
static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_message_t* msg)
{
......@@ -282,7 +282,7 @@ static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_messa
/**
* @brief Get field roll from attitude message
*
* @return Roll angle (rad, -pi..+pi)
* @return [rad] Roll angle (-pi..+pi)
*/
static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg)
{
......@@ -292,7 +292,7 @@ static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg)
/**
* @brief Get field pitch from attitude message
*
* @return Pitch angle (rad, -pi..+pi)
* @return [rad] Pitch angle (-pi..+pi)
*/
static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg)
{
......@@ -302,7 +302,7 @@ static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg)
/**
* @brief Get field yaw from attitude message
*
* @return Yaw angle (rad, -pi..+pi)
* @return [rad] Yaw angle (-pi..+pi)
*/
static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg)
{
......@@ -312,7 +312,7 @@ static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg)
/**
* @brief Get field rollspeed from attitude message
*
* @return Roll angular speed (rad/s)
* @return [rad/s] Roll angular speed
*/
static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t* msg)
{
......@@ -322,7 +322,7 @@ static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t*
/**
* @brief Get field pitchspeed from attitude message
*
* @return Pitch angular speed (rad/s)
* @return [rad/s] Pitch angular speed
*/
static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t* msg)
{
......@@ -332,7 +332,7 @@ static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t*
/**
* @brief Get field yawspeed from attitude message
*
* @return Yaw angular speed (rad/s)
* @return [rad/s] Yaw angular speed
*/
static inline float mavlink_msg_attitude_get_yawspeed(const mavlink_message_t* msg)
{
......
// MESSAGE ATTITUDE support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief ATTITUDE message
*
* The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right).
*/
struct ATTITUDE : mavlink::Message {
static constexpr msgid_t MSG_ID = 30;
static constexpr size_t LENGTH = 28;
static constexpr size_t MIN_LENGTH = 28;
static constexpr uint8_t CRC_EXTRA = 39;
static constexpr auto NAME = "ATTITUDE";
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 */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_boot_ms: " << time_boot_ms << std::endl;
ss << " roll: " << roll << std::endl;
ss << " pitch: " << pitch << std::endl;
ss << " yaw: " << yaw << std::endl;
ss << " rollspeed: " << rollspeed << std::endl;
ss << " pitchspeed: " << pitchspeed << std::endl;
ss << " yawspeed: " << yawspeed << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_boot_ms; // offset: 0
map << roll; // offset: 4
map << pitch; // offset: 8
map << yaw; // offset: 12
map << rollspeed; // offset: 16
map << pitchspeed; // offset: 20
map << yawspeed; // offset: 24
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_boot_ms; // offset: 0
map >> roll; // offset: 4
map >> pitch; // offset: 8
map >> yaw; // offset: 12
map >> rollspeed; // offset: 16
map >> pitchspeed; // offset: 20
map >> yawspeed; // offset: 24
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
// MESSAGE ATTITUDE_QUATERNION support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief ATTITUDE_QUATERNION message
*
* The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0).
*/
struct ATTITUDE_QUATERNION : mavlink::Message {
static constexpr msgid_t MSG_ID = 31;
static constexpr size_t LENGTH = 48;
static constexpr size_t MIN_LENGTH = 32;
static constexpr uint8_t CRC_EXTRA = 246;
static constexpr auto NAME = "ATTITUDE_QUATERNION";
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 */
std::array<float, 4> repr_offset_q; /*< Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode. */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_boot_ms: " << time_boot_ms << std::endl;
ss << " q1: " << q1 << std::endl;
ss << " q2: " << q2 << std::endl;
ss << " q3: " << q3 << std::endl;
ss << " q4: " << q4 << std::endl;
ss << " rollspeed: " << rollspeed << std::endl;
ss << " pitchspeed: " << pitchspeed << std::endl;
ss << " yawspeed: " << yawspeed << std::endl;
ss << " repr_offset_q: [" << to_string(repr_offset_q) << "]" << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_boot_ms; // offset: 0
map << q1; // offset: 4
map << q2; // offset: 8
map << q3; // offset: 12
map << q4; // offset: 16
map << rollspeed; // offset: 20
map << pitchspeed; // offset: 24
map << yawspeed; // offset: 28
map << repr_offset_q; // offset: 32
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_boot_ms; // offset: 0
map >> q1; // offset: 4
map >> q2; // offset: 8
map >> q3; // offset: 12
map >> q4; // offset: 16
map >> rollspeed; // offset: 20
map >> pitchspeed; // offset: 24
map >> yawspeed; // offset: 28
map >> repr_offset_q; // offset: 32
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
......@@ -5,12 +5,12 @@
typedef struct __mavlink_attitude_quaternion_cov_t {
uint64_t time_usec; /*< Timestamp (microseconds since system boot or since UNIX epoch)*/
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 of the number.*/
float q[4]; /*< Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)*/
float rollspeed; /*< Roll angular speed (rad/s)*/
float pitchspeed; /*< Pitch angular speed (rad/s)*/
float yawspeed; /*< Yaw angular speed (rad/s)*/
float covariance[9]; /*< Attitude covariance*/
float rollspeed; /*< [rad/s] Roll angular speed*/
float pitchspeed; /*< [rad/s] Pitch angular speed*/
float yawspeed; /*< [rad/s] Yaw angular speed*/
float covariance[9]; /*< Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array.*/
} mavlink_attitude_quaternion_cov_t;
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN 72
......@@ -57,12 +57,12 @@ typedef struct __mavlink_attitude_quaternion_cov_t {
* @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 Timestamp (microseconds since system boot or since UNIX epoch)
* @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 of the number.
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
* @param rollspeed Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @param covariance Attitude covariance
* @param rollspeed [rad/s] Roll angular speed
* @param pitchspeed [rad/s] Pitch angular speed
* @param yawspeed [rad/s] Yaw angular speed
* @param covariance Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
* @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,
......@@ -98,12 +98,12 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack(uint8_t system_i
* @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 Timestamp (microseconds since system boot or since UNIX epoch)
* @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 of the number.
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
* @param rollspeed Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @param covariance Attitude covariance
* @param rollspeed [rad/s] Roll angular speed
* @param pitchspeed [rad/s] Pitch angular speed
* @param yawspeed [rad/s] Yaw angular speed
* @param covariance Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
* @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,
......@@ -165,12 +165,12 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode_chan(uint8_t s
* @brief Send a attitude_quaternion_cov message
* @param chan MAVLink channel to send the message
*
* @param time_usec Timestamp (microseconds since system boot or since UNIX epoch)
* @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 of the number.
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
* @param rollspeed Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
* @param covariance Attitude covariance
* @param rollspeed [rad/s] Roll angular speed
* @param pitchspeed [rad/s] Pitch angular speed
* @param yawspeed [rad/s] Yaw angular speed
* @param covariance Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
......@@ -251,7 +251,7 @@ static inline void mavlink_msg_attitude_quaternion_cov_send_buf(mavlink_message_
/**
* @brief Get field time_usec from attitude_quaternion_cov message
*
* @return Timestamp (microseconds since system boot or since UNIX epoch)
* @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 of the number.
*/
static inline uint64_t mavlink_msg_attitude_quaternion_cov_get_time_usec(const mavlink_message_t* msg)
{
......@@ -271,7 +271,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_q(const mavlink_m
/**
* @brief Get field rollspeed from attitude_quaternion_cov message
*
* @return Roll angular speed (rad/s)
* @return [rad/s] Roll angular speed
*/
static inline float mavlink_msg_attitude_quaternion_cov_get_rollspeed(const mavlink_message_t* msg)
{
......@@ -281,7 +281,7 @@ static inline float mavlink_msg_attitude_quaternion_cov_get_rollspeed(const mavl
/**
* @brief Get field pitchspeed from attitude_quaternion_cov message
*
* @return Pitch angular speed (rad/s)
* @return [rad/s] Pitch angular speed
*/
static inline float mavlink_msg_attitude_quaternion_cov_get_pitchspeed(const mavlink_message_t* msg)
{
......@@ -291,7 +291,7 @@ static inline float mavlink_msg_attitude_quaternion_cov_get_pitchspeed(const mav
/**
* @brief Get field yawspeed from attitude_quaternion_cov message
*
* @return Yaw angular speed (rad/s)
* @return [rad/s] Yaw angular speed
*/
static inline float mavlink_msg_attitude_quaternion_cov_get_yawspeed(const mavlink_message_t* msg)
{
......@@ -301,7 +301,7 @@ static inline float mavlink_msg_attitude_quaternion_cov_get_yawspeed(const mavli
/**
* @brief Get field covariance from attitude_quaternion_cov message
*
* @return Attitude covariance
* @return Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
*/
static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
{
......
// MESSAGE ATTITUDE_QUATERNION_COV support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief ATTITUDE_QUATERNION_COV message
*
* The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0).
*/
struct ATTITUDE_QUATERNION_COV : mavlink::Message {
static constexpr msgid_t MSG_ID = 61;
static constexpr size_t LENGTH = 72;
static constexpr size_t MIN_LENGTH = 72;
static constexpr uint8_t CRC_EXTRA = 167;
static constexpr auto NAME = "ATTITUDE_QUATERNION_COV";
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 of the number. */
std::array<float, 4> q; /*< 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 */
std::array<float, 9> covariance; /*< Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array. */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_usec: " << time_usec << std::endl;
ss << " q: [" << to_string(q) << "]" << std::endl;
ss << " rollspeed: " << rollspeed << std::endl;
ss << " pitchspeed: " << pitchspeed << std::endl;
ss << " yawspeed: " << yawspeed << std::endl;
ss << " covariance: [" << to_string(covariance) << "]" << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_usec; // offset: 0
map << q; // offset: 8
map << rollspeed; // offset: 24
map << pitchspeed; // offset: 28
map << yawspeed; // offset: 32
map << covariance; // offset: 36
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_usec; // offset: 0
map >> q; // offset: 8
map >> rollspeed; // offset: 24
map >> pitchspeed; // offset: 28
map >> yawspeed; // offset: 32
map >> covariance; // offset: 36
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
......@@ -5,13 +5,13 @@
typedef struct __mavlink_attitude_target_t {
uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/
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; /*< Body roll rate in radians per second*/
float body_pitch_rate; /*< Body roll rate in radians per second*/
float body_yaw_rate; /*< Body roll rate in radians per second*/
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*/
uint8_t type_mask; /*< Bitmap to indicate which dimensions should be ignored by the vehicle.*/
} mavlink_attitude_target_t;
#define MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN 37
......@@ -59,12 +59,12 @@ typedef struct __mavlink_attitude_target_t {
* @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 Timestamp in milliseconds 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 time_boot_ms [ms] Timestamp (time since system boot).
* @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
* @param body_roll_rate Body roll rate in radians per second
* @param body_pitch_rate Body roll rate in radians per second
* @param body_yaw_rate Body roll rate in radians per second
* @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)
*/
......@@ -103,12 +103,12 @@ static inline uint16_t mavlink_msg_attitude_target_pack(uint8_t system_id, uint8
* @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 Timestamp in milliseconds 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 time_boot_ms [ms] Timestamp (time since system boot).
* @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
* @param body_roll_rate Body roll rate in radians per second
* @param body_pitch_rate Body roll rate in radians per second
* @param body_yaw_rate Body roll rate in radians per second
* @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)
*/
......@@ -173,12 +173,12 @@ static inline uint16_t mavlink_msg_attitude_target_encode_chan(uint8_t system_id
* @brief Send a attitude_target message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp in milliseconds 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 time_boot_ms [ms] Timestamp (time since system boot).
* @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
* @param body_roll_rate Body roll rate in radians per second
* @param body_pitch_rate Body roll rate in radians per second
* @param body_yaw_rate Body roll rate in radians per second
* @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
......@@ -264,7 +264,7 @@ static inline void mavlink_msg_attitude_target_send_buf(mavlink_message_t *msgbu
/**
* @brief Get field time_boot_ms from attitude_target message
*
* @return Timestamp in milliseconds since system boot
* @return [ms] Timestamp (time since system boot).
*/
static inline uint32_t mavlink_msg_attitude_target_get_time_boot_ms(const mavlink_message_t* msg)
{
......@@ -274,7 +274,7 @@ static inline uint32_t mavlink_msg_attitude_target_get_time_boot_ms(const mavlin
/**
* @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
* @return Bitmap to indicate which dimensions should be ignored by the vehicle.
*/
static inline uint8_t mavlink_msg_attitude_target_get_type_mask(const mavlink_message_t* msg)
{
......@@ -294,7 +294,7 @@ static inline uint16_t mavlink_msg_attitude_target_get_q(const mavlink_message_t
/**
* @brief Get field body_roll_rate from attitude_target message
*
* @return Body roll rate in radians per second
* @return [rad/s] Body roll rate
*/
static inline float mavlink_msg_attitude_target_get_body_roll_rate(const mavlink_message_t* msg)
{
......@@ -304,7 +304,7 @@ static inline float mavlink_msg_attitude_target_get_body_roll_rate(const mavlink
/**
* @brief Get field body_pitch_rate from attitude_target message
*
* @return Body roll rate in radians per second
* @return [rad/s] Body pitch rate
*/
static inline float mavlink_msg_attitude_target_get_body_pitch_rate(const mavlink_message_t* msg)
{
......@@ -314,7 +314,7 @@ static inline float mavlink_msg_attitude_target_get_body_pitch_rate(const mavlin
/**
* @brief Get field body_yaw_rate from attitude_target message
*
* @return Body roll rate in radians per second
* @return [rad/s] Body yaw rate
*/
static inline float mavlink_msg_attitude_target_get_body_yaw_rate(const mavlink_message_t* msg)
{
......
// MESSAGE ATTITUDE_TARGET support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief ATTITUDE_TARGET message
*
* Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way.
*/
struct ATTITUDE_TARGET : mavlink::Message {
static constexpr msgid_t MSG_ID = 83;
static constexpr size_t LENGTH = 37;
static constexpr size_t MIN_LENGTH = 37;
static constexpr uint8_t CRC_EXTRA = 22;
static constexpr auto NAME = "ATTITUDE_TARGET";
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot). */
uint8_t type_mask; /*< Bitmap to indicate which dimensions should be ignored by the vehicle. */
std::array<float, 4> q; /*< 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) */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_boot_ms: " << time_boot_ms << std::endl;
ss << " type_mask: " << +type_mask << std::endl;
ss << " q: [" << to_string(q) << "]" << std::endl;
ss << " body_roll_rate: " << body_roll_rate << std::endl;
ss << " body_pitch_rate: " << body_pitch_rate << std::endl;
ss << " body_yaw_rate: " << body_yaw_rate << std::endl;
ss << " thrust: " << thrust << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_boot_ms; // offset: 0
map << q; // offset: 4
map << body_roll_rate; // offset: 20
map << body_pitch_rate; // offset: 24
map << body_yaw_rate; // offset: 28
map << thrust; // offset: 32
map << type_mask; // offset: 36
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_boot_ms; // offset: 0
map >> q; // offset: 4
map >> body_roll_rate; // offset: 20
map >> body_pitch_rate; // offset: 24
map >> body_yaw_rate; // offset: 28
map >> thrust; // offset: 32
map >> type_mask; // offset: 36
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
// MESSAGE AUTH_KEY support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief AUTH_KEY message
*
* Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety.
*/
struct AUTH_KEY : mavlink::Message {
static constexpr msgid_t MSG_ID = 7;
static constexpr size_t LENGTH = 32;
static constexpr size_t MIN_LENGTH = 32;
static constexpr uint8_t CRC_EXTRA = 119;
static constexpr auto NAME = "AUTH_KEY";
std::array<char, 32> key; /*< key */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " key: \"" << to_string(key) << "\"" << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << key; // offset: 0
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> key; // offset: 0
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
// MESSAGE AUTOPILOT_STATE_FOR_GIMBAL_DEVICE support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief AUTOPILOT_STATE_FOR_GIMBAL_DEVICE message
*
* Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the gimbal manager to the gimbal device component. The data of this message server for the gimbal's estimator corrections in particular horizon compensation, as well as the autopilot's control intention e.g. feed forward angular control in z-axis.
*/
struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE : mavlink::Message {
static constexpr msgid_t MSG_ID = 286;
static constexpr size_t LENGTH = 53;
static constexpr size_t MIN_LENGTH = 53;
static constexpr uint8_t CRC_EXTRA = 210;
static constexpr auto NAME = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
uint8_t target_system; /*< System ID */
uint8_t target_component; /*< Component ID */
uint64_t time_boot_us; /*< [us] Timestamp (time since system boot). */
std::array<float, 4> q; /*< Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention). */
uint32_t q_estimated_delay_us; /*< [us] Estimated delay of the attitude data. */
float vx; /*< [m/s] X Speed in NED (North, East, Down). */
float vy; /*< [m/s] Y Speed in NED (North, East, Down). */
float vz; /*< [m/s] Z Speed in NED (North, East, Down). */
uint32_t v_estimated_delay_us; /*< [us] Estimated delay of the speed data. */
float feed_forward_angular_velocity_z; /*< [rad/s] Feed forward Z component of angular velocity, positive is yawing to the right, NaN to be ignored. This is to indicate if the autopilot is actively yawing. */
uint16_t estimator_status; /*< Bitmap indicating which estimator outputs are valid. */
uint8_t landed_state; /*< The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " target_system: " << +target_system << std::endl;
ss << " target_component: " << +target_component << std::endl;
ss << " time_boot_us: " << time_boot_us << std::endl;
ss << " q: [" << to_string(q) << "]" << std::endl;
ss << " q_estimated_delay_us: " << q_estimated_delay_us << std::endl;
ss << " vx: " << vx << std::endl;
ss << " vy: " << vy << std::endl;
ss << " vz: " << vz << std::endl;
ss << " v_estimated_delay_us: " << v_estimated_delay_us << std::endl;
ss << " feed_forward_angular_velocity_z: " << feed_forward_angular_velocity_z << std::endl;
ss << " estimator_status: " << estimator_status << std::endl;
ss << " landed_state: " << +landed_state << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_boot_us; // offset: 0
map << q; // offset: 8
map << q_estimated_delay_us; // offset: 24
map << vx; // offset: 28
map << vy; // offset: 32
map << vz; // offset: 36
map << v_estimated_delay_us; // offset: 40
map << feed_forward_angular_velocity_z; // offset: 44
map << estimator_status; // offset: 48
map << target_system; // offset: 50
map << target_component; // offset: 51
map << landed_state; // offset: 52
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_boot_us; // offset: 0
map >> q; // offset: 8
map >> q_estimated_delay_us; // offset: 24
map >> vx; // offset: 28
map >> vy; // offset: 32
map >> vz; // offset: 36
map >> v_estimated_delay_us; // offset: 40
map >> feed_forward_angular_velocity_z; // offset: 44
map >> estimator_status; // offset: 48
map >> target_system; // offset: 50
map >> target_component; // offset: 51
map >> landed_state; // offset: 52
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
// MESSAGE AUTOPILOT_VERSION support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief AUTOPILOT_VERSION message
*
* Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE.
*/
struct AUTOPILOT_VERSION : mavlink::Message {
static constexpr msgid_t MSG_ID = 148;
static constexpr size_t LENGTH = 78;
static constexpr size_t MIN_LENGTH = 60;
static constexpr uint8_t CRC_EXTRA = 178;
static constexpr auto NAME = "AUTOPILOT_VERSION";
uint64_t capabilities; /*< Bitmap of capabilities */
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) */
std::array<uint8_t, 8> 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. */
std::array<uint8_t, 8> 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. */
std::array<uint8_t, 8> 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. */
uint16_t vendor_id; /*< ID of the board vendor */
uint16_t product_id; /*< ID of the product */
uint64_t uid; /*< UID if provided by hardware (see uid2) */
std::array<uint8_t, 18> uid2; /*< UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid) */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " capabilities: " << capabilities << std::endl;
ss << " flight_sw_version: " << flight_sw_version << std::endl;
ss << " middleware_sw_version: " << middleware_sw_version << std::endl;
ss << " os_sw_version: " << os_sw_version << std::endl;
ss << " board_version: " << board_version << std::endl;
ss << " flight_custom_version: [" << to_string(flight_custom_version) << "]" << std::endl;
ss << " middleware_custom_version: [" << to_string(middleware_custom_version) << "]" << std::endl;
ss << " os_custom_version: [" << to_string(os_custom_version) << "]" << std::endl;
ss << " vendor_id: " << vendor_id << std::endl;
ss << " product_id: " << product_id << std::endl;
ss << " uid: " << uid << std::endl;
ss << " uid2: [" << to_string(uid2) << "]" << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << capabilities; // offset: 0
map << uid; // offset: 8
map << flight_sw_version; // offset: 16
map << middleware_sw_version; // offset: 20
map << os_sw_version; // offset: 24
map << board_version; // offset: 28
map << vendor_id; // offset: 32
map << product_id; // offset: 34
map << flight_custom_version; // offset: 36
map << middleware_custom_version; // offset: 44
map << os_custom_version; // offset: 52
map << uid2; // offset: 60
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> capabilities; // offset: 0
map >> uid; // offset: 8
map >> flight_sw_version; // offset: 16
map >> middleware_sw_version; // offset: 20
map >> os_sw_version; // offset: 24
map >> board_version; // offset: 28
map >> vendor_id; // offset: 32
map >> product_id; // offset: 34
map >> flight_custom_version; // offset: 36
map >> middleware_custom_version; // offset: 44
map >> os_custom_version; // offset: 52
map >> uid2; // offset: 60
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
// MESSAGE BATTERY_STATUS support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief BATTERY_STATUS message
*
* Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send SMART_BATTERY_INFO.
*/
struct BATTERY_STATUS : mavlink::Message {
static constexpr msgid_t MSG_ID = 147;
static constexpr size_t LENGTH = 54;
static constexpr size_t MIN_LENGTH = 36;
static constexpr uint8_t CRC_EXTRA = 154;
static constexpr auto NAME = "BATTERY_STATUS";
uint8_t id; /*< Battery ID */
uint8_t battery_function; /*< Function of the battery */
uint8_t type; /*< Type (chemistry) of the battery */
int16_t temperature; /*< [cdegC] Temperature of the battery. INT16_MAX for unknown temperature. */
std::array<uint16_t, 10> voltages; /*< [mV] Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1). */
int16_t current_battery; /*< [cA] Battery current, -1: autopilot does not measure the current */
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 */
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 */
std::array<uint16_t, 4> voltages_ext; /*< [mV] Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead. */
uint8_t mode; /*< Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode. */
uint32_t fault_bitmask; /*< Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported). */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " id: " << +id << std::endl;
ss << " battery_function: " << +battery_function << std::endl;
ss << " type: " << +type << std::endl;
ss << " temperature: " << temperature << std::endl;
ss << " voltages: [" << to_string(voltages) << "]" << std::endl;
ss << " current_battery: " << current_battery << std::endl;
ss << " current_consumed: " << current_consumed << std::endl;
ss << " energy_consumed: " << energy_consumed << std::endl;
ss << " battery_remaining: " << +battery_remaining << std::endl;
ss << " time_remaining: " << time_remaining << std::endl;
ss << " charge_state: " << +charge_state << std::endl;
ss << " voltages_ext: [" << to_string(voltages_ext) << "]" << std::endl;
ss << " mode: " << +mode << std::endl;
ss << " fault_bitmask: " << fault_bitmask << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << current_consumed; // offset: 0
map << energy_consumed; // offset: 4
map << temperature; // offset: 8
map << voltages; // offset: 10
map << current_battery; // offset: 30
map << id; // offset: 32
map << battery_function; // offset: 33
map << type; // offset: 34
map << battery_remaining; // offset: 35
map << time_remaining; // offset: 36
map << charge_state; // offset: 40
map << voltages_ext; // offset: 41
map << mode; // offset: 49
map << fault_bitmask; // offset: 50
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> current_consumed; // offset: 0
map >> energy_consumed; // offset: 4
map >> temperature; // offset: 8
map >> voltages; // offset: 10
map >> current_battery; // offset: 30
map >> id; // offset: 32
map >> battery_function; // offset: 33
map >> type; // offset: 34
map >> battery_remaining; // offset: 35
map >> time_remaining; // offset: 36
map >> charge_state; // offset: 40
map >> voltages_ext; // offset: 41
map >> mode; // offset: 49
map >> fault_bitmask; // offset: 50
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
This diff is collapsed.
// MESSAGE BUTTON_CHANGE support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief BUTTON_CHANGE message
*
* Report button state change.
*/
struct BUTTON_CHANGE : mavlink::Message {
static constexpr msgid_t MSG_ID = 257;
static constexpr size_t LENGTH = 9;
static constexpr size_t MIN_LENGTH = 9;
static constexpr uint8_t CRC_EXTRA = 131;
static constexpr auto NAME = "BUTTON_CHANGE";
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. */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_boot_ms: " << time_boot_ms << std::endl;
ss << " last_change_ms: " << last_change_ms << std::endl;
ss << " state: " << +state << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_boot_ms; // offset: 0
map << last_change_ms; // offset: 4
map << state; // offset: 8
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_boot_ms; // offset: 0
map >> last_change_ms; // offset: 4
map >> state; // offset: 8
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
......@@ -7,7 +7,7 @@ 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*/
uint32_t recording_time_ms; /*< [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.*/
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)*/
......@@ -63,7 +63,7 @@ typedef struct __mavlink_camera_capture_status_t {
* @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 recording_time_ms [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.
* @param available_capacity [MiB] Available storage capacity.
* @param image_count Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).
* @return length of the message in bytes (excluding serial stream start sign)
......@@ -109,7 +109,7 @@ static inline uint16_t mavlink_msg_camera_capture_status_pack(uint8_t system_id,
* @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 recording_time_ms [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.
* @param available_capacity [MiB] Available storage capacity.
* @param image_count Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).
* @return length of the message in bytes (excluding serial stream start sign)
......@@ -181,7 +181,7 @@ static inline uint16_t mavlink_msg_camera_capture_status_encode_chan(uint8_t sys
* @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 recording_time_ms [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.
* @param available_capacity [MiB] Available storage capacity.
* @param image_count Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).
*/
......@@ -312,7 +312,7 @@ static inline float mavlink_msg_camera_capture_status_get_image_interval(const m
/**
* @brief Get field recording_time_ms from camera_capture_status message
*
* @return [ms] Time since recording started
* @return [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.
*/
static inline uint32_t mavlink_msg_camera_capture_status_get_recording_time_ms(const mavlink_message_t* msg)
{
......
// MESSAGE CAMERA_CAPTURE_STATUS support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief CAMERA_CAPTURE_STATUS message
*
* Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command.
*/
struct CAMERA_CAPTURE_STATUS : mavlink::Message {
static constexpr msgid_t MSG_ID = 262;
static constexpr size_t LENGTH = 22;
static constexpr size_t MIN_LENGTH = 18;
static constexpr uint8_t CRC_EXTRA = 12;
static constexpr auto NAME = "CAMERA_CAPTURE_STATUS";
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot). */
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) */
float image_interval; /*< [s] Image capture interval */
uint32_t recording_time_ms; /*< [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy. */
float available_capacity; /*< [MiB] Available storage capacity. */
int32_t image_count; /*< Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT). */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_boot_ms: " << time_boot_ms << std::endl;
ss << " image_status: " << +image_status << std::endl;
ss << " video_status: " << +video_status << std::endl;
ss << " image_interval: " << image_interval << std::endl;
ss << " recording_time_ms: " << recording_time_ms << std::endl;
ss << " available_capacity: " << available_capacity << std::endl;
ss << " image_count: " << image_count << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_boot_ms; // offset: 0
map << image_interval; // offset: 4
map << recording_time_ms; // offset: 8
map << available_capacity; // offset: 12
map << image_status; // offset: 16
map << video_status; // offset: 17
map << image_count; // offset: 18
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_boot_ms; // offset: 0
map >> image_interval; // offset: 4
map >> recording_time_ms; // offset: 8
map >> available_capacity; // offset: 12
map >> image_status; // offset: 16
map >> video_status; // offset: 17
map >> image_count; // offset: 18
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
This diff is collapsed.
// MESSAGE CAMERA_FOV_STATUS support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief CAMERA_FOV_STATUS message
*
* Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command.
*/
struct CAMERA_FOV_STATUS : mavlink::Message {
static constexpr msgid_t MSG_ID = 271;
static constexpr size_t LENGTH = 52;
static constexpr size_t MIN_LENGTH = 52;
static constexpr uint8_t CRC_EXTRA = 22;
static constexpr auto NAME = "CAMERA_FOV_STATUS";
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot). */
int32_t lat_camera; /*< [degE7] Latitude of camera (INT32_MAX if unknown). */
int32_t lon_camera; /*< [degE7] Longitude of camera (INT32_MAX if unknown). */
int32_t alt_camera; /*< [mm] Altitude (MSL) of camera (INT32_MAX if unknown). */
int32_t lat_image; /*< [degE7] Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon). */
int32_t lon_image; /*< [degE7] Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon). */
int32_t alt_image; /*< [mm] Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon). */
std::array<float, 4> q; /*< Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0) */
float hfov; /*< [deg] Horizontal field of view (NaN if unknown). */
float vfov; /*< [deg] Vertical field of view (NaN if unknown). */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_boot_ms: " << time_boot_ms << std::endl;
ss << " lat_camera: " << lat_camera << std::endl;
ss << " lon_camera: " << lon_camera << std::endl;
ss << " alt_camera: " << alt_camera << std::endl;
ss << " lat_image: " << lat_image << std::endl;
ss << " lon_image: " << lon_image << std::endl;
ss << " alt_image: " << alt_image << std::endl;
ss << " q: [" << to_string(q) << "]" << std::endl;
ss << " hfov: " << hfov << std::endl;
ss << " vfov: " << vfov << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_boot_ms; // offset: 0
map << lat_camera; // offset: 4
map << lon_camera; // offset: 8
map << alt_camera; // offset: 12
map << lat_image; // offset: 16
map << lon_image; // offset: 20
map << alt_image; // offset: 24
map << q; // offset: 28
map << hfov; // offset: 44
map << vfov; // offset: 48
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_boot_ms; // offset: 0
map >> lat_camera; // offset: 4
map >> lon_camera; // offset: 8
map >> alt_camera; // offset: 12
map >> lat_image; // offset: 16
map >> lon_image; // offset: 20
map >> alt_image; // offset: 24
map >> q; // offset: 28
map >> hfov; // offset: 44
map >> vfov; // offset: 48
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
// MESSAGE CAMERA_IMAGE_CAPTURED support class
#pragma once
namespace mavlink {
namespace common {
namespace msg {
/**
* @brief CAMERA_IMAGE_CAPTURED message
*
* Information about a captured image. This is emitted every time a message is captured. It may be re-requested using MAV_CMD_REQUEST_MESSAGE, using param2 to indicate the sequence number for the missing image.
*/
struct CAMERA_IMAGE_CAPTURED : mavlink::Message {
static constexpr msgid_t MSG_ID = 263;
static constexpr size_t LENGTH = 255;
static constexpr size_t MIN_LENGTH = 255;
static constexpr uint8_t CRC_EXTRA = 133;
static constexpr auto NAME = "CAMERA_IMAGE_CAPTURED";
uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot). */
uint64_t time_utc; /*< [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown. */
uint8_t camera_id; /*< Deprecated/unused. Component IDs are used to differentiate multiple cameras. */
int32_t lat; /*< [degE7] Latitude where image was taken */
int32_t lon; /*< [degE7] Longitude where capture was taken */
int32_t alt; /*< [mm] Altitude (MSL) where image was taken */
int32_t relative_alt; /*< [mm] Altitude above ground */
std::array<float, 4> q; /*< Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0) */
int32_t image_index; /*< Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1) */
int8_t capture_result; /*< Boolean indicating success (1) or failure (0) while capturing this image. */
std::array<char, 205> file_url; /*< URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface. */
inline std::string get_name(void) const override
{
return NAME;
}
inline Info get_message_info(void) const override
{
return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
}
inline std::string to_yaml(void) const override
{
std::stringstream ss;
ss << NAME << ":" << std::endl;
ss << " time_boot_ms: " << time_boot_ms << std::endl;
ss << " time_utc: " << time_utc << std::endl;
ss << " camera_id: " << +camera_id << std::endl;
ss << " lat: " << lat << std::endl;
ss << " lon: " << lon << std::endl;
ss << " alt: " << alt << std::endl;
ss << " relative_alt: " << relative_alt << std::endl;
ss << " q: [" << to_string(q) << "]" << std::endl;
ss << " image_index: " << image_index << std::endl;
ss << " capture_result: " << +capture_result << std::endl;
ss << " file_url: \"" << to_string(file_url) << "\"" << std::endl;
return ss.str();
}
inline void serialize(mavlink::MsgMap &map) const override
{
map.reset(MSG_ID, LENGTH);
map << time_utc; // offset: 0
map << time_boot_ms; // offset: 8
map << lat; // offset: 12
map << lon; // offset: 16
map << alt; // offset: 20
map << relative_alt; // offset: 24
map << q; // offset: 28
map << image_index; // offset: 44
map << camera_id; // offset: 48
map << capture_result; // offset: 49
map << file_url; // offset: 50
}
inline void deserialize(mavlink::MsgMap &map) override
{
map >> time_utc; // offset: 0
map >> time_boot_ms; // offset: 8
map >> lat; // offset: 12
map >> lon; // offset: 16
map >> alt; // offset: 20
map >> relative_alt; // offset: 24
map >> q; // offset: 28
map >> image_index; // offset: 44
map >> camera_id; // offset: 48
map >> capture_result; // offset: 49
map >> file_url; // offset: 50
}
};
} // namespace msg
} // namespace common
} // namespace mavlink
......@@ -17,7 +17,7 @@ typedef struct __mavlink_camera_information_t {
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). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol).*/
char cam_definition_uri[140]; /*< Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file).*/
} mavlink_camera_information_t;
#define MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN 235
......@@ -91,7 +91,7 @@ typedef struct __mavlink_camera_information_t {
* @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). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol).
* @param cam_definition_uri Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file).
* @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,
......@@ -153,7 +153,7 @@ static inline uint16_t mavlink_msg_camera_information_pack(uint8_t system_id, ui
* @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). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol).
* @param cam_definition_uri Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file).
* @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,
......@@ -241,7 +241,7 @@ static inline uint16_t mavlink_msg_camera_information_encode_chan(uint8_t system
* @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). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol).
* @param cam_definition_uri Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file).
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
......@@ -470,7 +470,7 @@ static inline uint16_t mavlink_msg_camera_information_get_cam_definition_version
/**
* @brief Get field cam_definition_uri from camera_information message
*
* @return Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol).
* @return Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file).
*/
static inline uint16_t mavlink_msg_camera_information_get_cam_definition_uri(const mavlink_message_t* msg, char *cam_definition_uri)
{
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5,7 +5,7 @@
typedef struct __mavlink_camera_trigger_t {
uint64_t time_usec; /*< Timestamp for the image frame in microseconds*/
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 of the number.*/
uint32_t seq; /*< Image frame sequence*/
} mavlink_camera_trigger_t;
......@@ -44,7 +44,7 @@ typedef struct __mavlink_camera_trigger_t {
* @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 Timestamp for the image frame in microseconds
* @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 of the number.
* @param seq Image frame sequence
* @return length of the message in bytes (excluding serial stream start sign)
*/
......@@ -75,7 +75,7 @@ static inline uint16_t mavlink_msg_camera_trigger_pack(uint8_t system_id, uint8_
* @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 Timestamp for the image frame in microseconds
* @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 of the number.
* @param seq Image frame sequence
* @return length of the message in bytes (excluding serial stream start sign)
*/
......@@ -132,7 +132,7 @@ static inline uint16_t mavlink_msg_camera_trigger_encode_chan(uint8_t system_id,
* @brief Send a camera_trigger message
* @param chan MAVLink channel to send the message
*
* @param time_usec Timestamp for the image frame in microseconds
* @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 of the number.
* @param seq Image frame sequence
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
......@@ -202,7 +202,7 @@ static inline void mavlink_msg_camera_trigger_send_buf(mavlink_message_t *msgbuf
/**
* @brief Get field time_usec from camera_trigger message
*
* @return Timestamp for the image frame in microseconds
* @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 of the number.
*/
static inline uint64_t mavlink_msg_camera_trigger_get_time_usec(const mavlink_message_t* msg)
{
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment