Commit 42f1a373 authored by PX4BuildBot's avatar PX4BuildBot

autogenerated headers for rev...

autogenerated headers for rev https://github.com/mavlink/mavlink/tree/83b3c23332bab1b320b9674e604d90b3fc482f75
parent 7d0aa020
This diff is collapsed.
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Nov 14 05:22:41 2014"
#define MAVLINK_BUILD_DATE "Mon Dec 29 11:10:39 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
This diff is collapsed.
This diff is collapsed.
......@@ -4,9 +4,9 @@
typedef struct __mavlink_mount_status_t
{
int32_t pointing_a; ///< pitch(deg*100) or lat, depending on mount mode
int32_t pointing_b; ///< roll(deg*100) or lon depending on mount mode
int32_t pointing_c; ///< yaw(deg*100) or alt (in cm) depending on mount mode
int32_t pointing_a; ///< pitch(deg*100)
int32_t pointing_b; ///< roll(deg*100)
int32_t pointing_c; ///< yaw(deg*100)
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
} mavlink_mount_status_t;
......@@ -39,9 +39,9 @@ typedef struct __mavlink_mount_status_t
*
* @param target_system System ID
* @param target_component Component ID
* @param pointing_a pitch(deg*100) or lat, depending on mount mode
* @param pointing_b roll(deg*100) or lon depending on mount mode
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode
* @param pointing_a pitch(deg*100)
* @param pointing_b roll(deg*100)
* @param pointing_c yaw(deg*100)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
......@@ -83,9 +83,9 @@ static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param pointing_a pitch(deg*100) or lat, depending on mount mode
* @param pointing_b roll(deg*100) or lon depending on mount mode
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode
* @param pointing_a pitch(deg*100)
* @param pointing_b roll(deg*100)
* @param pointing_c yaw(deg*100)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
......@@ -153,9 +153,9 @@ static inline uint16_t mavlink_msg_mount_status_encode_chan(uint8_t system_id, u
*
* @param target_system System ID
* @param target_component Component ID
* @param pointing_a pitch(deg*100) or lat, depending on mount mode
* @param pointing_b roll(deg*100) or lon depending on mount mode
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode
* @param pointing_a pitch(deg*100)
* @param pointing_b roll(deg*100)
* @param pointing_c yaw(deg*100)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
......@@ -258,7 +258,7 @@ static inline uint8_t mavlink_msg_mount_status_get_target_component(const mavlin
/**
* @brief Get field pointing_a from mount_status message
*
* @return pitch(deg*100) or lat, depending on mount mode
* @return pitch(deg*100)
*/
static inline int32_t mavlink_msg_mount_status_get_pointing_a(const mavlink_message_t* msg)
{
......@@ -268,7 +268,7 @@ static inline int32_t mavlink_msg_mount_status_get_pointing_a(const mavlink_mess
/**
* @brief Get field pointing_b from mount_status message
*
* @return roll(deg*100) or lon depending on mount mode
* @return roll(deg*100)
*/
static inline int32_t mavlink_msg_mount_status_get_pointing_b(const mavlink_message_t* msg)
{
......@@ -278,7 +278,7 @@ static inline int32_t mavlink_msg_mount_status_get_pointing_b(const mavlink_mess
/**
* @brief Get field pointing_c from mount_status message
*
* @return yaw(deg*100) or alt (in cm) depending on mount mode
* @return yaw(deg*100)
*/
static inline int32_t mavlink_msg_mount_status_get_pointing_c(const mavlink_message_t* msg)
{
......
......@@ -1516,6 +1516,58 @@ static void mavlink_test_battery2(uint8_t system_id, uint8_t component_id, mavli
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_ahrs3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_ahrs3_t packet_in = {
17.0,45.0,73.0,101.0,963498296,963498504,185.0,213.0,241.0,269.0
};
mavlink_ahrs3_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
packet1.altitude = packet_in.altitude;
packet1.lat = packet_in.lat;
packet1.lng = packet_in.lng;
packet1.v1 = packet_in.v1;
packet1.v2 = packet_in.v2;
packet1.v3 = packet_in.v3;
packet1.v4 = packet_in.v4;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ahrs3_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_ahrs3_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ahrs3_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
mavlink_msg_ahrs3_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ahrs3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
mavlink_msg_ahrs3_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_ahrs3_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_ahrs3_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
mavlink_msg_ahrs3_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_sensor_offsets(system_id, component_id, last_msg);
......@@ -1549,6 +1601,7 @@ static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id,
mavlink_test_camera_status(system_id, component_id, last_msg);
mavlink_test_camera_feedback(system_id, component_id, last_msg);
mavlink_test_battery2(system_id, component_id, last_msg);
mavlink_test_ahrs3(system_id, component_id, last_msg);
}
#ifdef __cplusplus
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Nov 14 05:22:06 2014"
#define MAVLINK_BUILD_DATE "Mon Dec 29 11:09:42 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
This diff is collapsed.
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Nov 14 05:22:11 2014"
#define MAVLINK_BUILD_DATE "Mon Dec 29 11:09:50 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
This diff is collapsed.
This diff is collapsed.
......@@ -7,7 +7,7 @@ typedef struct __mavlink_global_position_int_t
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
int32_t lat; ///< Latitude, expressed as * 1E7
int32_t lon; ///< Longitude, expressed as * 1E7
int32_t alt; ///< Altitude in meters, expressed as * 1000 (millimeters), WGS84 (not AMSL)
int32_t alt; ///< Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
int32_t relative_alt; ///< Altitude above ground in meters, expressed as * 1000 (millimeters)
int16_t vx; ///< Ground X Speed (Latitude), expressed as m/s * 100
int16_t vy; ///< Ground Y Speed (Longitude), expressed as m/s * 100
......@@ -48,7 +48,7 @@ typedef struct __mavlink_global_position_int_t
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param lat Latitude, expressed as * 1E7
* @param lon Longitude, expressed as * 1E7
* @param alt Altitude in meters, expressed as * 1000 (millimeters), WGS84 (not AMSL)
* @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
* @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
* @param vx Ground X Speed (Latitude), expressed as m/s * 100
* @param vy Ground Y Speed (Longitude), expressed as m/s * 100
......@@ -104,7 +104,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param lat Latitude, expressed as * 1E7
* @param lon Longitude, expressed as * 1E7
* @param alt Altitude in meters, expressed as * 1000 (millimeters), WGS84 (not AMSL)
* @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
* @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
* @param vx Ground X Speed (Latitude), expressed as m/s * 100
* @param vy Ground Y Speed (Longitude), expressed as m/s * 100
......@@ -186,7 +186,7 @@ static inline uint16_t mavlink_msg_global_position_int_encode_chan(uint8_t syste
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param lat Latitude, expressed as * 1E7
* @param lon Longitude, expressed as * 1E7
* @param alt Altitude in meters, expressed as * 1000 (millimeters), WGS84 (not AMSL)
* @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
* @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
* @param vx Ground X Speed (Latitude), expressed as m/s * 100
* @param vy Ground Y Speed (Longitude), expressed as m/s * 100
......@@ -320,7 +320,7 @@ static inline int32_t mavlink_msg_global_position_int_get_lon(const mavlink_mess
/**
* @brief Get field alt from global_position_int message
*
* @return Altitude in meters, expressed as * 1000 (millimeters), WGS84 (not AMSL)
* @return Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
*/
static inline int32_t mavlink_msg_global_position_int_get_alt(const mavlink_message_t* msg)
{
......
......@@ -7,7 +7,7 @@ typedef struct __mavlink_gps2_raw_t
uint64_t time_usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot)
int32_t lat; ///< Latitude (WGS84), in degrees * 1E7
int32_t lon; ///< Longitude (WGS84), in degrees * 1E7
int32_t alt; ///< Altitude (WGS84), in meters * 1000 (positive for up)
int32_t alt; ///< Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
uint32_t dgps_age; ///< Age of DGPS info
uint16_t eph; ///< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
uint16_t epv; ///< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
......@@ -55,7 +55,7 @@ typedef struct __mavlink_gps2_raw_t
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
* @param lat Latitude (WGS84), in degrees * 1E7
* @param lon Longitude (WGS84), in degrees * 1E7
* @param alt Altitude (WGS84), in meters * 1000 (positive for up)
* @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
......@@ -120,7 +120,7 @@ static inline uint16_t mavlink_msg_gps2_raw_pack(uint8_t system_id, uint8_t comp
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
* @param lat Latitude (WGS84), in degrees * 1E7
* @param lon Longitude (WGS84), in degrees * 1E7
* @param alt Altitude (WGS84), in meters * 1000 (positive for up)
* @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
......@@ -211,7 +211,7 @@ static inline uint16_t mavlink_msg_gps2_raw_encode_chan(uint8_t system_id, uint8
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
* @param lat Latitude (WGS84), in degrees * 1E7
* @param lon Longitude (WGS84), in degrees * 1E7
* @param alt Altitude (WGS84), in meters * 1000 (positive for up)
* @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
......@@ -369,7 +369,7 @@ static inline int32_t mavlink_msg_gps2_raw_get_lon(const mavlink_message_t* msg)
/**
* @brief Get field alt from gps2_raw message
*
* @return Altitude (WGS84), in meters * 1000 (positive for up)
* @return Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
*/
static inline int32_t mavlink_msg_gps2_raw_get_alt(const mavlink_message_t* msg)
{
......
......@@ -6,7 +6,7 @@ typedef struct __mavlink_gps_global_origin_t
{
int32_t latitude; ///< Latitude (WGS84), in degrees * 1E7
int32_t longitude; ///< Longitude (WGS84), in degrees * 1E7
int32_t altitude; ///< Altitude (WGS84), in meters * 1000 (positive for up)
int32_t altitude; ///< Altitude (AMSL), in meters * 1000 (positive for up)
} mavlink_gps_global_origin_t;
#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN 12
......@@ -35,7 +35,7 @@ typedef struct __mavlink_gps_global_origin_t
*
* @param latitude Latitude (WGS84), in degrees * 1E7
* @param longitude Longitude (WGS84), in degrees * 1E7
* @param altitude Altitude (WGS84), in meters * 1000 (positive for up)
* @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
......@@ -73,7 +73,7 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uin
* @param msg The MAVLink message to compress the data into
* @param latitude Latitude (WGS84), in degrees * 1E7
* @param longitude Longitude (WGS84), in degrees * 1E7
* @param altitude Altitude (WGS84), in meters * 1000 (positive for up)
* @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
......@@ -137,7 +137,7 @@ static inline uint16_t mavlink_msg_gps_global_origin_encode_chan(uint8_t system_
*
* @param latitude Latitude (WGS84), in degrees * 1E7
* @param longitude Longitude (WGS84), in degrees * 1E7
* @param altitude Altitude (WGS84), in meters * 1000 (positive for up)
* @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
......@@ -232,7 +232,7 @@ static inline int32_t mavlink_msg_gps_global_origin_get_longitude(const mavlink_
/**
* @brief Get field altitude from gps_global_origin message
*
* @return Altitude (WGS84), in meters * 1000 (positive for up)
* @return Altitude (AMSL), in meters * 1000 (positive for up)
*/
static inline int32_t mavlink_msg_gps_global_origin_get_altitude(const mavlink_message_t* msg)
{
......
......@@ -7,7 +7,7 @@ typedef struct __mavlink_gps_raw_int_t
uint64_t time_usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot)
int32_t lat; ///< Latitude (WGS84), in degrees * 1E7
int32_t lon; ///< Longitude (WGS84), in degrees * 1E7
int32_t alt; ///< Altitude (WGS84), in meters * 1000 (positive for up)
int32_t alt; ///< Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
uint16_t eph; ///< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
uint16_t epv; ///< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
uint16_t vel; ///< GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
......@@ -51,7 +51,7 @@ typedef struct __mavlink_gps_raw_int_t
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
* @param lat Latitude (WGS84), in degrees * 1E7
* @param lon Longitude (WGS84), in degrees * 1E7
* @param alt Altitude (WGS84), in meters * 1000 (positive for up)
* @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
......@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
* @param lat Latitude (WGS84), in degrees * 1E7
* @param lon Longitude (WGS84), in degrees * 1E7
* @param alt Altitude (WGS84), in meters * 1000 (positive for up)
* @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
......@@ -195,7 +195,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_encode_chan(uint8_t system_id, ui
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
* @param lat Latitude (WGS84), in degrees * 1E7
* @param lon Longitude (WGS84), in degrees * 1E7
* @param alt Altitude (WGS84), in meters * 1000 (positive for up)
* @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
......@@ -343,7 +343,7 @@ static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* m
/**
* @brief Get field alt from gps_raw_int message
*
* @return Altitude (WGS84), in meters * 1000 (positive for up)
* @return Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
*/
static inline int32_t mavlink_msg_gps_raw_int_get_alt(const mavlink_message_t* msg)
{
......
......@@ -7,7 +7,7 @@ typedef struct __mavlink_hil_gps_t
uint64_t time_usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot)
int32_t lat; ///< Latitude (WGS84), in degrees * 1E7
int32_t lon; ///< Longitude (WGS84), in degrees * 1E7
int32_t alt; ///< Altitude (WGS84), in meters * 1000 (positive for up)
int32_t alt; ///< Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
uint16_t eph; ///< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535
uint16_t epv; ///< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535
uint16_t vel; ///< GPS ground speed (m/s * 100). If unknown, set to: 65535
......@@ -57,7 +57,7 @@ typedef struct __mavlink_hil_gps_t
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
* @param lat Latitude (WGS84), in degrees * 1E7
* @param lon Longitude (WGS84), in degrees * 1E7
* @param alt Altitude (WGS84), in meters * 1000 (positive for up)
* @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535
* @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535
......@@ -125,7 +125,7 @@ static inline uint16_t mavlink_msg_hil_gps_pack(uint8_t system_id, uint8_t compo
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
* @param lat Latitude (WGS84), in degrees * 1E7
* @param lon Longitude (WGS84), in degrees * 1E7
* @param alt Altitude (WGS84), in meters * 1000 (positive for up)
* @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535
* @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535
......@@ -219,7 +219,7 @@ static inline uint16_t mavlink_msg_hil_gps_encode_chan(uint8_t system_id, uint8_
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
* @param lat Latitude (WGS84), in degrees * 1E7
* @param lon Longitude (WGS84), in degrees * 1E7
* @param alt Altitude (WGS84), in meters * 1000 (positive for up)
* @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535
* @param vel GPS ground speed (m/s * 100). If unknown, set to: 65535
......@@ -382,7 +382,7 @@ static inline int32_t mavlink_msg_hil_gps_get_lon(const mavlink_message_t* msg)
/**
* @brief Get field alt from hil_gps message
*
* @return Altitude (WGS84), in meters * 1000 (positive for up)
* @return Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
*/
static inline int32_t mavlink_msg_hil_gps_get_alt(const mavlink_message_t* msg)
{
......
This diff is collapsed.
......@@ -7,7 +7,7 @@ typedef struct __mavlink_position_target_global_int_t
uint32_t time_boot_ms; ///< Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
int32_t lat_int; ///< X Position in WGS84 frame in 1e7 * meters
int32_t lon_int; ///< Y Position in WGS84 frame in 1e7 * meters
float alt; ///< Altitude in meters in WGS84 altitude, not AMSL if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
float alt; ///< Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
float vx; ///< X velocity in NED frame in meter / s
float vy; ///< Y velocity in NED frame in meter / s
float vz; ///< Z velocity in NED frame in meter / s
......@@ -60,7 +60,7 @@ typedef struct __mavlink_position_target_global_int_t
* @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
* @param lat_int X Position in WGS84 frame in 1e7 * meters
* @param lon_int Y Position in WGS84 frame in 1e7 * meters
* @param alt Altitude in meters in WGS84 altitude, not AMSL if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
......@@ -131,7 +131,7 @@ static inline uint16_t mavlink_msg_position_target_global_int_pack(uint8_t syste
* @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
* @param lat_int X Position in WGS84 frame in 1e7 * meters
* @param lon_int Y Position in WGS84 frame in 1e7 * meters
* @param alt Altitude in meters in WGS84 altitude, not AMSL if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
......@@ -228,7 +228,7 @@ static inline uint16_t mavlink_msg_position_target_global_int_encode_chan(uint8_
* @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
* @param lat_int X Position in WGS84 frame in 1e7 * meters
* @param lon_int Y Position in WGS84 frame in 1e7 * meters
* @param alt Altitude in meters in WGS84 altitude, not AMSL if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
......@@ -405,7 +405,7 @@ static inline int32_t mavlink_msg_position_target_global_int_get_lon_int(const m
/**
* @brief Get field alt from position_target_global_int message
*
* @return Altitude in meters in WGS84 altitude, not AMSL if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @return Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
*/
static inline float mavlink_msg_position_target_global_int_get_alt(const mavlink_message_t* msg)
{
......
......@@ -6,7 +6,7 @@ typedef struct __mavlink_set_gps_global_origin_t
{
int32_t latitude; ///< Latitude (WGS84), in degrees * 1E7
int32_t longitude; ///< Longitude (WGS84, in degrees * 1E7
int32_t altitude; ///< Altitude (WGS84), in meters * 1000 (positive for up)
int32_t altitude; ///< Altitude (AMSL), in meters * 1000 (positive for up)
uint8_t target_system; ///< System ID
} mavlink_set_gps_global_origin_t;
......@@ -38,7 +38,7 @@ typedef struct __mavlink_set_gps_global_origin_t
* @param target_system System ID
* @param latitude Latitude (WGS84), in degrees * 1E7
* @param longitude Longitude (WGS84, in degrees * 1E7
* @param altitude Altitude (WGS84), in meters * 1000 (positive for up)
* @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
......@@ -79,7 +79,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id,
* @param target_system System ID
* @param latitude Latitude (WGS84), in degrees * 1E7
* @param longitude Longitude (WGS84, in degrees * 1E7
* @param altitude Altitude (WGS84), in meters * 1000 (positive for up)
* @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
......@@ -146,7 +146,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_encode_chan(uint8_t sys
* @param target_system System ID
* @param latitude Latitude (WGS84), in degrees * 1E7
* @param longitude Longitude (WGS84, in degrees * 1E7
* @param altitude Altitude (WGS84), in meters * 1000 (positive for up)
* @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
......@@ -255,7 +255,7 @@ static inline int32_t mavlink_msg_set_gps_global_origin_get_longitude(const mavl
/**
* @brief Get field altitude from set_gps_global_origin message
*
* @return Altitude (WGS84), in meters * 1000 (positive for up)
* @return Altitude (AMSL), in meters * 1000 (positive for up)
*/
static inline int32_t mavlink_msg_set_gps_global_origin_get_altitude(const mavlink_message_t* msg)
{
......
......@@ -7,7 +7,7 @@ typedef struct __mavlink_set_position_target_global_int_t
uint32_t time_boot_ms; ///< Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
int32_t lat_int; ///< X Position in WGS84 frame in 1e7 * meters
int32_t lon_int; ///< Y Position in WGS84 frame in 1e7 * meters
float alt; ///< Altitude in meters in WGS84 altitude, not AMSL if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
float alt; ///< Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
float vx; ///< X velocity in NED frame in meter / s
float vy; ///< Y velocity in NED frame in meter / s
float vz; ///< Z velocity in NED frame in meter / s
......@@ -66,7 +66,7 @@ typedef struct __mavlink_set_position_target_global_int_t
* @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
* @param lat_int X Position in WGS84 frame in 1e7 * meters
* @param lon_int Y Position in WGS84 frame in 1e7 * meters
* @param alt Altitude in meters in WGS84 altitude, not AMSL if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
......@@ -143,7 +143,7 @@ static inline uint16_t mavlink_msg_set_position_target_global_int_pack(uint8_t s
* @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
* @param lat_int X Position in WGS84 frame in 1e7 * meters
* @param lon_int Y Position in WGS84 frame in 1e7 * meters
* @param alt Altitude in meters in WGS84 altitude, not AMSL if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
......@@ -246,7 +246,7 @@ static inline uint16_t mavlink_msg_set_position_target_global_int_encode_chan(ui
* @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
* @param lat_int X Position in WGS84 frame in 1e7 * meters
* @param lon_int Y Position in WGS84 frame in 1e7 * meters
* @param alt Altitude in meters in WGS84 altitude, not AMSL if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @param vx X velocity in NED frame in meter / s
* @param vy Y velocity in NED frame in meter / s
* @param vz Z velocity in NED frame in meter / s
......@@ -451,7 +451,7 @@ static inline int32_t mavlink_msg_set_position_target_global_int_get_lon_int(con
/**
* @brief Get field alt from set_position_target_global_int message
*
* @return Altitude in meters in WGS84 altitude, not AMSL if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
* @return Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
*/
static inline float mavlink_msg_set_position_target_global_int_get_alt(const mavlink_message_t* msg)
{
......
......@@ -1827,6 +1827,57 @@ static void mavlink_test_gps_global_origin(uint8_t system_id, uint8_t component_
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_param_map_rc(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_param_map_rc_t packet_in = {
17.0,45.0,73.0,101.0,18067,187,254,"UVWXYZABCDEFGHI",113
};
mavlink_param_map_rc_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.param_value0 = packet_in.param_value0;
packet1.scale = packet_in.scale;
packet1.param_value_min = packet_in.param_value_min;
packet1.param_value_max = packet_in.param_value_max;
packet1.param_index = packet_in.param_index;
packet1.target_system = packet_in.target_system;
packet1.target_component = packet_in.target_component;
packet1.parameter_rc_channel_index = packet_in.parameter_rc_channel_index;
mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_param_map_rc_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_param_map_rc_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_param_map_rc_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
mavlink_msg_param_map_rc_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_param_map_rc_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
mavlink_msg_param_map_rc_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_param_map_rc_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_param_map_rc_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
mavlink_msg_param_map_rc_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_safety_set_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
......@@ -5029,14 +5080,22 @@ static void mavlink_test_autopilot_version(uint8_t system_id, uint8_t component_
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_autopilot_version_t packet_in = {
93372036854775807ULL,963497880,{ 41, 42, 43, 44, 45, 46, 47, 48 }
93372036854775807ULL,93372036854776311ULL,963498296,963498504,963498712,963498920,18899,19003,{ 113, 114, 115, 116, 117, 118, 119, 120 },{ 137, 138, 139, 140, 141, 142, 143, 144 },{ 161, 162, 163, 164, 165, 166, 167, 168 }
};
mavlink_autopilot_version_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.capabilities = packet_in.capabilities;
packet1.version = packet_in.version;
packet1.uid = packet_in.uid;
packet1.flight_sw_version = packet_in.flight_sw_version;
packet1.middleware_sw_version = packet_in.middleware_sw_version;
packet1.os_sw_version = packet_in.os_sw_version;
packet1.board_version = packet_in.board_version;
packet1.vendor_id = packet_in.vendor_id;
packet1.product_id = packet_in.product_id;
mav_array_memcpy(packet1.custom_version, packet_in.custom_version, sizeof(uint8_t)*8);
mav_array_memcpy(packet1.flight_custom_version, packet_in.flight_custom_version, sizeof(uint8_t)*8);
mav_array_memcpy(packet1.middleware_custom_version, packet_in.middleware_custom_version, sizeof(uint8_t)*8);
mav_array_memcpy(packet1.os_custom_version, packet_in.os_custom_version, sizeof(uint8_t)*8);
memset(&packet2, 0, sizeof(packet2));
......@@ -5045,12 +5104,12 @@ static void mavlink_test_autopilot_version(uint8_t system_id, uint8_t component_
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_autopilot_version_pack(system_id, component_id, &msg , packet1.capabilities , packet1.version , packet1.custom_version );
mavlink_msg_autopilot_version_pack(system_id, component_id, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid );
mavlink_msg_autopilot_version_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_autopilot_version_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.capabilities , packet1.version , packet1.custom_version );
mavlink_msg_autopilot_version_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid );
mavlink_msg_autopilot_version_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
......@@ -5063,7 +5122,7 @@ static void mavlink_test_autopilot_version(uint8_t system_id, uint8_t component_
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_autopilot_version_send(MAVLINK_COMM_1 , packet1.capabilities , packet1.version , packet1.custom_version );
mavlink_msg_autopilot_version_send(MAVLINK_COMM_1 , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid );
mavlink_msg_autopilot_version_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
......@@ -5427,6 +5486,7 @@ static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink
mavlink_test_mission_ack(system_id, component_id, last_msg);
mavlink_test_set_gps_global_origin(system_id, component_id, last_msg);
mavlink_test_gps_global_origin(system_id, component_id, last_msg);
mavlink_test_param_map_rc(system_id, component_id, last_msg);
mavlink_test_safety_set_allowed_area(system_id, component_id, last_msg);
mavlink_test_safety_allowed_area(system_id, component_id, last_msg);
mavlink_test_attitude_quaternion_cov(system_id, component_id, last_msg);
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Nov 14 05:22:45 2014"
#define MAVLINK_BUILD_DATE "Mon Dec 29 11:10:44 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
This diff is collapsed.
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Nov 14 05:22:16 2014"
#define MAVLINK_BUILD_DATE "Mon Dec 29 11:09:58 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -45,13 +45,13 @@ MAVLINK_HELPER void mavlink_quaternion_to_dcm(const float quaternion[4], float d
double cSq = c * c;
double dSq = d * d;
dcm[0][0] = aSq + bSq - cSq - dSq;
dcm[0][1] = 2.0 * (b * c - a * d);
dcm[0][2] = 2.0 * (a * c + b * d);
dcm[1][0] = 2.0 * (b * c + a * d);
dcm[0][1] = 2 * (b * c - a * d);
dcm[0][2] = 2 * (a * c + b * d);
dcm[1][0] = 2 * (b * c + a * d);
dcm[1][1] = aSq - bSq + cSq - dSq;
dcm[1][2] = 2.0 * (c * d - a * b);
dcm[2][0] = 2.0 * (b * d - a * c);
dcm[2][1] = 2.0 * (a * b + c * d);
dcm[1][2] = 2 * (c * d - a * b);
dcm[2][0] = 2 * (b * d - a * c);
dcm[2][1] = 2 * (a * b + c * d);
dcm[2][2] = aSq - bSq - cSq + dSq;
}
......@@ -116,12 +116,12 @@ MAVLINK_HELPER void mavlink_quaternion_to_euler(const float quaternion[4], float
*/
MAVLINK_HELPER void mavlink_euler_to_quaternion(float roll, float pitch, float yaw, float quaternion[4])
{
double cosPhi_2 = cos((double)roll / 2.0);
double sinPhi_2 = sin((double)roll / 2.0);
double cosTheta_2 = cos((double)pitch / 2.0);
double sinTheta_2 = sin((double)pitch / 2.0);
double cosPsi_2 = cos((double)yaw / 2.0);
double sinPsi_2 = sin((double)yaw / 2.0);
float cosPhi_2 = cosf(roll / 2);
float sinPhi_2 = sinf(roll / 2);
float cosTheta_2 = cosf(pitch / 2);
float sinTheta_2 = sinf(pitch / 2);
float cosPsi_2 = cosf(yaw / 2);
float sinPsi_2 = sinf(yaw / 2);
quaternion[0] = (cosPhi_2 * cosTheta_2 * cosPsi_2 +
sinPhi_2 * sinTheta_2 * sinPsi_2);
quaternion[1] = (sinPhi_2 * cosTheta_2 * cosPsi_2 -
......@@ -141,14 +141,10 @@ MAVLINK_HELPER void mavlink_euler_to_quaternion(float roll, float pitch, float y
*/
MAVLINK_HELPER void mavlink_dcm_to_quaternion(const float dcm[3][3], float quaternion[4])
{
quaternion[0] = (0.5 * sqrt(1.0 +
(double)(dcm[0][0] + dcm[1][1] + dcm[2][2])));
quaternion[1] = (0.5 * sqrt(1.0 +
(double)(dcm[0][0] - dcm[1][1] - dcm[2][2])));
quaternion[2] = (0.5 * sqrt(1.0 +
(double)(-dcm[0][0] + dcm[1][1] - dcm[2][2])));
quaternion[3] = (0.5 * sqrt(1.0 +
(double)(-dcm[0][0] - dcm[1][1] + dcm[2][2])));
quaternion[0] = 0.5f * sqrtf(1 + dcm[0][0] + dcm[1][1] + dcm[2][2]);
quaternion[1] = 0.5f * sqrtf(1 + dcm[0][0] - dcm[1][1] - dcm[2][2]);
quaternion[2] = 0.5f * sqrtf(1 - dcm[0][0] + dcm[1][1] - dcm[2][2]);
quaternion[3] = 0.5f * sqrtf(1 - dcm[0][0] - dcm[1][1] + dcm[2][2]);
}
......@@ -162,12 +158,12 @@ MAVLINK_HELPER void mavlink_dcm_to_quaternion(const float dcm[3][3], float quate
*/
MAVLINK_HELPER void mavlink_euler_to_dcm(float roll, float pitch, float yaw, float dcm[3][3])
{
double cosPhi = cos(roll);
double sinPhi = sin(roll);
double cosThe = cos(pitch);
double sinThe = sin(pitch);
double cosPsi = cos(yaw);
double sinPsi = sin(yaw);
float cosPhi = cosf(roll);
float sinPhi = sinf(roll);
float cosThe = cosf(pitch);
float sinThe = sinf(pitch);
float cosPsi = cosf(yaw);
float sinPsi = sinf(yaw);
dcm[0][0] = cosThe * cosPsi;
dcm[0][1] = -cosPhi * sinPsi + sinPhi * sinThe * cosPsi;
......
......@@ -8,6 +8,13 @@
#include <inttypes.h>
#endif
// Macro to define packed structures
#ifdef __GNUC__
#define MAVPACKED( __Declaration__ ) __Declaration__ __attribute__((packed))
#else
#define MAVPACKED( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
#endif
#ifndef MAVLINK_MAX_PAYLOAD_LEN
// it is possible to override this, but be careful!
#define MAVLINK_MAX_PAYLOAD_LEN 255 ///< Maximum payload length
......@@ -33,7 +40,6 @@
#define MAVLINK_MAX_EXTENDED_PAYLOAD_LEN (MAVLINK_MAX_EXTENDED_PACKET_LEN - MAVLINK_EXTENDED_HEADER_LEN - MAVLINK_NUM_NON_PAYLOAD_BYTES)
#pragma pack(push, 1)
/**
* Old-style 4 byte param union
......@@ -44,6 +50,7 @@
* and re-instanted on the receiving side using the
* native type as well.
*/
MAVPACKED(
typedef struct param_union {
union {
float param_float;
......@@ -56,7 +63,7 @@ typedef struct param_union {
uint8_t bytes[4];
};
uint8_t type;
} mavlink_param_union_t;
}) mavlink_param_union_t;
/**
......@@ -72,6 +79,7 @@ typedef struct param_union {
* which should be the same as gcc on little-endian arm. When using shifts/masks the value will be treated as a 64 bit unsigned number,
* and the bits pulled out using the shifts/masks.
*/
MAVPACKED(
typedef union {
struct {
uint8_t is_double:1;
......@@ -89,17 +97,19 @@ typedef union {
};
};
uint8_t data[8];
} mavlink_param_union_double_t;
}) mavlink_param_union_double_t;
/**
* This structure is required to make the mavlink_send_xxx convenience functions
* work, as it tells the library what the current system and component ID are.
*/
MAVPACKED(
typedef struct __mavlink_system {
uint8_t sysid; ///< Used by the MAVLink message_xx_send() convenience function
uint8_t compid; ///< Used by the MAVLink message_xx_send() convenience function
} mavlink_system_t;
}) mavlink_system_t;
MAVPACKED(
typedef struct __mavlink_message {
uint16_t checksum; ///< sent at end of packet
uint8_t magic; ///< protocol magic marker
......@@ -109,14 +119,14 @@ typedef struct __mavlink_message {
uint8_t compid; ///< ID of the message sender component
uint8_t msgid; ///< ID of message in payload
uint64_t payload64[(MAVLINK_MAX_PAYLOAD_LEN+MAVLINK_NUM_CHECKSUM_BYTES+7)/8];
} mavlink_message_t;
}) mavlink_message_t;
MAVPACKED(
typedef struct __mavlink_extended_message {
mavlink_message_t base_msg;
int32_t extended_payload_len; ///< Length of extended payload if any
uint8_t extended_payload[MAVLINK_MAX_EXTENDED_PAYLOAD_LEN];
} mavlink_extended_message_t;
#pragma pack(pop)
}) mavlink_extended_message_t;
typedef enum {
MAVLINK_TYPE_CHAR = 0,
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Nov 14 05:22:21 2014"
#define MAVLINK_BUILD_DATE "Mon Dec 29 11:10:06 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 9
......
This diff is collapsed.
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Nov 14 05:22:22 2014"
#define MAVLINK_BUILD_DATE "Mon Dec 29 11:10:07 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
This diff is collapsed.
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Nov 14 05:22:27 2014"
#define MAVLINK_BUILD_DATE "Mon Dec 29 11:10:15 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Nov 14 05:22:31 2014"
#define MAVLINK_BUILD_DATE "Mon Dec 29 11:10:23 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 179
......
This diff is collapsed.
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Nov 14 05:22:32 2014"
#define MAVLINK_BUILD_DATE "Mon Dec 29 11:10:24 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
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