mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 07:09:48 +08:00
Merge remote-tracking branch 'upstream/control_groups' into fw_autoland_att_tecs_navigator_termination_controlgroups
Conflicts: src/systemcmds/tests/module.mk src/systemcmds/tests/tests.h
This commit is contained in:
@@ -19,12 +19,18 @@ fi
|
||||
if mpu6000 start
|
||||
then
|
||||
echo "using MPU6000"
|
||||
set BOARD fmuv1
|
||||
else
|
||||
echo "using L3GD20 and LSM303D"
|
||||
l3gd20 start
|
||||
lsm303d start
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
echo "using L3GD20(H)"
|
||||
fi
|
||||
|
||||
if lsm303d start
|
||||
then
|
||||
set BOARD fmuv2
|
||||
else
|
||||
set BOARD fmuv1
|
||||
fi
|
||||
|
||||
# Start airspeed sensors
|
||||
|
||||
Executable → Regular
+39
-14
@@ -8,6 +8,8 @@
|
||||
#
|
||||
set MODE autostart
|
||||
|
||||
set logfile /fs/microsd/bootlog.txt
|
||||
|
||||
#
|
||||
# Try to mount the microSD card.
|
||||
#
|
||||
@@ -152,26 +154,49 @@ then
|
||||
nshterm /dev/ttyACM0 &
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Upgrade PX4IO firmware
|
||||
#
|
||||
if px4io detect
|
||||
then
|
||||
echo "PX4IO running, not upgrading"
|
||||
else
|
||||
echo "Attempting to upgrade PX4IO"
|
||||
if px4io update
|
||||
then
|
||||
if [ -d /fs/microsd ]
|
||||
then
|
||||
echo "Flashed PX4IO Firmware OK" > /fs/microsd/px4io.log
|
||||
fi
|
||||
|
||||
# Allow IO to safely kick back to app
|
||||
if [ -f /etc/extras/px4io-v2_default.bin ]
|
||||
then
|
||||
set io_file /etc/extras/px4io-v2_default.bin
|
||||
else
|
||||
set io_file /etc/extras/px4io-v1_default.bin
|
||||
fi
|
||||
|
||||
if px4io start
|
||||
then
|
||||
echo "PX4IO OK"
|
||||
echo "PX4IO OK" >> $logfile
|
||||
fi
|
||||
|
||||
if px4io checkcrc $io_file
|
||||
then
|
||||
echo "PX4IO CRC OK"
|
||||
echo "PX4IO CRC OK" >> $logfile
|
||||
else
|
||||
echo "PX4IO CRC failure"
|
||||
echo "PX4IO CRC failure" >> $logfile
|
||||
tone_alarm MBABGP
|
||||
if px4io forceupdate 14662 $io_file
|
||||
then
|
||||
usleep 200000
|
||||
if px4io start
|
||||
then
|
||||
echo "PX4IO restart OK"
|
||||
echo "PX4IO restart OK" >> $logfile
|
||||
tone_alarm MSPAA
|
||||
else
|
||||
echo "PX4IO restart failed"
|
||||
echo "PX4IO restart failed" >> $logfile
|
||||
tone_alarm MNGGG
|
||||
sh /etc/init.d/rc.error
|
||||
fi
|
||||
else
|
||||
echo "No PX4IO to upgrade here"
|
||||
echo "PX4IO update failed"
|
||||
echo "PX4IO update failed" >> $logfile
|
||||
tone_alarm MNGGG
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
#!nsh
|
||||
#
|
||||
# PX4FMU startup script for logging purposes
|
||||
#
|
||||
|
||||
#
|
||||
# Try to mount the microSD card.
|
||||
#
|
||||
echo "[init] looking for microSD..."
|
||||
if mount -t vfat /dev/mmcsd0 /fs/microsd
|
||||
then
|
||||
echo "[init] card mounted at /fs/microsd"
|
||||
# Start playing the startup tune
|
||||
tone_alarm start
|
||||
else
|
||||
echo "[init] no microSD card found"
|
||||
# Play SOS
|
||||
tone_alarm error
|
||||
fi
|
||||
|
||||
uorb start
|
||||
|
||||
#
|
||||
# Start sensor drivers here.
|
||||
#
|
||||
|
||||
ms5611 start
|
||||
adc start
|
||||
|
||||
# mag might be external
|
||||
if hmc5883 start
|
||||
then
|
||||
echo "using HMC5883"
|
||||
fi
|
||||
|
||||
if mpu6000 start
|
||||
then
|
||||
echo "using MPU6000"
|
||||
fi
|
||||
|
||||
if l3gd20 start
|
||||
then
|
||||
echo "using L3GD20(H)"
|
||||
fi
|
||||
|
||||
if lsm303d start
|
||||
then
|
||||
set BOARD fmuv2
|
||||
else
|
||||
set BOARD fmuv1
|
||||
fi
|
||||
|
||||
# Start airspeed sensors
|
||||
if meas_airspeed start
|
||||
then
|
||||
echo "using MEAS airspeed sensor"
|
||||
else
|
||||
if ets_airspeed start
|
||||
then
|
||||
echo "using ETS airspeed sensor (bus 3)"
|
||||
else
|
||||
if ets_airspeed start -b 1
|
||||
then
|
||||
echo "Using ETS airspeed sensor (bus 1)"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Start the sensor collection task.
|
||||
# IMPORTANT: this also loads param offsets
|
||||
# ALWAYS start this task before the
|
||||
# preflight_check.
|
||||
#
|
||||
if sensors start
|
||||
then
|
||||
echo "SENSORS STARTED"
|
||||
fi
|
||||
|
||||
sdlog2 start -r 250 -e -b 16
|
||||
|
||||
if sercon
|
||||
then
|
||||
echo "[init] USB interface connected"
|
||||
|
||||
# Try to get an USB console
|
||||
nshterm /dev/ttyACM0 &
|
||||
fi
|
||||
Executable → Regular
+8
@@ -2,3 +2,11 @@
|
||||
#
|
||||
# PX4FMU startup script for test hackery.
|
||||
#
|
||||
|
||||
if sercon
|
||||
then
|
||||
echo "[init] USB interface connected"
|
||||
|
||||
# Try to get an USB console
|
||||
nshterm /dev/ttyACM0 &
|
||||
fi
|
||||
@@ -21,6 +21,7 @@ MODULES += drivers/px4fmu
|
||||
MODULES += drivers/px4io
|
||||
MODULES += drivers/boards/px4fmu-v2
|
||||
MODULES += drivers/rgbled
|
||||
MODULES += drivers/mpu6000
|
||||
MODULES += drivers/lsm303d
|
||||
MODULES += drivers/l3gd20
|
||||
MODULES += drivers/hmc5883
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
#
|
||||
# Makefile for the px4fmu_default configuration
|
||||
#
|
||||
|
||||
#
|
||||
# Use the configuration's ROMFS, copy the px4iov2 firmware into
|
||||
# the ROMFS if it's available
|
||||
#
|
||||
ROMFS_ROOT = $(PX4_BASE)/ROMFS/px4fmu_logging
|
||||
ROMFS_OPTIONAL_FILES = $(PX4_BASE)/Images/px4io-v2_default.bin
|
||||
|
||||
#
|
||||
# Board support modules
|
||||
#
|
||||
MODULES += drivers/device
|
||||
MODULES += drivers/stm32
|
||||
MODULES += drivers/stm32/adc
|
||||
MODULES += drivers/stm32/tone_alarm
|
||||
MODULES += drivers/led
|
||||
MODULES += drivers/px4fmu
|
||||
MODULES += drivers/px4io
|
||||
MODULES += drivers/boards/px4fmu-v2
|
||||
MODULES += drivers/rgbled
|
||||
MODULES += drivers/mpu6000
|
||||
MODULES += drivers/lsm303d
|
||||
MODULES += drivers/l3gd20
|
||||
MODULES += drivers/hmc5883
|
||||
MODULES += drivers/ms5611
|
||||
MODULES += drivers/mb12xx
|
||||
MODULES += drivers/gps
|
||||
MODULES += drivers/hil
|
||||
MODULES += drivers/hott/hott_telemetry
|
||||
MODULES += drivers/hott/hott_sensors
|
||||
MODULES += drivers/blinkm
|
||||
MODULES += drivers/roboclaw
|
||||
MODULES += drivers/airspeed
|
||||
MODULES += drivers/ets_airspeed
|
||||
MODULES += drivers/meas_airspeed
|
||||
MODULES += modules/sensors
|
||||
|
||||
# Needs to be burned to the ground and re-written; for now,
|
||||
# just don't build it.
|
||||
#MODULES += drivers/mkblctrl
|
||||
|
||||
#
|
||||
# System commands
|
||||
#
|
||||
MODULES += systemcmds/ramtron
|
||||
MODULES += systemcmds/bl_update
|
||||
MODULES += systemcmds/boardinfo
|
||||
MODULES += systemcmds/mixer
|
||||
MODULES += systemcmds/param
|
||||
MODULES += systemcmds/perf
|
||||
MODULES += systemcmds/preflight_check
|
||||
MODULES += systemcmds/pwm
|
||||
MODULES += systemcmds/esc_calib
|
||||
MODULES += systemcmds/reboot
|
||||
MODULES += systemcmds/top
|
||||
MODULES += systemcmds/tests
|
||||
MODULES += systemcmds/config
|
||||
MODULES += systemcmds/nshterm
|
||||
|
||||
#
|
||||
# General system control
|
||||
#
|
||||
MODULES += modules/commander
|
||||
MODULES += modules/navigator
|
||||
MODULES += modules/mavlink
|
||||
MODULES += modules/mavlink_onboard
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
#
|
||||
MODULES += modules/attitude_estimator_ekf
|
||||
MODULES += modules/attitude_estimator_so3
|
||||
MODULES += modules/att_pos_estimator_ekf
|
||||
MODULES += modules/position_estimator_inav
|
||||
MODULES += examples/flow_position_estimator
|
||||
|
||||
#
|
||||
# Vehicle Control
|
||||
#
|
||||
#MODULES += modules/segway # XXX Needs GCC 4.7 fix
|
||||
MODULES += modules/fw_pos_control_l1
|
||||
MODULES += modules/fw_att_control
|
||||
MODULES += modules/multirotor_att_control
|
||||
MODULES += modules/multirotor_pos_control
|
||||
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
MODULES += modules/sdlog2
|
||||
|
||||
#
|
||||
# Unit tests
|
||||
#
|
||||
#MODULES += modules/unit_test
|
||||
#MODULES += modules/commander/commander_tests
|
||||
|
||||
#
|
||||
# Library modules
|
||||
#
|
||||
MODULES += modules/systemlib
|
||||
MODULES += modules/systemlib/mixer
|
||||
MODULES += modules/controllib
|
||||
MODULES += modules/uORB
|
||||
|
||||
#
|
||||
# Libraries
|
||||
#
|
||||
LIBRARIES += lib/mathlib/CMSIS
|
||||
MODULES += lib/mathlib
|
||||
MODULES += lib/mathlib/math/filter
|
||||
MODULES += lib/ecl
|
||||
MODULES += lib/external_lgpl
|
||||
MODULES += lib/geo
|
||||
MODULES += lib/conversion
|
||||
|
||||
#
|
||||
# Demo apps
|
||||
#
|
||||
#MODULES += examples/math_demo
|
||||
# Tutorial code from
|
||||
# https://pixhawk.ethz.ch/px4/dev/hello_sky
|
||||
MODULES += examples/px4_simple_app
|
||||
|
||||
# Tutorial code from
|
||||
# https://pixhawk.ethz.ch/px4/dev/daemon
|
||||
#MODULES += examples/px4_daemon_app
|
||||
|
||||
# Tutorial code from
|
||||
# https://pixhawk.ethz.ch/px4/dev/debug_values
|
||||
#MODULES += examples/px4_mavlink_debug
|
||||
|
||||
# Tutorial code from
|
||||
# https://pixhawk.ethz.ch/px4/dev/example_fixedwing_control
|
||||
#MODULES += examples/fixedwing_control
|
||||
|
||||
# Hardware test
|
||||
#MODULES += examples/hwtest
|
||||
|
||||
#
|
||||
# Transitional support - add commands from the NuttX export archive.
|
||||
#
|
||||
# In general, these should move to modules over time.
|
||||
#
|
||||
# Each entry here is <command>.<priority>.<stacksize>.<entrypoint> but we use a helper macro
|
||||
# to make the table a bit more readable.
|
||||
#
|
||||
define _B
|
||||
$(strip $1).$(or $(strip $2),SCHED_PRIORITY_DEFAULT).$(or $(strip $3),CONFIG_PTHREAD_STACK_DEFAULT).$(strip $4)
|
||||
endef
|
||||
|
||||
# command priority stack entrypoint
|
||||
BUILTIN_COMMANDS := \
|
||||
$(call _B, sercon, , 2048, sercon_main ) \
|
||||
$(call _B, serdis, , 2048, serdis_main )
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,221 @@
|
||||
// MESSAGE RALLY_FETCH_POINT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_FETCH_POINT 176
|
||||
|
||||
typedef struct __mavlink_rally_fetch_point_t
|
||||
{
|
||||
uint8_t target_system; ///< System ID
|
||||
uint8_t target_component; ///< Component ID
|
||||
uint8_t idx; ///< point index (first point is 0)
|
||||
} mavlink_rally_fetch_point_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN 3
|
||||
#define MAVLINK_MSG_ID_176_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC 234
|
||||
#define MAVLINK_MSG_ID_176_CRC 234
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_RALLY_FETCH_POINT { \
|
||||
"RALLY_FETCH_POINT", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_rally_fetch_point_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_rally_fetch_point_t, target_component) }, \
|
||||
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_rally_fetch_point_t, idx) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a rally_fetch_point message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_fetch_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t idx)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#else
|
||||
mavlink_rally_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a rally_fetch_point message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_fetch_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t idx)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#else
|
||||
mavlink_rally_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rally_fetch_point struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rally_fetch_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_fetch_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rally_fetch_point_t* rally_fetch_point)
|
||||
{
|
||||
return mavlink_msg_rally_fetch_point_pack(system_id, component_id, msg, rally_fetch_point->target_system, rally_fetch_point->target_component, rally_fetch_point->idx);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rally_fetch_point struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rally_fetch_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_fetch_point_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rally_fetch_point_t* rally_fetch_point)
|
||||
{
|
||||
return mavlink_msg_rally_fetch_point_pack_chan(system_id, component_id, chan, msg, rally_fetch_point->target_system, rally_fetch_point->target_component, rally_fetch_point->idx);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a rally_fetch_point message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_rally_fetch_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_rally_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, (const char *)&packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, (const char *)&packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE RALLY_FETCH_POINT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from rally_fetch_point message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_fetch_point_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from rally_fetch_point message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_fetch_point_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field idx from rally_fetch_point message
|
||||
*
|
||||
* @return point index (first point is 0)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_fetch_point_get_idx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a rally_fetch_point message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param rally_fetch_point C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_rally_fetch_point_decode(const mavlink_message_t* msg, mavlink_rally_fetch_point_t* rally_fetch_point)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
rally_fetch_point->target_system = mavlink_msg_rally_fetch_point_get_target_system(msg);
|
||||
rally_fetch_point->target_component = mavlink_msg_rally_fetch_point_get_target_component(msg);
|
||||
rally_fetch_point->idx = mavlink_msg_rally_fetch_point_get_idx(msg);
|
||||
#else
|
||||
memcpy(rally_fetch_point, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,375 @@
|
||||
// MESSAGE RALLY_POINT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_POINT 175
|
||||
|
||||
typedef struct __mavlink_rally_point_t
|
||||
{
|
||||
int32_t lat; ///< Latitude of point in degrees * 1E7
|
||||
int32_t lng; ///< Longitude of point in degrees * 1E7
|
||||
int16_t alt; ///< Transit / loiter altitude in meters relative to home
|
||||
int16_t break_alt; ///< Break altitude in meters relative to home
|
||||
uint16_t land_dir; ///< Heading to aim for when landing. In centi-degrees.
|
||||
uint8_t target_system; ///< System ID
|
||||
uint8_t target_component; ///< Component ID
|
||||
uint8_t idx; ///< point index (first point is 0)
|
||||
uint8_t count; ///< total number of points (for sanity checking)
|
||||
uint8_t flags; ///< See RALLY_FLAGS enum for definition of the bitmask.
|
||||
} mavlink_rally_point_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_POINT_LEN 19
|
||||
#define MAVLINK_MSG_ID_175_LEN 19
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_POINT_CRC 138
|
||||
#define MAVLINK_MSG_ID_175_CRC 138
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_RALLY_POINT { \
|
||||
"RALLY_POINT", \
|
||||
10, \
|
||||
{ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_rally_point_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_rally_point_t, lng) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rally_point_t, alt) }, \
|
||||
{ "break_alt", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rally_point_t, break_alt) }, \
|
||||
{ "land_dir", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rally_point_t, land_dir) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_rally_point_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_rally_point_t, target_component) }, \
|
||||
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rally_point_t, idx) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rally_point_t, count) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_rally_point_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a rally_point message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
* @param count total number of points (for sanity checking)
|
||||
* @param lat Latitude of point in degrees * 1E7
|
||||
* @param lng Longitude of point in degrees * 1E7
|
||||
* @param alt Transit / loiter altitude in meters relative to home
|
||||
* @param break_alt Break altitude in meters relative to home
|
||||
* @param land_dir Heading to aim for when landing. In centi-degrees.
|
||||
* @param flags See RALLY_FLAGS enum for definition of the bitmask.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, int32_t lat, int32_t lng, int16_t alt, int16_t break_alt, uint16_t land_dir, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_POINT_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lng);
|
||||
_mav_put_int16_t(buf, 8, alt);
|
||||
_mav_put_int16_t(buf, 10, break_alt);
|
||||
_mav_put_uint16_t(buf, 12, land_dir);
|
||||
_mav_put_uint8_t(buf, 14, target_system);
|
||||
_mav_put_uint8_t(buf, 15, target_component);
|
||||
_mav_put_uint8_t(buf, 16, idx);
|
||||
_mav_put_uint8_t(buf, 17, count);
|
||||
_mav_put_uint8_t(buf, 18, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#else
|
||||
mavlink_rally_point_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.alt = alt;
|
||||
packet.break_alt = break_alt;
|
||||
packet.land_dir = land_dir;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RALLY_POINT;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a rally_point message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
* @param count total number of points (for sanity checking)
|
||||
* @param lat Latitude of point in degrees * 1E7
|
||||
* @param lng Longitude of point in degrees * 1E7
|
||||
* @param alt Transit / loiter altitude in meters relative to home
|
||||
* @param break_alt Break altitude in meters relative to home
|
||||
* @param land_dir Heading to aim for when landing. In centi-degrees.
|
||||
* @param flags See RALLY_FLAGS enum for definition of the bitmask.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t idx,uint8_t count,int32_t lat,int32_t lng,int16_t alt,int16_t break_alt,uint16_t land_dir,uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_POINT_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lng);
|
||||
_mav_put_int16_t(buf, 8, alt);
|
||||
_mav_put_int16_t(buf, 10, break_alt);
|
||||
_mav_put_uint16_t(buf, 12, land_dir);
|
||||
_mav_put_uint8_t(buf, 14, target_system);
|
||||
_mav_put_uint8_t(buf, 15, target_component);
|
||||
_mav_put_uint8_t(buf, 16, idx);
|
||||
_mav_put_uint8_t(buf, 17, count);
|
||||
_mav_put_uint8_t(buf, 18, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#else
|
||||
mavlink_rally_point_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.alt = alt;
|
||||
packet.break_alt = break_alt;
|
||||
packet.land_dir = land_dir;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RALLY_POINT;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rally_point struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rally_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rally_point_t* rally_point)
|
||||
{
|
||||
return mavlink_msg_rally_point_pack(system_id, component_id, msg, rally_point->target_system, rally_point->target_component, rally_point->idx, rally_point->count, rally_point->lat, rally_point->lng, rally_point->alt, rally_point->break_alt, rally_point->land_dir, rally_point->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rally_point struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rally_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_point_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rally_point_t* rally_point)
|
||||
{
|
||||
return mavlink_msg_rally_point_pack_chan(system_id, component_id, chan, msg, rally_point->target_system, rally_point->target_component, rally_point->idx, rally_point->count, rally_point->lat, rally_point->lng, rally_point->alt, rally_point->break_alt, rally_point->land_dir, rally_point->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a rally_point message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
* @param count total number of points (for sanity checking)
|
||||
* @param lat Latitude of point in degrees * 1E7
|
||||
* @param lng Longitude of point in degrees * 1E7
|
||||
* @param alt Transit / loiter altitude in meters relative to home
|
||||
* @param break_alt Break altitude in meters relative to home
|
||||
* @param land_dir Heading to aim for when landing. In centi-degrees.
|
||||
* @param flags See RALLY_FLAGS enum for definition of the bitmask.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_rally_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, int32_t lat, int32_t lng, int16_t alt, int16_t break_alt, uint16_t land_dir, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_POINT_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lng);
|
||||
_mav_put_int16_t(buf, 8, alt);
|
||||
_mav_put_int16_t(buf, 10, break_alt);
|
||||
_mav_put_uint16_t(buf, 12, land_dir);
|
||||
_mav_put_uint8_t(buf, 14, target_system);
|
||||
_mav_put_uint8_t(buf, 15, target_component);
|
||||
_mav_put_uint8_t(buf, 16, idx);
|
||||
_mav_put_uint8_t(buf, 17, count);
|
||||
_mav_put_uint8_t(buf, 18, flags);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, buf, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, buf, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_rally_point_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.alt = alt;
|
||||
packet.break_alt = break_alt;
|
||||
packet.land_dir = land_dir;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
packet.flags = flags;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, (const char *)&packet, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, (const char *)&packet, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE RALLY_POINT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from rally_point message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_point_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from rally_point message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_point_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 15);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field idx from rally_point message
|
||||
*
|
||||
* @return point index (first point is 0)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_point_get_idx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field count from rally_point message
|
||||
*
|
||||
* @return total number of points (for sanity checking)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_point_get_count(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 17);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from rally_point message
|
||||
*
|
||||
* @return Latitude of point in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_rally_point_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lng from rally_point message
|
||||
*
|
||||
* @return Longitude of point in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_rally_point_get_lng(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from rally_point message
|
||||
*
|
||||
* @return Transit / loiter altitude in meters relative to home
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rally_point_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field break_alt from rally_point message
|
||||
*
|
||||
* @return Break altitude in meters relative to home
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rally_point_get_break_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field land_dir from rally_point message
|
||||
*
|
||||
* @return Heading to aim for when landing. In centi-degrees.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_point_get_land_dir(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from rally_point message
|
||||
*
|
||||
* @return See RALLY_FLAGS enum for definition of the bitmask.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_point_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a rally_point message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param rally_point C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_rally_point_decode(const mavlink_message_t* msg, mavlink_rally_point_t* rally_point)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
rally_point->lat = mavlink_msg_rally_point_get_lat(msg);
|
||||
rally_point->lng = mavlink_msg_rally_point_get_lng(msg);
|
||||
rally_point->alt = mavlink_msg_rally_point_get_alt(msg);
|
||||
rally_point->break_alt = mavlink_msg_rally_point_get_break_alt(msg);
|
||||
rally_point->land_dir = mavlink_msg_rally_point_get_land_dir(msg);
|
||||
rally_point->target_system = mavlink_msg_rally_point_get_target_system(msg);
|
||||
rally_point->target_component = mavlink_msg_rally_point_get_target_component(msg);
|
||||
rally_point->idx = mavlink_msg_rally_point_get_idx(msg);
|
||||
rally_point->count = mavlink_msg_rally_point_get_count(msg);
|
||||
rally_point->flags = mavlink_msg_rally_point_get_flags(msg);
|
||||
#else
|
||||
memcpy(rally_point, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#endif
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Tue Sep 10 23:49:25 2013"
|
||||
#define MAVLINK_BUILD_DATE "Mon Dec 16 08:56:32 2013"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 254
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -31,26 +31,26 @@ static void mavlink_test_aq_telemetry_f(uint8_t system_id, uint8_t component_id,
|
||||
uint16_t i;
|
||||
mavlink_aq_telemetry_f_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
129.0,
|
||||
157.0,
|
||||
185.0,
|
||||
213.0,
|
||||
241.0,
|
||||
269.0,
|
||||
297.0,
|
||||
325.0,
|
||||
353.0,
|
||||
381.0,
|
||||
409.0,
|
||||
437.0,
|
||||
465.0,
|
||||
493.0,
|
||||
521.0,
|
||||
549.0,
|
||||
21395,
|
||||
}45.0,
|
||||
}73.0,
|
||||
}101.0,
|
||||
}129.0,
|
||||
}157.0,
|
||||
}185.0,
|
||||
}213.0,
|
||||
}241.0,
|
||||
}269.0,
|
||||
}297.0,
|
||||
}325.0,
|
||||
}353.0,
|
||||
}381.0,
|
||||
}409.0,
|
||||
}437.0,
|
||||
}465.0,
|
||||
}493.0,
|
||||
}521.0,
|
||||
}549.0,
|
||||
}21395,
|
||||
};
|
||||
mavlink_aq_telemetry_f_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Tue Sep 10 23:49:36 2013"
|
||||
#define MAVLINK_BUILD_DATE "Mon Dec 16 09:03:20 2013"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 254
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -4,6 +4,8 @@
|
||||
|
||||
typedef struct __mavlink_battery_status_t
|
||||
{
|
||||
int32_t current_consumed; ///< Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
|
||||
int32_t energy_consumed; ///< Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
|
||||
uint16_t voltage_cell_1; ///< Battery voltage of cell 1, in millivolts (1 = 1 millivolt)
|
||||
uint16_t voltage_cell_2; ///< Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
uint16_t voltage_cell_3; ///< Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
@@ -15,26 +17,28 @@ typedef struct __mavlink_battery_status_t
|
||||
int8_t battery_remaining; ///< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
|
||||
} mavlink_battery_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 16
|
||||
#define MAVLINK_MSG_ID_147_LEN 16
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 24
|
||||
#define MAVLINK_MSG_ID_147_LEN 24
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS_CRC 42
|
||||
#define MAVLINK_MSG_ID_147_CRC 42
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS_CRC 177
|
||||
#define MAVLINK_MSG_ID_147_CRC 177
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \
|
||||
"BATTERY_STATUS", \
|
||||
9, \
|
||||
{ { "voltage_cell_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_battery_status_t, voltage_cell_1) }, \
|
||||
{ "voltage_cell_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_battery_status_t, voltage_cell_2) }, \
|
||||
{ "voltage_cell_3", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_battery_status_t, voltage_cell_3) }, \
|
||||
{ "voltage_cell_4", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_battery_status_t, voltage_cell_4) }, \
|
||||
{ "voltage_cell_5", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_battery_status_t, voltage_cell_5) }, \
|
||||
{ "voltage_cell_6", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_battery_status_t, voltage_cell_6) }, \
|
||||
{ "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_battery_status_t, current_battery) }, \
|
||||
{ "accu_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_battery_status_t, accu_id) }, \
|
||||
{ "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 15, offsetof(mavlink_battery_status_t, battery_remaining) }, \
|
||||
11, \
|
||||
{ { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \
|
||||
{ "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \
|
||||
{ "voltage_cell_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_battery_status_t, voltage_cell_1) }, \
|
||||
{ "voltage_cell_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_battery_status_t, voltage_cell_2) }, \
|
||||
{ "voltage_cell_3", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_battery_status_t, voltage_cell_3) }, \
|
||||
{ "voltage_cell_4", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_battery_status_t, voltage_cell_4) }, \
|
||||
{ "voltage_cell_5", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_battery_status_t, voltage_cell_5) }, \
|
||||
{ "voltage_cell_6", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_battery_status_t, voltage_cell_6) }, \
|
||||
{ "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_battery_status_t, current_battery) }, \
|
||||
{ "accu_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_battery_status_t, accu_id) }, \
|
||||
{ "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 23, offsetof(mavlink_battery_status_t, battery_remaining) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
@@ -53,27 +57,33 @@ typedef struct __mavlink_battery_status_t
|
||||
* @param voltage_cell_5 Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_6 Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
* @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
|
||||
* @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
|
||||
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t accu_id, uint16_t voltage_cell_1, uint16_t voltage_cell_2, uint16_t voltage_cell_3, uint16_t voltage_cell_4, uint16_t voltage_cell_5, uint16_t voltage_cell_6, int16_t current_battery, int8_t battery_remaining)
|
||||
uint8_t accu_id, uint16_t voltage_cell_1, uint16_t voltage_cell_2, uint16_t voltage_cell_3, uint16_t voltage_cell_4, uint16_t voltage_cell_5, uint16_t voltage_cell_6, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
|
||||
_mav_put_uint16_t(buf, 0, voltage_cell_1);
|
||||
_mav_put_uint16_t(buf, 2, voltage_cell_2);
|
||||
_mav_put_uint16_t(buf, 4, voltage_cell_3);
|
||||
_mav_put_uint16_t(buf, 6, voltage_cell_4);
|
||||
_mav_put_uint16_t(buf, 8, voltage_cell_5);
|
||||
_mav_put_uint16_t(buf, 10, voltage_cell_6);
|
||||
_mav_put_int16_t(buf, 12, current_battery);
|
||||
_mav_put_uint8_t(buf, 14, accu_id);
|
||||
_mav_put_int8_t(buf, 15, battery_remaining);
|
||||
_mav_put_int32_t(buf, 0, current_consumed);
|
||||
_mav_put_int32_t(buf, 4, energy_consumed);
|
||||
_mav_put_uint16_t(buf, 8, voltage_cell_1);
|
||||
_mav_put_uint16_t(buf, 10, voltage_cell_2);
|
||||
_mav_put_uint16_t(buf, 12, voltage_cell_3);
|
||||
_mav_put_uint16_t(buf, 14, voltage_cell_4);
|
||||
_mav_put_uint16_t(buf, 16, voltage_cell_5);
|
||||
_mav_put_uint16_t(buf, 18, voltage_cell_6);
|
||||
_mav_put_int16_t(buf, 20, current_battery);
|
||||
_mav_put_uint8_t(buf, 22, accu_id);
|
||||
_mav_put_int8_t(buf, 23, battery_remaining);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.current_consumed = current_consumed;
|
||||
packet.energy_consumed = energy_consumed;
|
||||
packet.voltage_cell_1 = voltage_cell_1;
|
||||
packet.voltage_cell_2 = voltage_cell_2;
|
||||
packet.voltage_cell_3 = voltage_cell_3;
|
||||
@@ -109,28 +119,34 @@ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_
|
||||
* @param voltage_cell_5 Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_6 Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
* @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
|
||||
* @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
|
||||
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t accu_id,uint16_t voltage_cell_1,uint16_t voltage_cell_2,uint16_t voltage_cell_3,uint16_t voltage_cell_4,uint16_t voltage_cell_5,uint16_t voltage_cell_6,int16_t current_battery,int8_t battery_remaining)
|
||||
uint8_t accu_id,uint16_t voltage_cell_1,uint16_t voltage_cell_2,uint16_t voltage_cell_3,uint16_t voltage_cell_4,uint16_t voltage_cell_5,uint16_t voltage_cell_6,int16_t current_battery,int32_t current_consumed,int32_t energy_consumed,int8_t battery_remaining)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
|
||||
_mav_put_uint16_t(buf, 0, voltage_cell_1);
|
||||
_mav_put_uint16_t(buf, 2, voltage_cell_2);
|
||||
_mav_put_uint16_t(buf, 4, voltage_cell_3);
|
||||
_mav_put_uint16_t(buf, 6, voltage_cell_4);
|
||||
_mav_put_uint16_t(buf, 8, voltage_cell_5);
|
||||
_mav_put_uint16_t(buf, 10, voltage_cell_6);
|
||||
_mav_put_int16_t(buf, 12, current_battery);
|
||||
_mav_put_uint8_t(buf, 14, accu_id);
|
||||
_mav_put_int8_t(buf, 15, battery_remaining);
|
||||
_mav_put_int32_t(buf, 0, current_consumed);
|
||||
_mav_put_int32_t(buf, 4, energy_consumed);
|
||||
_mav_put_uint16_t(buf, 8, voltage_cell_1);
|
||||
_mav_put_uint16_t(buf, 10, voltage_cell_2);
|
||||
_mav_put_uint16_t(buf, 12, voltage_cell_3);
|
||||
_mav_put_uint16_t(buf, 14, voltage_cell_4);
|
||||
_mav_put_uint16_t(buf, 16, voltage_cell_5);
|
||||
_mav_put_uint16_t(buf, 18, voltage_cell_6);
|
||||
_mav_put_int16_t(buf, 20, current_battery);
|
||||
_mav_put_uint8_t(buf, 22, accu_id);
|
||||
_mav_put_int8_t(buf, 23, battery_remaining);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.current_consumed = current_consumed;
|
||||
packet.energy_consumed = energy_consumed;
|
||||
packet.voltage_cell_1 = voltage_cell_1;
|
||||
packet.voltage_cell_2 = voltage_cell_2;
|
||||
packet.voltage_cell_3 = voltage_cell_3;
|
||||
@@ -162,7 +178,7 @@ static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, u
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status)
|
||||
{
|
||||
return mavlink_msg_battery_status_pack(system_id, component_id, msg, battery_status->accu_id, battery_status->voltage_cell_1, battery_status->voltage_cell_2, battery_status->voltage_cell_3, battery_status->voltage_cell_4, battery_status->voltage_cell_5, battery_status->voltage_cell_6, battery_status->current_battery, battery_status->battery_remaining);
|
||||
return mavlink_msg_battery_status_pack(system_id, component_id, msg, battery_status->accu_id, battery_status->voltage_cell_1, battery_status->voltage_cell_2, battery_status->voltage_cell_3, battery_status->voltage_cell_4, battery_status->voltage_cell_5, battery_status->voltage_cell_6, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,7 +192,7 @@ static inline uint16_t mavlink_msg_battery_status_encode(uint8_t system_id, uint
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status)
|
||||
{
|
||||
return mavlink_msg_battery_status_pack_chan(system_id, component_id, chan, msg, battery_status->accu_id, battery_status->voltage_cell_1, battery_status->voltage_cell_2, battery_status->voltage_cell_3, battery_status->voltage_cell_4, battery_status->voltage_cell_5, battery_status->voltage_cell_6, battery_status->current_battery, battery_status->battery_remaining);
|
||||
return mavlink_msg_battery_status_pack_chan(system_id, component_id, chan, msg, battery_status->accu_id, battery_status->voltage_cell_1, battery_status->voltage_cell_2, battery_status->voltage_cell_3, battery_status->voltage_cell_4, battery_status->voltage_cell_5, battery_status->voltage_cell_6, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,23 +207,27 @@ static inline uint16_t mavlink_msg_battery_status_encode_chan(uint8_t system_id,
|
||||
* @param voltage_cell_5 Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_6 Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
* @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
|
||||
* @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
|
||||
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8_t accu_id, uint16_t voltage_cell_1, uint16_t voltage_cell_2, uint16_t voltage_cell_3, uint16_t voltage_cell_4, uint16_t voltage_cell_5, uint16_t voltage_cell_6, int16_t current_battery, int8_t battery_remaining)
|
||||
static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8_t accu_id, uint16_t voltage_cell_1, uint16_t voltage_cell_2, uint16_t voltage_cell_3, uint16_t voltage_cell_4, uint16_t voltage_cell_5, uint16_t voltage_cell_6, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
|
||||
_mav_put_uint16_t(buf, 0, voltage_cell_1);
|
||||
_mav_put_uint16_t(buf, 2, voltage_cell_2);
|
||||
_mav_put_uint16_t(buf, 4, voltage_cell_3);
|
||||
_mav_put_uint16_t(buf, 6, voltage_cell_4);
|
||||
_mav_put_uint16_t(buf, 8, voltage_cell_5);
|
||||
_mav_put_uint16_t(buf, 10, voltage_cell_6);
|
||||
_mav_put_int16_t(buf, 12, current_battery);
|
||||
_mav_put_uint8_t(buf, 14, accu_id);
|
||||
_mav_put_int8_t(buf, 15, battery_remaining);
|
||||
_mav_put_int32_t(buf, 0, current_consumed);
|
||||
_mav_put_int32_t(buf, 4, energy_consumed);
|
||||
_mav_put_uint16_t(buf, 8, voltage_cell_1);
|
||||
_mav_put_uint16_t(buf, 10, voltage_cell_2);
|
||||
_mav_put_uint16_t(buf, 12, voltage_cell_3);
|
||||
_mav_put_uint16_t(buf, 14, voltage_cell_4);
|
||||
_mav_put_uint16_t(buf, 16, voltage_cell_5);
|
||||
_mav_put_uint16_t(buf, 18, voltage_cell_6);
|
||||
_mav_put_int16_t(buf, 20, current_battery);
|
||||
_mav_put_uint8_t(buf, 22, accu_id);
|
||||
_mav_put_int8_t(buf, 23, battery_remaining);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
@@ -216,6 +236,8 @@ static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8
|
||||
#endif
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.current_consumed = current_consumed;
|
||||
packet.energy_consumed = energy_consumed;
|
||||
packet.voltage_cell_1 = voltage_cell_1;
|
||||
packet.voltage_cell_2 = voltage_cell_2;
|
||||
packet.voltage_cell_3 = voltage_cell_3;
|
||||
@@ -246,7 +268,7 @@ static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_battery_status_get_accu_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 14);
|
||||
return _MAV_RETURN_uint8_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,7 +278,7 @@ static inline uint8_t mavlink_msg_battery_status_get_accu_id(const mavlink_messa
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,7 +288,7 @@ static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_1(const mavli
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 2);
|
||||
return _MAV_RETURN_uint16_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -276,7 +298,7 @@ static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_2(const mavli
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
return _MAV_RETURN_uint16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,7 +308,7 @@ static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_3(const mavli
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 6);
|
||||
return _MAV_RETURN_uint16_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -296,7 +318,7 @@ static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_4(const mavli
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_5(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
return _MAV_RETURN_uint16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -306,7 +328,7 @@ static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_5(const mavli
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_6(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 10);
|
||||
return _MAV_RETURN_uint16_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -316,7 +338,27 @@ static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_6(const mavli
|
||||
*/
|
||||
static inline int16_t mavlink_msg_battery_status_get_current_battery(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 12);
|
||||
return _MAV_RETURN_int16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current_consumed from battery_status message
|
||||
*
|
||||
* @return Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
|
||||
*/
|
||||
static inline int32_t mavlink_msg_battery_status_get_current_consumed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field energy_consumed from battery_status message
|
||||
*
|
||||
* @return Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
|
||||
*/
|
||||
static inline int32_t mavlink_msg_battery_status_get_energy_consumed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -326,7 +368,7 @@ static inline int16_t mavlink_msg_battery_status_get_current_battery(const mavli
|
||||
*/
|
||||
static inline int8_t mavlink_msg_battery_status_get_battery_remaining(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 15);
|
||||
return _MAV_RETURN_int8_t(msg, 23);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,6 +380,8 @@ static inline int8_t mavlink_msg_battery_status_get_battery_remaining(const mavl
|
||||
static inline void mavlink_msg_battery_status_decode(const mavlink_message_t* msg, mavlink_battery_status_t* battery_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
battery_status->current_consumed = mavlink_msg_battery_status_get_current_consumed(msg);
|
||||
battery_status->energy_consumed = mavlink_msg_battery_status_get_energy_consumed(msg);
|
||||
battery_status->voltage_cell_1 = mavlink_msg_battery_status_get_voltage_cell_1(msg);
|
||||
battery_status->voltage_cell_2 = mavlink_msg_battery_status_get_voltage_cell_2(msg);
|
||||
battery_status->voltage_cell_3 = mavlink_msg_battery_status_get_voltage_cell_3(msg);
|
||||
|
||||
@@ -9,7 +9,7 @@ typedef struct __mavlink_gps_raw_int_t
|
||||
int32_t lon; ///< Longitude (WGS84), in degrees * 1E7
|
||||
int32_t alt; ///< Altitude (WGS84), in meters * 1000 (positive for up)
|
||||
uint16_t eph; ///< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
|
||||
uint16_t epv; ///< GPS VDOP 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
|
||||
uint16_t cog; ///< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
uint8_t fix_type; ///< 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.
|
||||
@@ -53,7 +53,7 @@ typedef struct __mavlink_gps_raw_int_t
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (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 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
|
||||
* @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
@@ -112,7 +112,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (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 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
|
||||
* @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
@@ -197,7 +197,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_encode_chan(uint8_t system_id, ui
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (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 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
|
||||
* @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
@@ -313,7 +313,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_get_eph(const mavlink_message_t*
|
||||
/**
|
||||
* @brief Get field epv from gps_raw_int message
|
||||
*
|
||||
* @return GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
|
||||
* @return GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_get_epv(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ typedef struct __mavlink_hil_gps_t
|
||||
int32_t lon; ///< Longitude (WGS84), in degrees * 1E7
|
||||
int32_t alt; ///< Altitude (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 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
|
||||
int16_t vn; ///< GPS velocity in cm/s in NORTH direction in earth-fixed NED frame
|
||||
int16_t ve; ///< GPS velocity in cm/s in EAST direction in earth-fixed NED frame
|
||||
@@ -59,7 +59,7 @@ typedef struct __mavlink_hil_gps_t
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (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 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
|
||||
* @param vn GPS velocity in cm/s in NORTH direction in earth-fixed NED frame
|
||||
* @param ve GPS velocity in cm/s in EAST direction in earth-fixed NED frame
|
||||
@@ -127,7 +127,7 @@ static inline uint16_t mavlink_msg_hil_gps_pack(uint8_t system_id, uint8_t compo
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (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 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
|
||||
* @param vn GPS velocity in cm/s in NORTH direction in earth-fixed NED frame
|
||||
* @param ve GPS velocity in cm/s in EAST direction in earth-fixed NED frame
|
||||
@@ -221,7 +221,7 @@ static inline uint16_t mavlink_msg_hil_gps_encode_chan(uint8_t system_id, uint8_
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (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 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
|
||||
* @param vn GPS velocity in cm/s in NORTH direction in earth-fixed NED frame
|
||||
* @param ve GPS velocity in cm/s in EAST direction in earth-fixed NED frame
|
||||
@@ -346,7 +346,7 @@ static inline uint16_t mavlink_msg_hil_gps_get_eph(const mavlink_message_t* msg)
|
||||
/**
|
||||
* @brief Get field epv from hil_gps message
|
||||
*
|
||||
* @return GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535
|
||||
* @return GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hil_gps_get_epv(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
// MESSAGE LOG_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_DATA 120
|
||||
|
||||
typedef struct __mavlink_log_data_t
|
||||
{
|
||||
uint32_t ofs; ///< Offset into the log
|
||||
uint16_t id; ///< Log id (from LOG_ENTRY reply)
|
||||
uint8_t count; ///< Number of bytes (zero for end of log)
|
||||
uint8_t data[90]; ///< log data
|
||||
} mavlink_log_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_DATA_LEN 97
|
||||
#define MAVLINK_MSG_ID_120_LEN 97
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_DATA_CRC 134
|
||||
#define MAVLINK_MSG_ID_120_CRC 134
|
||||
|
||||
#define MAVLINK_MSG_LOG_DATA_FIELD_DATA_LEN 90
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_DATA { \
|
||||
"LOG_DATA", \
|
||||
4, \
|
||||
{ { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \
|
||||
{ "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_log_data_t, id) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_log_data_t, count) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 90, 7, offsetof(mavlink_log_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a log_data message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count Number of bytes (zero for end of log)
|
||||
* @param data log data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint16_t(buf, 4, id);
|
||||
_mav_put_uint8_t(buf, 6, count);
|
||||
_mav_put_uint8_t_array(buf, 7, data, 90);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#else
|
||||
mavlink_log_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.id = id;
|
||||
packet.count = count;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_DATA;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count Number of bytes (zero for end of log)
|
||||
* @param data log data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t id,uint32_t ofs,uint8_t count,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint16_t(buf, 4, id);
|
||||
_mav_put_uint8_t(buf, 6, count);
|
||||
_mav_put_uint8_t_array(buf, 7, data, 90);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#else
|
||||
mavlink_log_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.id = id;
|
||||
packet.count = count;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_DATA;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_data_t* log_data)
|
||||
{
|
||||
return mavlink_msg_log_data_pack(system_id, component_id, msg, log_data->id, log_data->ofs, log_data->count, log_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_data_t* log_data)
|
||||
{
|
||||
return mavlink_msg_log_data_pack_chan(system_id, component_id, chan, msg, log_data->id, log_data->ofs, log_data->count, log_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count Number of bytes (zero for end of log)
|
||||
* @param data log data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_data_send(mavlink_channel_t chan, uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint16_t(buf, 4, id);
|
||||
_mav_put_uint8_t(buf, 6, count);
|
||||
_mav_put_uint8_t_array(buf, 7, data, 90);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_log_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.id = id;
|
||||
packet.count = count;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field id from log_data message
|
||||
*
|
||||
* @return Log id (from LOG_ENTRY reply)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ofs from log_data message
|
||||
*
|
||||
* @return Offset into the log
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_log_data_get_ofs(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field count from log_data message
|
||||
*
|
||||
* @return Number of bytes (zero for end of log)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_data_get_count(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from log_data message
|
||||
*
|
||||
* @return log data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_data_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 90, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_data_decode(const mavlink_message_t* msg, mavlink_log_data_t* log_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
log_data->ofs = mavlink_msg_log_data_get_ofs(msg);
|
||||
log_data->id = mavlink_msg_log_data_get_id(msg);
|
||||
log_data->count = mavlink_msg_log_data_get_count(msg);
|
||||
mavlink_msg_log_data_get_data(msg, log_data->data);
|
||||
#else
|
||||
memcpy(log_data, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_DATA_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
// MESSAGE LOG_ENTRY PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ENTRY 118
|
||||
|
||||
typedef struct __mavlink_log_entry_t
|
||||
{
|
||||
uint32_t time_utc; ///< UTC timestamp of log in seconds since 1970, or 0 if not available
|
||||
uint32_t size; ///< Size of the log (may be approximate) in bytes
|
||||
uint16_t id; ///< Log id
|
||||
uint16_t num_logs; ///< Total number of logs
|
||||
uint16_t last_log_num; ///< High log number
|
||||
} mavlink_log_entry_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ENTRY_LEN 14
|
||||
#define MAVLINK_MSG_ID_118_LEN 14
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ENTRY_CRC 56
|
||||
#define MAVLINK_MSG_ID_118_CRC 56
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_ENTRY { \
|
||||
"LOG_ENTRY", \
|
||||
5, \
|
||||
{ { "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \
|
||||
{ "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_entry_t, size) }, \
|
||||
{ "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_entry_t, id) }, \
|
||||
{ "num_logs", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_log_entry_t, num_logs) }, \
|
||||
{ "last_log_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_log_entry_t, last_log_num) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a log_entry message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param id Log id
|
||||
* @param num_logs Total number of logs
|
||||
* @param last_log_num High log number
|
||||
* @param time_utc UTC timestamp of log in seconds since 1970, or 0 if not available
|
||||
* @param size Size of the log (may be approximate) in bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_utc);
|
||||
_mav_put_uint32_t(buf, 4, size);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint16_t(buf, 10, num_logs);
|
||||
_mav_put_uint16_t(buf, 12, last_log_num);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#else
|
||||
mavlink_log_entry_t packet;
|
||||
packet.time_utc = time_utc;
|
||||
packet.size = size;
|
||||
packet.id = id;
|
||||
packet.num_logs = num_logs;
|
||||
packet.last_log_num = last_log_num;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_ENTRY;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_entry message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param id Log id
|
||||
* @param num_logs Total number of logs
|
||||
* @param last_log_num High log number
|
||||
* @param time_utc UTC timestamp of log in seconds since 1970, or 0 if not available
|
||||
* @param size Size of the log (may be approximate) in bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t id,uint16_t num_logs,uint16_t last_log_num,uint32_t time_utc,uint32_t size)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_utc);
|
||||
_mav_put_uint32_t(buf, 4, size);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint16_t(buf, 10, num_logs);
|
||||
_mav_put_uint16_t(buf, 12, last_log_num);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#else
|
||||
mavlink_log_entry_t packet;
|
||||
packet.time_utc = time_utc;
|
||||
packet.size = size;
|
||||
packet.id = id;
|
||||
packet.num_logs = num_logs;
|
||||
packet.last_log_num = last_log_num;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_ENTRY;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_entry struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_entry C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_entry_t* log_entry)
|
||||
{
|
||||
return mavlink_msg_log_entry_pack(system_id, component_id, msg, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_entry struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_entry C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_entry_t* log_entry)
|
||||
{
|
||||
return mavlink_msg_log_entry_pack_chan(system_id, component_id, chan, msg, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_entry message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param id Log id
|
||||
* @param num_logs Total number of logs
|
||||
* @param last_log_num High log number
|
||||
* @param time_utc UTC timestamp of log in seconds since 1970, or 0 if not available
|
||||
* @param size Size of the log (may be approximate) in bytes
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_entry_send(mavlink_channel_t chan, uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_utc);
|
||||
_mav_put_uint32_t(buf, 4, size);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint16_t(buf, 10, num_logs);
|
||||
_mav_put_uint16_t(buf, 12, last_log_num);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_log_entry_t packet;
|
||||
packet.time_utc = time_utc;
|
||||
packet.size = size;
|
||||
packet.id = id;
|
||||
packet.num_logs = num_logs;
|
||||
packet.last_log_num = last_log_num;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)&packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)&packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_ENTRY UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field id from log_entry message
|
||||
*
|
||||
* @return Log id
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field num_logs from log_entry message
|
||||
*
|
||||
* @return Total number of logs
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_get_num_logs(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field last_log_num from log_entry message
|
||||
*
|
||||
* @return High log number
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_entry_get_last_log_num(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_utc from log_entry message
|
||||
*
|
||||
* @return UTC timestamp of log in seconds since 1970, or 0 if not available
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_log_entry_get_time_utc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field size from log_entry message
|
||||
*
|
||||
* @return Size of the log (may be approximate) in bytes
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_log_entry_get_size(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_entry message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_entry C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_entry_decode(const mavlink_message_t* msg, mavlink_log_entry_t* log_entry)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
log_entry->time_utc = mavlink_msg_log_entry_get_time_utc(msg);
|
||||
log_entry->size = mavlink_msg_log_entry_get_size(msg);
|
||||
log_entry->id = mavlink_msg_log_entry_get_id(msg);
|
||||
log_entry->num_logs = mavlink_msg_log_entry_get_num_logs(msg);
|
||||
log_entry->last_log_num = mavlink_msg_log_entry_get_last_log_num(msg);
|
||||
#else
|
||||
memcpy(log_entry, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_ENTRY_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
// MESSAGE LOG_ERASE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ERASE 121
|
||||
|
||||
typedef struct __mavlink_log_erase_t
|
||||
{
|
||||
uint8_t target_system; ///< System ID
|
||||
uint8_t target_component; ///< Component ID
|
||||
} mavlink_log_erase_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ERASE_LEN 2
|
||||
#define MAVLINK_MSG_ID_121_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_ERASE_CRC 237
|
||||
#define MAVLINK_MSG_ID_121_CRC 237
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_ERASE { \
|
||||
"LOG_ERASE", \
|
||||
2, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_erase_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_erase_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a log_erase message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_erase_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#else
|
||||
mavlink_log_erase_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_ERASE;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_erase message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_erase_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#else
|
||||
mavlink_log_erase_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_ERASE;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_erase struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_erase C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_erase_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_erase_t* log_erase)
|
||||
{
|
||||
return mavlink_msg_log_erase_pack(system_id, component_id, msg, log_erase->target_system, log_erase->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_erase struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_erase C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_erase_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_erase_t* log_erase)
|
||||
{
|
||||
return mavlink_msg_log_erase_pack_chan(system_id, component_id, chan, msg, log_erase->target_system, log_erase->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_erase message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_erase_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_log_erase_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)&packet, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)&packet, MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_ERASE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from log_erase message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_erase_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from log_erase message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_erase_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_erase message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_erase C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_erase_decode(const mavlink_message_t* msg, mavlink_log_erase_t* log_erase)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
log_erase->target_system = mavlink_msg_log_erase_get_target_system(msg);
|
||||
log_erase->target_component = mavlink_msg_log_erase_get_target_component(msg);
|
||||
#else
|
||||
memcpy(log_erase, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_ERASE_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
// MESSAGE LOG_REQUEST_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_DATA 119
|
||||
|
||||
typedef struct __mavlink_log_request_data_t
|
||||
{
|
||||
uint32_t ofs; ///< Offset into the log
|
||||
uint32_t count; ///< Number of bytes
|
||||
uint16_t id; ///< Log id (from LOG_ENTRY reply)
|
||||
uint8_t target_system; ///< System ID
|
||||
uint8_t target_component; ///< Component ID
|
||||
} mavlink_log_request_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN 12
|
||||
#define MAVLINK_MSG_ID_119_LEN 12
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC 116
|
||||
#define MAVLINK_MSG_ID_119_CRC 116
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA { \
|
||||
"LOG_REQUEST_DATA", \
|
||||
5, \
|
||||
{ { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_request_data_t, count) }, \
|
||||
{ "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_request_data_t, id) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_log_request_data_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_log_request_data_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_data message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count Number of bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint32_t(buf, 4, count);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint8_t(buf, 10, target_system);
|
||||
_mav_put_uint8_t(buf, 11, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#else
|
||||
mavlink_log_request_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.count = count;
|
||||
packet.id = id;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_DATA;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count Number of bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t id,uint32_t ofs,uint32_t count)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint32_t(buf, 4, count);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint8_t(buf, 10, target_system);
|
||||
_mav_put_uint8_t(buf, 11, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#else
|
||||
mavlink_log_request_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.count = count;
|
||||
packet.id = id;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_DATA;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_data_t* log_request_data)
|
||||
{
|
||||
return mavlink_msg_log_request_data_pack(system_id, component_id, msg, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_data_t* log_request_data)
|
||||
{
|
||||
return mavlink_msg_log_request_data_pack_chan(system_id, component_id, chan, msg, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_request_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param id Log id (from LOG_ENTRY reply)
|
||||
* @param ofs Offset into the log
|
||||
* @param count Number of bytes
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_request_data_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ofs);
|
||||
_mav_put_uint32_t(buf, 4, count);
|
||||
_mav_put_uint16_t(buf, 8, id);
|
||||
_mav_put_uint8_t(buf, 10, target_system);
|
||||
_mav_put_uint8_t(buf, 11, target_component);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_log_request_data_t packet;
|
||||
packet.ofs = ofs;
|
||||
packet.count = count;
|
||||
packet.id = id;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_REQUEST_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from log_request_data message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_data_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from log_request_data message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_data_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field id from log_request_data message
|
||||
*
|
||||
* @return Log id (from LOG_ENTRY reply)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_data_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ofs from log_request_data message
|
||||
*
|
||||
* @return Offset into the log
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_log_request_data_get_ofs(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field count from log_request_data message
|
||||
*
|
||||
* @return Number of bytes
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_log_request_data_get_count(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_request_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_request_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_data_decode(const mavlink_message_t* msg, mavlink_log_request_data_t* log_request_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
log_request_data->ofs = mavlink_msg_log_request_data_get_ofs(msg);
|
||||
log_request_data->count = mavlink_msg_log_request_data_get_count(msg);
|
||||
log_request_data->id = mavlink_msg_log_request_data_get_id(msg);
|
||||
log_request_data->target_system = mavlink_msg_log_request_data_get_target_system(msg);
|
||||
log_request_data->target_component = mavlink_msg_log_request_data_get_target_component(msg);
|
||||
#else
|
||||
memcpy(log_request_data, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
// MESSAGE LOG_REQUEST_END PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_END 122
|
||||
|
||||
typedef struct __mavlink_log_request_end_t
|
||||
{
|
||||
uint8_t target_system; ///< System ID
|
||||
uint8_t target_component; ///< Component ID
|
||||
} mavlink_log_request_end_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_END_LEN 2
|
||||
#define MAVLINK_MSG_ID_122_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_END_CRC 203
|
||||
#define MAVLINK_MSG_ID_122_CRC 203
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_END { \
|
||||
"LOG_REQUEST_END", \
|
||||
2, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_request_end_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_request_end_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_end message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_end_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#else
|
||||
mavlink_log_request_end_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_END;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_end message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_end_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#else
|
||||
mavlink_log_request_end_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_END;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_end struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_end C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_end_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_end_t* log_request_end)
|
||||
{
|
||||
return mavlink_msg_log_request_end_pack(system_id, component_id, msg, log_request_end->target_system, log_request_end->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_end struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_end C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_end_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_end_t* log_request_end)
|
||||
{
|
||||
return mavlink_msg_log_request_end_pack_chan(system_id, component_id, chan, msg, log_request_end->target_system, log_request_end->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_request_end message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_request_end_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_log_request_end_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_REQUEST_END UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from log_request_end message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_end_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from log_request_end message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_end_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_request_end message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_request_end C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_end_decode(const mavlink_message_t* msg, mavlink_log_request_end_t* log_request_end)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
log_request_end->target_system = mavlink_msg_log_request_end_get_target_system(msg);
|
||||
log_request_end->target_component = mavlink_msg_log_request_end_get_target_component(msg);
|
||||
#else
|
||||
memcpy(log_request_end, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_REQUEST_END_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
// MESSAGE LOG_REQUEST_LIST PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_LIST 117
|
||||
|
||||
typedef struct __mavlink_log_request_list_t
|
||||
{
|
||||
uint16_t start; ///< First log id (0 for first available)
|
||||
uint16_t end; ///< Last log id (0xffff for last available)
|
||||
uint8_t target_system; ///< System ID
|
||||
uint8_t target_component; ///< Component ID
|
||||
} mavlink_log_request_list_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN 6
|
||||
#define MAVLINK_MSG_ID_117_LEN 6
|
||||
|
||||
#define MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC 128
|
||||
#define MAVLINK_MSG_ID_117_CRC 128
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST { \
|
||||
"LOG_REQUEST_LIST", \
|
||||
4, \
|
||||
{ { "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \
|
||||
{ "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_log_request_list_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_list message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start First log id (0 for first available)
|
||||
* @param end Last log id (0xffff for last available)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN];
|
||||
_mav_put_uint16_t(buf, 0, start);
|
||||
_mav_put_uint16_t(buf, 2, end);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#else
|
||||
mavlink_log_request_list_t packet;
|
||||
packet.start = start;
|
||||
packet.end = end;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_LIST;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a log_request_list message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start First log id (0 for first available)
|
||||
* @param end Last log id (0xffff for last available)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t start,uint16_t end)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN];
|
||||
_mav_put_uint16_t(buf, 0, start);
|
||||
_mav_put_uint16_t(buf, 2, end);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#else
|
||||
mavlink_log_request_list_t packet;
|
||||
packet.start = start;
|
||||
packet.end = end;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_LIST;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_list struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_list C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_list_t* log_request_list)
|
||||
{
|
||||
return mavlink_msg_log_request_list_pack(system_id, component_id, msg, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a log_request_list struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param log_request_list C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_list_t* log_request_list)
|
||||
{
|
||||
return mavlink_msg_log_request_list_pack_chan(system_id, component_id, chan, msg, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a log_request_list message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param start First log id (0 for first available)
|
||||
* @param end Last log id (0xffff for last available)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_log_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN];
|
||||
_mav_put_uint16_t(buf, 0, start);
|
||||
_mav_put_uint16_t(buf, 2, end);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_log_request_list_t packet;
|
||||
packet.start = start;
|
||||
packet.end = end;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOG_REQUEST_LIST UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from log_request_list message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_list_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from log_request_list message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_log_request_list_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field start from log_request_list message
|
||||
*
|
||||
* @return First log id (0 for first available)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_get_start(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field end from log_request_list message
|
||||
*
|
||||
* @return Last log id (0xffff for last available)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_log_request_list_get_end(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a log_request_list message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param log_request_list C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_log_request_list_decode(const mavlink_message_t* msg, mavlink_log_request_list_t* log_request_list)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
log_request_list->start = mavlink_msg_log_request_list_get_start(msg);
|
||||
log_request_list->end = mavlink_msg_log_request_list_get_end(msg);
|
||||
log_request_list->target_system = mavlink_msg_log_request_list_get_target_system(msg);
|
||||
log_request_list->target_component = mavlink_msg_log_request_list_get_target_component(msg);
|
||||
#else
|
||||
memcpy(log_request_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
typedef struct __mavlink_mission_item_t
|
||||
{
|
||||
float param1; ///< PARAM1 / For NAV command MISSIONs: Radius in which the MISSION is accepted as reached, in meters
|
||||
float param2; ///< PARAM2 / For NAV command MISSIONs: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds
|
||||
float param3; ///< PARAM3 / For LOITER command MISSIONs: Orbit to circle around the MISSION, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise.
|
||||
float param4; ///< PARAM4 / For NAV and LOITER command MISSIONs: Yaw orientation in degrees, [0..360] 0 = NORTH
|
||||
float param1; ///< PARAM1, see MAV_CMD enum
|
||||
float param2; ///< PARAM2, see MAV_CMD enum
|
||||
float param3; ///< PARAM3, see MAV_CMD enum
|
||||
float param4; ///< PARAM4, see MAV_CMD enum
|
||||
float x; ///< PARAM5 / local: x position, global: latitude
|
||||
float y; ///< PARAM6 / y position: global: longitude
|
||||
float z; ///< PARAM7 / z position: global: altitude
|
||||
float z; ///< PARAM7 / z position: global: altitude (relative or absolute, depending on frame.
|
||||
uint16_t seq; ///< Sequence
|
||||
uint16_t command; ///< The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
|
||||
uint8_t target_system; ///< System ID
|
||||
@@ -62,13 +62,13 @@ typedef struct __mavlink_mission_item_t
|
||||
* @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue autocontinue to next wp
|
||||
* @param param1 PARAM1 / For NAV command MISSIONs: Radius in which the MISSION is accepted as reached, in meters
|
||||
* @param param2 PARAM2 / For NAV command MISSIONs: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds
|
||||
* @param param3 PARAM3 / For LOITER command MISSIONs: Orbit to circle around the MISSION, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise.
|
||||
* @param param4 PARAM4 / For NAV and LOITER command MISSIONs: Yaw orientation in degrees, [0..360] 0 = NORTH
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position, global: latitude
|
||||
* @param y PARAM6 / y position: global: longitude
|
||||
* @param z PARAM7 / z position: global: altitude
|
||||
* @param z PARAM7 / z position: global: altitude (relative or absolute, depending on frame.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
@@ -133,13 +133,13 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t
|
||||
* @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue autocontinue to next wp
|
||||
* @param param1 PARAM1 / For NAV command MISSIONs: Radius in which the MISSION is accepted as reached, in meters
|
||||
* @param param2 PARAM2 / For NAV command MISSIONs: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds
|
||||
* @param param3 PARAM3 / For LOITER command MISSIONs: Orbit to circle around the MISSION, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise.
|
||||
* @param param4 PARAM4 / For NAV and LOITER command MISSIONs: Yaw orientation in degrees, [0..360] 0 = NORTH
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position, global: latitude
|
||||
* @param y PARAM6 / y position: global: longitude
|
||||
* @param z PARAM7 / z position: global: altitude
|
||||
* @param z PARAM7 / z position: global: altitude (relative or absolute, depending on frame.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
@@ -230,13 +230,13 @@ static inline uint16_t mavlink_msg_mission_item_encode_chan(uint8_t system_id, u
|
||||
* @param command The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue autocontinue to next wp
|
||||
* @param param1 PARAM1 / For NAV command MISSIONs: Radius in which the MISSION is accepted as reached, in meters
|
||||
* @param param2 PARAM2 / For NAV command MISSIONs: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds
|
||||
* @param param3 PARAM3 / For LOITER command MISSIONs: Orbit to circle around the MISSION, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise.
|
||||
* @param param4 PARAM4 / For NAV and LOITER command MISSIONs: Yaw orientation in degrees, [0..360] 0 = NORTH
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position, global: latitude
|
||||
* @param y PARAM6 / y position: global: longitude
|
||||
* @param z PARAM7 / z position: global: altitude
|
||||
* @param z PARAM7 / z position: global: altitude (relative or absolute, depending on frame.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
@@ -367,7 +367,7 @@ static inline uint8_t mavlink_msg_mission_item_get_autocontinue(const mavlink_me
|
||||
/**
|
||||
* @brief Get field param1 from mission_item message
|
||||
*
|
||||
* @return PARAM1 / For NAV command MISSIONs: Radius in which the MISSION is accepted as reached, in meters
|
||||
* @return PARAM1, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_param1(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -377,7 +377,7 @@ static inline float mavlink_msg_mission_item_get_param1(const mavlink_message_t*
|
||||
/**
|
||||
* @brief Get field param2 from mission_item message
|
||||
*
|
||||
* @return PARAM2 / For NAV command MISSIONs: Time that the MAV should stay inside the PARAM1 radius before advancing, in milliseconds
|
||||
* @return PARAM2, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_param2(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -387,7 +387,7 @@ static inline float mavlink_msg_mission_item_get_param2(const mavlink_message_t*
|
||||
/**
|
||||
* @brief Get field param3 from mission_item message
|
||||
*
|
||||
* @return PARAM3 / For LOITER command MISSIONs: Orbit to circle around the MISSION, in meters. If positive the orbit direction should be clockwise, if negative the orbit direction should be counter-clockwise.
|
||||
* @return PARAM3, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_param3(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -397,7 +397,7 @@ static inline float mavlink_msg_mission_item_get_param3(const mavlink_message_t*
|
||||
/**
|
||||
* @brief Get field param4 from mission_item message
|
||||
*
|
||||
* @return PARAM4 / For NAV and LOITER command MISSIONs: Yaw orientation in degrees, [0..360] 0 = NORTH
|
||||
* @return PARAM4, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_param4(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -427,7 +427,7 @@ static inline float mavlink_msg_mission_item_get_y(const mavlink_message_t* msg)
|
||||
/**
|
||||
* @brief Get field z from mission_item message
|
||||
*
|
||||
* @return PARAM7 / z position: global: altitude
|
||||
* @return PARAM7 / z position: global: altitude (relative or absolute, depending on frame.
|
||||
*/
|
||||
static inline float mavlink_msg_mission_item_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,375 @@
|
||||
// MESSAGE SCALED_IMU2 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SCALED_IMU2 116
|
||||
|
||||
typedef struct __mavlink_scaled_imu2_t
|
||||
{
|
||||
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
|
||||
int16_t xacc; ///< X acceleration (mg)
|
||||
int16_t yacc; ///< Y acceleration (mg)
|
||||
int16_t zacc; ///< Z acceleration (mg)
|
||||
int16_t xgyro; ///< Angular speed around X axis (millirad /sec)
|
||||
int16_t ygyro; ///< Angular speed around Y axis (millirad /sec)
|
||||
int16_t zgyro; ///< Angular speed around Z axis (millirad /sec)
|
||||
int16_t xmag; ///< X Magnetic field (milli tesla)
|
||||
int16_t ymag; ///< Y Magnetic field (milli tesla)
|
||||
int16_t zmag; ///< Z Magnetic field (milli tesla)
|
||||
} mavlink_scaled_imu2_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SCALED_IMU2_LEN 22
|
||||
#define MAVLINK_MSG_ID_116_LEN 22
|
||||
|
||||
#define MAVLINK_MSG_ID_SCALED_IMU2_CRC 76
|
||||
#define MAVLINK_MSG_ID_116_CRC 76
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_SCALED_IMU2 { \
|
||||
"SCALED_IMU2", \
|
||||
10, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu2_t, time_boot_ms) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu2_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu2_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu2_t, zacc) }, \
|
||||
{ "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_scaled_imu2_t, xgyro) }, \
|
||||
{ "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_imu2_t, ygyro) }, \
|
||||
{ "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_scaled_imu2_t, zgyro) }, \
|
||||
{ "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_imu2_t, xmag) }, \
|
||||
{ "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_scaled_imu2_t, ymag) }, \
|
||||
{ "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu2_t, zmag) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a scaled_imu2 message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param xacc X acceleration (mg)
|
||||
* @param yacc Y acceleration (mg)
|
||||
* @param zacc Z acceleration (mg)
|
||||
* @param xgyro Angular speed around X axis (millirad /sec)
|
||||
* @param ygyro Angular speed around Y axis (millirad /sec)
|
||||
* @param zgyro Angular speed around Z axis (millirad /sec)
|
||||
* @param xmag X Magnetic field (milli tesla)
|
||||
* @param ymag Y Magnetic field (milli tesla)
|
||||
* @param zmag Z Magnetic field (milli tesla)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_scaled_imu2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int16_t(buf, 4, xacc);
|
||||
_mav_put_int16_t(buf, 6, yacc);
|
||||
_mav_put_int16_t(buf, 8, zacc);
|
||||
_mav_put_int16_t(buf, 10, xgyro);
|
||||
_mav_put_int16_t(buf, 12, ygyro);
|
||||
_mav_put_int16_t(buf, 14, zgyro);
|
||||
_mav_put_int16_t(buf, 16, xmag);
|
||||
_mav_put_int16_t(buf, 18, ymag);
|
||||
_mav_put_int16_t(buf, 20, zmag);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
|
||||
#else
|
||||
mavlink_scaled_imu2_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SCALED_IMU2;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a scaled_imu2 message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param xacc X acceleration (mg)
|
||||
* @param yacc Y acceleration (mg)
|
||||
* @param zacc Z acceleration (mg)
|
||||
* @param xgyro Angular speed around X axis (millirad /sec)
|
||||
* @param ygyro Angular speed around Y axis (millirad /sec)
|
||||
* @param zgyro Angular speed around Z axis (millirad /sec)
|
||||
* @param xmag X Magnetic field (milli tesla)
|
||||
* @param ymag Y Magnetic field (milli tesla)
|
||||
* @param zmag Z Magnetic field (milli tesla)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_scaled_imu2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int16_t(buf, 4, xacc);
|
||||
_mav_put_int16_t(buf, 6, yacc);
|
||||
_mav_put_int16_t(buf, 8, zacc);
|
||||
_mav_put_int16_t(buf, 10, xgyro);
|
||||
_mav_put_int16_t(buf, 12, ygyro);
|
||||
_mav_put_int16_t(buf, 14, zgyro);
|
||||
_mav_put_int16_t(buf, 16, xmag);
|
||||
_mav_put_int16_t(buf, 18, ymag);
|
||||
_mav_put_int16_t(buf, 20, zmag);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
|
||||
#else
|
||||
mavlink_scaled_imu2_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SCALED_IMU2;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a scaled_imu2 struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param scaled_imu2 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_scaled_imu2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_imu2_t* scaled_imu2)
|
||||
{
|
||||
return mavlink_msg_scaled_imu2_pack(system_id, component_id, msg, scaled_imu2->time_boot_ms, scaled_imu2->xacc, scaled_imu2->yacc, scaled_imu2->zacc, scaled_imu2->xgyro, scaled_imu2->ygyro, scaled_imu2->zgyro, scaled_imu2->xmag, scaled_imu2->ymag, scaled_imu2->zmag);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a scaled_imu2 struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param scaled_imu2 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_scaled_imu2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_imu2_t* scaled_imu2)
|
||||
{
|
||||
return mavlink_msg_scaled_imu2_pack_chan(system_id, component_id, chan, msg, scaled_imu2->time_boot_ms, scaled_imu2->xacc, scaled_imu2->yacc, scaled_imu2->zacc, scaled_imu2->xgyro, scaled_imu2->ygyro, scaled_imu2->zgyro, scaled_imu2->xmag, scaled_imu2->ymag, scaled_imu2->zmag);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a scaled_imu2 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param xacc X acceleration (mg)
|
||||
* @param yacc Y acceleration (mg)
|
||||
* @param zacc Z acceleration (mg)
|
||||
* @param xgyro Angular speed around X axis (millirad /sec)
|
||||
* @param ygyro Angular speed around Y axis (millirad /sec)
|
||||
* @param zgyro Angular speed around Z axis (millirad /sec)
|
||||
* @param xmag X Magnetic field (milli tesla)
|
||||
* @param ymag Y Magnetic field (milli tesla)
|
||||
* @param zmag Z Magnetic field (milli tesla)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_scaled_imu2_send(mavlink_channel_t chan, uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int16_t(buf, 4, xacc);
|
||||
_mav_put_int16_t(buf, 6, yacc);
|
||||
_mav_put_int16_t(buf, 8, zacc);
|
||||
_mav_put_int16_t(buf, 10, xgyro);
|
||||
_mav_put_int16_t(buf, 12, ygyro);
|
||||
_mav_put_int16_t(buf, 14, zgyro);
|
||||
_mav_put_int16_t(buf, 16, xmag);
|
||||
_mav_put_int16_t(buf, 18, ymag);
|
||||
_mav_put_int16_t(buf, 20, zmag);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_scaled_imu2_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SCALED_IMU2 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from scaled_imu2 message
|
||||
*
|
||||
* @return Timestamp (milliseconds since system boot)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_scaled_imu2_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xacc from scaled_imu2 message
|
||||
*
|
||||
* @return X acceleration (mg)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_scaled_imu2_get_xacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yacc from scaled_imu2 message
|
||||
*
|
||||
* @return Y acceleration (mg)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_scaled_imu2_get_yacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zacc from scaled_imu2 message
|
||||
*
|
||||
* @return Z acceleration (mg)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_scaled_imu2_get_zacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xgyro from scaled_imu2 message
|
||||
*
|
||||
* @return Angular speed around X axis (millirad /sec)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_scaled_imu2_get_xgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ygyro from scaled_imu2 message
|
||||
*
|
||||
* @return Angular speed around Y axis (millirad /sec)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_scaled_imu2_get_ygyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zgyro from scaled_imu2 message
|
||||
*
|
||||
* @return Angular speed around Z axis (millirad /sec)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_scaled_imu2_get_zgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xmag from scaled_imu2 message
|
||||
*
|
||||
* @return X Magnetic field (milli tesla)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_scaled_imu2_get_xmag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ymag from scaled_imu2 message
|
||||
*
|
||||
* @return Y Magnetic field (milli tesla)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_scaled_imu2_get_ymag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zmag from scaled_imu2 message
|
||||
*
|
||||
* @return Z Magnetic field (milli tesla)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_scaled_imu2_get_zmag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a scaled_imu2 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param scaled_imu2 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_scaled_imu2_decode(const mavlink_message_t* msg, mavlink_scaled_imu2_t* scaled_imu2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
scaled_imu2->time_boot_ms = mavlink_msg_scaled_imu2_get_time_boot_ms(msg);
|
||||
scaled_imu2->xacc = mavlink_msg_scaled_imu2_get_xacc(msg);
|
||||
scaled_imu2->yacc = mavlink_msg_scaled_imu2_get_yacc(msg);
|
||||
scaled_imu2->zacc = mavlink_msg_scaled_imu2_get_zacc(msg);
|
||||
scaled_imu2->xgyro = mavlink_msg_scaled_imu2_get_xgyro(msg);
|
||||
scaled_imu2->ygyro = mavlink_msg_scaled_imu2_get_ygyro(msg);
|
||||
scaled_imu2->zgyro = mavlink_msg_scaled_imu2_get_zgyro(msg);
|
||||
scaled_imu2->xmag = mavlink_msg_scaled_imu2_get_xmag(msg);
|
||||
scaled_imu2->ymag = mavlink_msg_scaled_imu2_get_ymag(msg);
|
||||
scaled_imu2->zmag = mavlink_msg_scaled_imu2_get_zmag(msg);
|
||||
#else
|
||||
memcpy(scaled_imu2, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SCALED_IMU2_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
typedef struct __mavlink_sys_status_t
|
||||
{
|
||||
uint32_t onboard_control_sensors_present; ///< Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
uint32_t onboard_control_sensors_enabled; ///< Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
uint32_t onboard_control_sensors_health; ///< Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
uint32_t onboard_control_sensors_present; ///< Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
uint32_t onboard_control_sensors_enabled; ///< Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
uint32_t onboard_control_sensors_health; ///< Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
uint16_t load; ///< Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
|
||||
uint16_t voltage_battery; ///< Battery voltage, in millivolts (1 = 1 millivolt)
|
||||
int16_t current_battery; ///< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
@@ -53,9 +53,9 @@ typedef struct __mavlink_sys_status_t
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @param onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
* @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
* @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
* @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
|
||||
* @param voltage_battery Battery voltage, in millivolts (1 = 1 millivolt)
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
@@ -121,9 +121,9 @@ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t co
|
||||
* @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 onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @param onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
* @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
* @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
* @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
|
||||
* @param voltage_battery Battery voltage, in millivolts (1 = 1 millivolt)
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
@@ -215,9 +215,9 @@ static inline uint16_t mavlink_msg_sys_status_encode_chan(uint8_t system_id, uin
|
||||
* @brief Send a sys_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @param onboard_control_sensors_present Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
* @param onboard_control_sensors_enabled Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
* @param onboard_control_sensors_health Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
* @param load Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
|
||||
* @param voltage_battery Battery voltage, in millivolts (1 = 1 millivolt)
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
@@ -286,7 +286,7 @@ static inline void mavlink_msg_sys_status_send(mavlink_channel_t chan, uint32_t
|
||||
/**
|
||||
* @brief Get field onboard_control_sensors_present from sys_status message
|
||||
*
|
||||
* @return Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @return Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_present(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -296,7 +296,7 @@ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_presen
|
||||
/**
|
||||
* @brief Get field onboard_control_sensors_enabled from sys_status message
|
||||
*
|
||||
* @return Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @return Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_enabled(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -306,7 +306,7 @@ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_enable
|
||||
/**
|
||||
* @brief Get field onboard_control_sensors_health from sys_status message
|
||||
*
|
||||
* @return Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices: 0: 3D gyro, 1: 3D acc, 2: 3D mag, 3: absolute pressure, 4: differential pressure, 5: GPS, 6: optical flow, 7: computer vision position, 8: laser based position, 9: external ground-truth (Vicon or Leica). Controllers: 10: 3D angular rate control 11: attitude stabilization, 12: yaw position, 13: z/altitude control, 14: x/y position control, 15: motor outputs / control
|
||||
* @return Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_health(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Tue Sep 10 23:50:05 2013"
|
||||
#define MAVLINK_BUILD_DATE "Mon Dec 16 08:59:18 2013"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 254
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -31,7 +31,7 @@ static void mavlink_test_flexifunction_set(uint8_t system_id, uint8_t component_
|
||||
uint16_t i;
|
||||
mavlink_flexifunction_set_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
}72,
|
||||
};
|
||||
mavlink_flexifunction_set_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -76,9 +76,9 @@ static void mavlink_test_flexifunction_read_req(uint8_t system_id, uint8_t compo
|
||||
uint16_t i;
|
||||
mavlink_flexifunction_read_req_t packet_in = {
|
||||
17235,
|
||||
17339,
|
||||
17,
|
||||
84,
|
||||
}17339,
|
||||
}17,
|
||||
}84,
|
||||
};
|
||||
mavlink_flexifunction_read_req_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -125,12 +125,12 @@ static void mavlink_test_flexifunction_buffer_function(uint8_t system_id, uint8_
|
||||
uint16_t i;
|
||||
mavlink_flexifunction_buffer_function_t packet_in = {
|
||||
17235,
|
||||
17339,
|
||||
17443,
|
||||
17547,
|
||||
29,
|
||||
96,
|
||||
{ 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210 },
|
||||
}17339,
|
||||
}17443,
|
||||
}17547,
|
||||
}29,
|
||||
}96,
|
||||
}{ 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210 },
|
||||
};
|
||||
mavlink_flexifunction_buffer_function_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -180,9 +180,9 @@ static void mavlink_test_flexifunction_buffer_function_ack(uint8_t system_id, ui
|
||||
uint16_t i;
|
||||
mavlink_flexifunction_buffer_function_ack_t packet_in = {
|
||||
17235,
|
||||
17339,
|
||||
17,
|
||||
84,
|
||||
}17339,
|
||||
}17,
|
||||
}84,
|
||||
};
|
||||
mavlink_flexifunction_buffer_function_ack_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -229,11 +229,11 @@ static void mavlink_test_flexifunction_directory(uint8_t system_id, uint8_t comp
|
||||
uint16_t i;
|
||||
mavlink_flexifunction_directory_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
139,
|
||||
206,
|
||||
17,
|
||||
{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131 },
|
||||
}72,
|
||||
}139,
|
||||
}206,
|
||||
}17,
|
||||
}{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131 },
|
||||
};
|
||||
mavlink_flexifunction_directory_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -282,11 +282,11 @@ static void mavlink_test_flexifunction_directory_ack(uint8_t system_id, uint8_t
|
||||
uint16_t i;
|
||||
mavlink_flexifunction_directory_ack_t packet_in = {
|
||||
17235,
|
||||
139,
|
||||
206,
|
||||
17,
|
||||
84,
|
||||
151,
|
||||
}139,
|
||||
}206,
|
||||
}17,
|
||||
}84,
|
||||
}151,
|
||||
};
|
||||
mavlink_flexifunction_directory_ack_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -335,8 +335,8 @@ static void mavlink_test_flexifunction_command(uint8_t system_id, uint8_t compon
|
||||
uint16_t i;
|
||||
mavlink_flexifunction_command_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
139,
|
||||
}72,
|
||||
}139,
|
||||
};
|
||||
mavlink_flexifunction_command_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -382,7 +382,7 @@ static void mavlink_test_flexifunction_command_ack(uint8_t system_id, uint8_t co
|
||||
uint16_t i;
|
||||
mavlink_flexifunction_command_ack_t packet_in = {
|
||||
17235,
|
||||
17339,
|
||||
}17339,
|
||||
};
|
||||
mavlink_flexifunction_command_ack_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -427,33 +427,33 @@ static void mavlink_test_serial_udb_extra_f2_a(uint8_t system_id, uint8_t compon
|
||||
uint16_t i;
|
||||
mavlink_serial_udb_extra_f2_a_t packet_in = {
|
||||
963497464,
|
||||
963497672,
|
||||
963497880,
|
||||
963498088,
|
||||
18067,
|
||||
18171,
|
||||
18275,
|
||||
18379,
|
||||
18483,
|
||||
18587,
|
||||
18691,
|
||||
18795,
|
||||
18899,
|
||||
19003,
|
||||
19107,
|
||||
19211,
|
||||
19315,
|
||||
19419,
|
||||
19523,
|
||||
19627,
|
||||
19731,
|
||||
19835,
|
||||
19939,
|
||||
20043,
|
||||
20147,
|
||||
20251,
|
||||
20355,
|
||||
63,
|
||||
}963497672,
|
||||
}963497880,
|
||||
}963498088,
|
||||
}18067,
|
||||
}18171,
|
||||
}18275,
|
||||
}18379,
|
||||
}18483,
|
||||
}18587,
|
||||
}18691,
|
||||
}18795,
|
||||
}18899,
|
||||
}19003,
|
||||
}19107,
|
||||
}19211,
|
||||
}19315,
|
||||
}19419,
|
||||
}19523,
|
||||
}19627,
|
||||
}19731,
|
||||
}19835,
|
||||
}19939,
|
||||
}20043,
|
||||
}20147,
|
||||
}20251,
|
||||
}20355,
|
||||
}63,
|
||||
};
|
||||
mavlink_serial_udb_extra_f2_a_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -524,38 +524,38 @@ static void mavlink_test_serial_udb_extra_f2_b(uint8_t system_id, uint8_t compon
|
||||
uint16_t i;
|
||||
mavlink_serial_udb_extra_f2_b_t packet_in = {
|
||||
963497464,
|
||||
963497672,
|
||||
17651,
|
||||
17755,
|
||||
17859,
|
||||
17963,
|
||||
18067,
|
||||
18171,
|
||||
18275,
|
||||
18379,
|
||||
18483,
|
||||
18587,
|
||||
18691,
|
||||
18795,
|
||||
18899,
|
||||
19003,
|
||||
19107,
|
||||
19211,
|
||||
19315,
|
||||
19419,
|
||||
19523,
|
||||
19627,
|
||||
19731,
|
||||
19835,
|
||||
19939,
|
||||
20043,
|
||||
20147,
|
||||
20251,
|
||||
20355,
|
||||
20459,
|
||||
20563,
|
||||
20667,
|
||||
20771,
|
||||
}963497672,
|
||||
}17651,
|
||||
}17755,
|
||||
}17859,
|
||||
}17963,
|
||||
}18067,
|
||||
}18171,
|
||||
}18275,
|
||||
}18379,
|
||||
}18483,
|
||||
}18587,
|
||||
}18691,
|
||||
}18795,
|
||||
}18899,
|
||||
}19003,
|
||||
}19107,
|
||||
}19211,
|
||||
}19315,
|
||||
}19419,
|
||||
}19523,
|
||||
}19627,
|
||||
}19731,
|
||||
}19835,
|
||||
}19939,
|
||||
}20043,
|
||||
}20147,
|
||||
}20251,
|
||||
}20355,
|
||||
}20459,
|
||||
}20563,
|
||||
}20667,
|
||||
}20771,
|
||||
};
|
||||
mavlink_serial_udb_extra_f2_b_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -631,15 +631,15 @@ static void mavlink_test_serial_udb_extra_f4(uint8_t system_id, uint8_t componen
|
||||
uint16_t i;
|
||||
mavlink_serial_udb_extra_f4_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
139,
|
||||
206,
|
||||
17,
|
||||
84,
|
||||
151,
|
||||
218,
|
||||
29,
|
||||
96,
|
||||
}72,
|
||||
}139,
|
||||
}206,
|
||||
}17,
|
||||
}84,
|
||||
}151,
|
||||
}218,
|
||||
}29,
|
||||
}96,
|
||||
};
|
||||
mavlink_serial_udb_extra_f4_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -692,11 +692,11 @@ static void mavlink_test_serial_udb_extra_f5(uint8_t system_id, uint8_t componen
|
||||
uint16_t i;
|
||||
mavlink_serial_udb_extra_f5_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
129.0,
|
||||
157.0,
|
||||
}45.0,
|
||||
}73.0,
|
||||
}101.0,
|
||||
}129.0,
|
||||
}157.0,
|
||||
};
|
||||
mavlink_serial_udb_extra_f5_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -745,10 +745,10 @@ static void mavlink_test_serial_udb_extra_f6(uint8_t system_id, uint8_t componen
|
||||
uint16_t i;
|
||||
mavlink_serial_udb_extra_f6_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
129.0,
|
||||
}45.0,
|
||||
}73.0,
|
||||
}101.0,
|
||||
}129.0,
|
||||
};
|
||||
mavlink_serial_udb_extra_f6_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -796,11 +796,11 @@ static void mavlink_test_serial_udb_extra_f7(uint8_t system_id, uint8_t componen
|
||||
uint16_t i;
|
||||
mavlink_serial_udb_extra_f7_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
129.0,
|
||||
157.0,
|
||||
}45.0,
|
||||
}73.0,
|
||||
}101.0,
|
||||
}129.0,
|
||||
}157.0,
|
||||
};
|
||||
mavlink_serial_udb_extra_f7_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -849,12 +849,12 @@ static void mavlink_test_serial_udb_extra_f8(uint8_t system_id, uint8_t componen
|
||||
uint16_t i;
|
||||
mavlink_serial_udb_extra_f8_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
129.0,
|
||||
157.0,
|
||||
185.0,
|
||||
}45.0,
|
||||
}73.0,
|
||||
}101.0,
|
||||
}129.0,
|
||||
}157.0,
|
||||
}185.0,
|
||||
};
|
||||
mavlink_serial_udb_extra_f8_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -904,9 +904,9 @@ static void mavlink_test_serial_udb_extra_f13(uint8_t system_id, uint8_t compone
|
||||
uint16_t i;
|
||||
mavlink_serial_udb_extra_f13_t packet_in = {
|
||||
963497464,
|
||||
963497672,
|
||||
963497880,
|
||||
17859,
|
||||
}963497672,
|
||||
}963497880,
|
||||
}17859,
|
||||
};
|
||||
mavlink_serial_udb_extra_f13_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -953,16 +953,16 @@ static void mavlink_test_serial_udb_extra_f14(uint8_t system_id, uint8_t compone
|
||||
uint16_t i;
|
||||
mavlink_serial_udb_extra_f14_t packet_in = {
|
||||
963497464,
|
||||
17443,
|
||||
17547,
|
||||
17651,
|
||||
163,
|
||||
230,
|
||||
41,
|
||||
108,
|
||||
175,
|
||||
242,
|
||||
53,
|
||||
}17443,
|
||||
}17547,
|
||||
}17651,
|
||||
}163,
|
||||
}230,
|
||||
}41,
|
||||
}108,
|
||||
}175,
|
||||
}242,
|
||||
}53,
|
||||
};
|
||||
mavlink_serial_udb_extra_f14_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -1016,7 +1016,7 @@ static void mavlink_test_serial_udb_extra_f15(uint8_t system_id, uint8_t compone
|
||||
uint16_t i;
|
||||
mavlink_serial_udb_extra_f15_t packet_in = {
|
||||
{ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 },
|
||||
{ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 },
|
||||
}{ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 },
|
||||
};
|
||||
mavlink_serial_udb_extra_f15_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -1061,7 +1061,7 @@ static void mavlink_test_serial_udb_extra_f16(uint8_t system_id, uint8_t compone
|
||||
uint16_t i;
|
||||
mavlink_serial_udb_extra_f16_t packet_in = {
|
||||
{ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 },
|
||||
{ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194 },
|
||||
}{ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194 },
|
||||
};
|
||||
mavlink_serial_udb_extra_f16_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -1106,12 +1106,12 @@ static void mavlink_test_altitudes(uint8_t system_id, uint8_t component_id, mavl
|
||||
uint16_t i;
|
||||
mavlink_altitudes_t packet_in = {
|
||||
963497464,
|
||||
963497672,
|
||||
963497880,
|
||||
963498088,
|
||||
963498296,
|
||||
963498504,
|
||||
963498712,
|
||||
}963497672,
|
||||
}963497880,
|
||||
}963498088,
|
||||
}963498296,
|
||||
}963498504,
|
||||
}963498712,
|
||||
};
|
||||
mavlink_altitudes_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -1161,12 +1161,12 @@ static void mavlink_test_airspeeds(uint8_t system_id, uint8_t component_id, mavl
|
||||
uint16_t i;
|
||||
mavlink_airspeeds_t packet_in = {
|
||||
963497464,
|
||||
17443,
|
||||
17547,
|
||||
17651,
|
||||
17755,
|
||||
17859,
|
||||
17963,
|
||||
}17443,
|
||||
}17547,
|
||||
}17651,
|
||||
}17755,
|
||||
}17859,
|
||||
}17963,
|
||||
};
|
||||
mavlink_airspeeds_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Tue Sep 10 23:49:51 2013"
|
||||
#define MAVLINK_BUILD_DATE "Mon Dec 16 08:57:49 2013"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 254
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -31,11 +31,11 @@ static void mavlink_test_set_cam_shutter(uint8_t system_id, uint8_t component_id
|
||||
uint16_t i;
|
||||
mavlink_set_cam_shutter_t packet_in = {
|
||||
17.0,
|
||||
17443,
|
||||
17547,
|
||||
29,
|
||||
96,
|
||||
163,
|
||||
}17443,
|
||||
}17547,
|
||||
}29,
|
||||
}96,
|
||||
}163,
|
||||
};
|
||||
mavlink_set_cam_shutter_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -84,17 +84,17 @@ static void mavlink_test_image_triggered(uint8_t system_id, uint8_t component_id
|
||||
uint16_t i;
|
||||
mavlink_image_triggered_t packet_in = {
|
||||
93372036854775807ULL,
|
||||
963497880,
|
||||
101.0,
|
||||
129.0,
|
||||
157.0,
|
||||
185.0,
|
||||
213.0,
|
||||
241.0,
|
||||
269.0,
|
||||
297.0,
|
||||
325.0,
|
||||
353.0,
|
||||
}963497880,
|
||||
}101.0,
|
||||
}129.0,
|
||||
}157.0,
|
||||
}185.0,
|
||||
}213.0,
|
||||
}241.0,
|
||||
}269.0,
|
||||
}297.0,
|
||||
}325.0,
|
||||
}353.0,
|
||||
};
|
||||
mavlink_image_triggered_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -192,28 +192,28 @@ static void mavlink_test_image_available(uint8_t system_id, uint8_t component_id
|
||||
uint16_t i;
|
||||
mavlink_image_available_t packet_in = {
|
||||
93372036854775807ULL,
|
||||
93372036854776311ULL,
|
||||
93372036854776815ULL,
|
||||
963498712,
|
||||
963498920,
|
||||
963499128,
|
||||
963499336,
|
||||
297.0,
|
||||
325.0,
|
||||
353.0,
|
||||
381.0,
|
||||
409.0,
|
||||
437.0,
|
||||
465.0,
|
||||
493.0,
|
||||
521.0,
|
||||
549.0,
|
||||
577.0,
|
||||
21603,
|
||||
21707,
|
||||
21811,
|
||||
147,
|
||||
214,
|
||||
}93372036854776311ULL,
|
||||
}93372036854776815ULL,
|
||||
}963498712,
|
||||
}963498920,
|
||||
}963499128,
|
||||
}963499336,
|
||||
}297.0,
|
||||
}325.0,
|
||||
}353.0,
|
||||
}381.0,
|
||||
}409.0,
|
||||
}437.0,
|
||||
}465.0,
|
||||
}493.0,
|
||||
}521.0,
|
||||
}549.0,
|
||||
}577.0,
|
||||
}21603,
|
||||
}21707,
|
||||
}21811,
|
||||
}147,
|
||||
}214,
|
||||
};
|
||||
mavlink_image_available_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -279,11 +279,11 @@ static void mavlink_test_set_position_control_offset(uint8_t system_id, uint8_t
|
||||
uint16_t i;
|
||||
mavlink_set_position_control_offset_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
53,
|
||||
120,
|
||||
}45.0,
|
||||
}73.0,
|
||||
}101.0,
|
||||
}53,
|
||||
}120,
|
||||
};
|
||||
mavlink_set_position_control_offset_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -332,10 +332,10 @@ static void mavlink_test_position_control_setpoint(uint8_t system_id, uint8_t co
|
||||
uint16_t i;
|
||||
mavlink_position_control_setpoint_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
18067,
|
||||
}45.0,
|
||||
}73.0,
|
||||
}101.0,
|
||||
}18067,
|
||||
};
|
||||
mavlink_position_control_setpoint_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -383,12 +383,12 @@ static void mavlink_test_marker(uint8_t system_id, uint8_t component_id, mavlink
|
||||
uint16_t i;
|
||||
mavlink_marker_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
129.0,
|
||||
157.0,
|
||||
18483,
|
||||
}45.0,
|
||||
}73.0,
|
||||
}101.0,
|
||||
}129.0,
|
||||
}157.0,
|
||||
}18483,
|
||||
};
|
||||
mavlink_marker_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -438,12 +438,12 @@ static void mavlink_test_raw_aux(uint8_t system_id, uint8_t component_id, mavlin
|
||||
uint16_t i;
|
||||
mavlink_raw_aux_t packet_in = {
|
||||
963497464,
|
||||
17443,
|
||||
17547,
|
||||
17651,
|
||||
17755,
|
||||
17859,
|
||||
17963,
|
||||
}17443,
|
||||
}17547,
|
||||
}17651,
|
||||
}17755,
|
||||
}17859,
|
||||
}17963,
|
||||
};
|
||||
mavlink_raw_aux_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -493,7 +493,7 @@ static void mavlink_test_watchdog_heartbeat(uint8_t system_id, uint8_t component
|
||||
uint16_t i;
|
||||
mavlink_watchdog_heartbeat_t packet_in = {
|
||||
17235,
|
||||
17339,
|
||||
}17339,
|
||||
};
|
||||
mavlink_watchdog_heartbeat_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -538,10 +538,10 @@ static void mavlink_test_watchdog_process_info(uint8_t system_id, uint8_t compon
|
||||
uint16_t i;
|
||||
mavlink_watchdog_process_info_t packet_in = {
|
||||
963497464,
|
||||
17443,
|
||||
17547,
|
||||
"IJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC",
|
||||
"EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST",
|
||||
}17443,
|
||||
}17547,
|
||||
}"IJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC",
|
||||
}"EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST",
|
||||
};
|
||||
mavlink_watchdog_process_info_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -589,11 +589,11 @@ static void mavlink_test_watchdog_process_status(uint8_t system_id, uint8_t comp
|
||||
uint16_t i;
|
||||
mavlink_watchdog_process_status_t packet_in = {
|
||||
963497464,
|
||||
17443,
|
||||
17547,
|
||||
17651,
|
||||
163,
|
||||
230,
|
||||
}17443,
|
||||
}17547,
|
||||
}17651,
|
||||
}163,
|
||||
}230,
|
||||
};
|
||||
mavlink_watchdog_process_status_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -642,9 +642,9 @@ static void mavlink_test_watchdog_command(uint8_t system_id, uint8_t component_i
|
||||
uint16_t i;
|
||||
mavlink_watchdog_command_t packet_in = {
|
||||
17235,
|
||||
17339,
|
||||
17,
|
||||
84,
|
||||
}17339,
|
||||
}17,
|
||||
}84,
|
||||
};
|
||||
mavlink_watchdog_command_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -691,9 +691,9 @@ static void mavlink_test_pattern_detected(uint8_t system_id, uint8_t component_i
|
||||
uint16_t i;
|
||||
mavlink_pattern_detected_t packet_in = {
|
||||
17.0,
|
||||
17,
|
||||
"FGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||
128,
|
||||
}17,
|
||||
}"FGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||
}128,
|
||||
};
|
||||
mavlink_pattern_detected_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -740,13 +740,13 @@ static void mavlink_test_point_of_interest(uint8_t system_id, uint8_t component_
|
||||
uint16_t i;
|
||||
mavlink_point_of_interest_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
17859,
|
||||
175,
|
||||
242,
|
||||
53,
|
||||
"RSTUVWXYZABCDEFGHIJKLMNOP",
|
||||
}45.0,
|
||||
}73.0,
|
||||
}17859,
|
||||
}175,
|
||||
}242,
|
||||
}53,
|
||||
}"RSTUVWXYZABCDEFGHIJKLMNOP",
|
||||
};
|
||||
mavlink_point_of_interest_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -797,16 +797,16 @@ static void mavlink_test_point_of_interest_connection(uint8_t system_id, uint8_t
|
||||
uint16_t i;
|
||||
mavlink_point_of_interest_connection_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
129.0,
|
||||
157.0,
|
||||
18483,
|
||||
211,
|
||||
22,
|
||||
89,
|
||||
"DEFGHIJKLMNOPQRSTUVWXYZAB",
|
||||
}45.0,
|
||||
}73.0,
|
||||
}101.0,
|
||||
}129.0,
|
||||
}157.0,
|
||||
}18483,
|
||||
}211,
|
||||
}22,
|
||||
}89,
|
||||
}"DEFGHIJKLMNOPQRSTUVWXYZAB",
|
||||
};
|
||||
mavlink_point_of_interest_connection_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -860,12 +860,12 @@ static void mavlink_test_data_transmission_handshake(uint8_t system_id, uint8_t
|
||||
uint16_t i;
|
||||
mavlink_data_transmission_handshake_t packet_in = {
|
||||
963497464,
|
||||
17443,
|
||||
17547,
|
||||
29,
|
||||
96,
|
||||
163,
|
||||
230,
|
||||
}17443,
|
||||
}17547,
|
||||
}29,
|
||||
}96,
|
||||
}163,
|
||||
}230,
|
||||
};
|
||||
mavlink_data_transmission_handshake_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -915,7 +915,7 @@ static void mavlink_test_encapsulated_data(uint8_t system_id, uint8_t component_
|
||||
uint16_t i;
|
||||
mavlink_encapsulated_data_t packet_in = {
|
||||
17235,
|
||||
{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135 },
|
||||
}{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135 },
|
||||
};
|
||||
mavlink_encapsulated_data_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -960,13 +960,13 @@ static void mavlink_test_brief_feature(uint8_t system_id, uint8_t component_id,
|
||||
uint16_t i;
|
||||
mavlink_brief_feature_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
18067,
|
||||
18171,
|
||||
65,
|
||||
{ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 },
|
||||
}45.0,
|
||||
}73.0,
|
||||
}101.0,
|
||||
}18067,
|
||||
}18171,
|
||||
}65,
|
||||
}{ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 },
|
||||
};
|
||||
mavlink_brief_feature_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
@@ -1017,14 +1017,14 @@ static void mavlink_test_attitude_control(uint8_t system_id, uint8_t component_i
|
||||
uint16_t i;
|
||||
mavlink_attitude_control_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
53,
|
||||
120,
|
||||
187,
|
||||
254,
|
||||
65,
|
||||
}45.0,
|
||||
}73.0,
|
||||
}101.0,
|
||||
}53,
|
||||
}120,
|
||||
}187,
|
||||
}254,
|
||||
}65,
|
||||
};
|
||||
mavlink_attitude_control_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Tue Sep 10 23:49:13 2013"
|
||||
#define MAVLINK_BUILD_DATE "Mon Dec 16 08:58:02 2013"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ CONFIG_UART4_RXDMA=y
|
||||
# CONFIG_UART7_RS485 is not set
|
||||
# CONFIG_UART7_RXDMA is not set
|
||||
# CONFIG_UART8_RS485 is not set
|
||||
# CONFIG_UART8_RXDMA is not set
|
||||
CONFIG_UART8_RXDMA=y
|
||||
CONFIG_SERIAL_DISABLE_REORDERING=y
|
||||
CONFIG_STM32_USART_SINGLEWIRE=y
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2012 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -60,7 +60,7 @@
|
||||
/**
|
||||
* Maximum number of R/C input channels in the system. S.Bus has up to 18 channels.
|
||||
*/
|
||||
#define RC_INPUT_MAX_CHANNELS 18
|
||||
#define RC_INPUT_MAX_CHANNELS 20
|
||||
|
||||
/**
|
||||
* Input signal type, value is a control position from zero to 100
|
||||
@@ -89,6 +89,9 @@ struct rc_input_values {
|
||||
/** number of channels actually being seen */
|
||||
uint32_t channel_count;
|
||||
|
||||
/** receive signal strength indicator (RSSI): < 0: Undefined, 0: no signal, 1000: full reception */
|
||||
int32_t rssi;
|
||||
|
||||
/** Input source */
|
||||
enum RC_INPUT_SOURCE input_source;
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ private:
|
||||
};
|
||||
|
||||
L3GD20::L3GD20(int bus, const char* path, spi_dev_e device) :
|
||||
SPI("L3GD20", path, bus, device, SPIDEV_MODE3, 8000000),
|
||||
SPI("L3GD20", path, bus, device, SPIDEV_MODE3, 11*1000*1000 /* will be rounded to 10.4 MHz, within margins for L3GD20 */),
|
||||
_call_interval(0),
|
||||
_reports(nullptr),
|
||||
_gyro_range_scale(0.0f),
|
||||
|
||||
@@ -486,7 +486,7 @@ private:
|
||||
|
||||
|
||||
LSM303D::LSM303D(int bus, const char* path, spi_dev_e device) :
|
||||
SPI("LSM303D", path, bus, device, SPIDEV_MODE3, 8000000),
|
||||
SPI("LSM303D", path, bus, device, SPIDEV_MODE3, 11*1000*1000 /* will be rounded to 10.4 MHz, within safety margins for LSM303D */),
|
||||
_mag(new LSM303D_mag(this)),
|
||||
_call_accel_interval(0),
|
||||
_call_mag_interval(0),
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
SPI speed
|
||||
*/
|
||||
#define MPU6000_LOW_BUS_SPEED 1000*1000
|
||||
#define MPU6000_HIGH_BUS_SPEED 10*1000*1000
|
||||
#define MPU6000_HIGH_BUS_SPEED 11*1000*1000 /* will be rounded to 10.4 MHz, within margins for MPU6K */
|
||||
|
||||
class MPU6000_gyro;
|
||||
|
||||
@@ -505,17 +505,26 @@ out:
|
||||
|
||||
void MPU6000::reset()
|
||||
{
|
||||
// if the mpu6000 is initialised after the l3gd20 and lsm303d
|
||||
// then if we don't do an irqsave/irqrestore here the mpu6000
|
||||
// frequenctly comes up in a bad state where all transfers
|
||||
// come as zero
|
||||
irqstate_t state;
|
||||
state = irqsave();
|
||||
|
||||
// Chip reset
|
||||
write_reg(MPUREG_PWR_MGMT_1, BIT_H_RESET);
|
||||
up_udelay(10000);
|
||||
|
||||
// Wake up device and select GyroZ clock (better performance)
|
||||
// Wake up device and select GyroZ clock. Note that the
|
||||
// MPU6000 starts up in sleep mode, and it can take some time
|
||||
// for it to come out of sleep
|
||||
write_reg(MPUREG_PWR_MGMT_1, MPU_CLK_SEL_PLLGYROZ);
|
||||
up_udelay(1000);
|
||||
|
||||
// Disable I2C bus (recommended on datasheet)
|
||||
write_reg(MPUREG_USER_CTRL, BIT_I2C_IF_DIS);
|
||||
irqrestore(state);
|
||||
|
||||
up_udelay(1000);
|
||||
|
||||
// SAMPLE RATE
|
||||
|
||||
@@ -121,7 +121,7 @@ MS5611_spi_interface(ms5611::prom_u &prom_buf)
|
||||
}
|
||||
|
||||
MS5611_SPI::MS5611_SPI(int bus, spi_dev_e device, ms5611::prom_u &prom_buf) :
|
||||
SPI("MS5611_SPI", nullptr, bus, device, SPIDEV_MODE3, 6*1000*1000),
|
||||
SPI("MS5611_SPI", nullptr, bus, device, SPIDEV_MODE3, 11*1000*1000 /* will be rounded to 10.4 MHz */),
|
||||
_prom(prom_buf)
|
||||
{
|
||||
}
|
||||
|
||||
+72
-37
@@ -237,6 +237,7 @@ private:
|
||||
|
||||
unsigned _update_interval; ///< Subscription interval limiting send rate
|
||||
bool _rc_handling_disabled; ///< If set, IO does not evaluate, but only forward the RC values
|
||||
unsigned _rc_chan_count; ///< Internal copy of the last seen number of RC channels
|
||||
|
||||
volatile int _task; ///< worker task id
|
||||
volatile bool _task_should_exit; ///< worker terminate flag
|
||||
@@ -244,7 +245,9 @@ private:
|
||||
int _mavlink_fd; ///< mavlink file descriptor. This is opened by class instantiation and Doesn't appear to be usable in main thread.
|
||||
int _thread_mavlink_fd; ///< mavlink file descriptor for thread.
|
||||
|
||||
perf_counter_t _perf_update; ///< local performance counter
|
||||
perf_counter_t _perf_update; ///<local performance counter for status updates
|
||||
perf_counter_t _perf_write; ///<local performance counter for PWM control writes
|
||||
perf_counter_t _perf_chan_count; ///<local performance counter for channel number changes
|
||||
|
||||
/* cached IO state */
|
||||
uint16_t _status; ///< Various IO status flags
|
||||
@@ -462,11 +465,14 @@ PX4IO::PX4IO(device::Device *interface) :
|
||||
_max_transfer(16), /* sensible default */
|
||||
_update_interval(0),
|
||||
_rc_handling_disabled(false),
|
||||
_rc_chan_count(0),
|
||||
_task(-1),
|
||||
_task_should_exit(false),
|
||||
_mavlink_fd(-1),
|
||||
_thread_mavlink_fd(-1),
|
||||
_perf_update(perf_alloc(PC_ELAPSED, "px4io update")),
|
||||
_perf_update(perf_alloc(PC_ELAPSED, "io update")),
|
||||
_perf_write(perf_alloc(PC_ELAPSED, "io write")),
|
||||
_perf_chan_count(perf_alloc(PC_COUNT, "io rc #")),
|
||||
_status(0),
|
||||
_alarms(0),
|
||||
_t_actuator_controls_0(-1),
|
||||
@@ -917,7 +923,23 @@ PX4IO::task_main()
|
||||
|
||||
/* re-upload RC input config as it may have changed */
|
||||
io_set_rc_config();
|
||||
|
||||
/* re-set the battery scaling */
|
||||
int32_t voltage_scaling_val;
|
||||
param_t voltage_scaling_param;
|
||||
|
||||
/* set battery voltage scaling */
|
||||
param_get(voltage_scaling_param = param_find("BAT_V_SCALE_IO"), &voltage_scaling_val);
|
||||
|
||||
/* send scaling voltage to IO */
|
||||
uint16_t scaling = voltage_scaling_val;
|
||||
int pret = io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_VBATT_SCALE, &scaling, 1);
|
||||
|
||||
if (pret != OK) {
|
||||
log("voltage scaling upload failed");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
perf_end(_perf_update);
|
||||
@@ -1101,7 +1123,12 @@ PX4IO::io_set_rc_config()
|
||||
if ((ichan >= 0) && (ichan < (int)_max_rc_input))
|
||||
input_map[ichan - 1] = 3;
|
||||
|
||||
ichan = 4;
|
||||
param_get(param_find("RC_MAP_MODE_SW"), &ichan);
|
||||
|
||||
if ((ichan >= 0) && (ichan < (int)_max_rc_input))
|
||||
input_map[ichan - 1] = 4;
|
||||
|
||||
ichan = 5;
|
||||
|
||||
for (unsigned i = 0; i < _max_rc_input; i++)
|
||||
if (input_map[i] == -1)
|
||||
@@ -1379,6 +1406,11 @@ PX4IO::io_get_raw_rc_input(rc_input_values &input_rc)
|
||||
*/
|
||||
channel_count = regs[0];
|
||||
|
||||
if (channel_count != _rc_chan_count)
|
||||
perf_count(_perf_chan_count);
|
||||
|
||||
_rc_chan_count = channel_count;
|
||||
|
||||
if (channel_count > 9) {
|
||||
ret = io_reg_get(PX4IO_PAGE_RAW_RC_INPUT, PX4IO_P_RAW_RC_BASE + 9, ®s[prolog + 9], channel_count - 9);
|
||||
|
||||
@@ -2227,7 +2259,10 @@ PX4IO::write(file * /*filp*/, const char *buffer, size_t len)
|
||||
count = _max_actuators;
|
||||
|
||||
if (count > 0) {
|
||||
|
||||
perf_begin(_perf_write);
|
||||
int ret = io_reg_set(PX4IO_PAGE_DIRECT_PWM, 0, (uint16_t *)buffer, count);
|
||||
perf_end(_perf_write);
|
||||
|
||||
if (ret != OK)
|
||||
return ret;
|
||||
@@ -2306,7 +2341,7 @@ void
|
||||
start(int argc, char *argv[])
|
||||
{
|
||||
if (g_dev != nullptr)
|
||||
errx(1, "already loaded");
|
||||
errx(0, "already loaded");
|
||||
|
||||
/* allocate the interface */
|
||||
device::Device *interface = get_interface();
|
||||
@@ -2639,6 +2674,39 @@ px4io_main(int argc, char *argv[])
|
||||
if_test((argc > 2) ? strtol(argv[2], NULL, 0) : 0);
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1], "forceupdate")) {
|
||||
/*
|
||||
force update of the IO firmware without requiring
|
||||
the user to hold the safety switch down
|
||||
*/
|
||||
if (argc <= 3) {
|
||||
warnx("usage: px4io forceupdate MAGIC filename");
|
||||
exit(1);
|
||||
}
|
||||
if (g_dev == nullptr) {
|
||||
warnx("px4io is not started, still attempting upgrade");
|
||||
} else {
|
||||
uint16_t arg = atol(argv[2]);
|
||||
int ret = g_dev->ioctl(nullptr, PX4IO_REBOOT_BOOTLOADER, arg);
|
||||
if (ret != OK) {
|
||||
printf("reboot failed - %d\n", ret);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// tear down the px4io instance
|
||||
delete g_dev;
|
||||
}
|
||||
|
||||
// upload the specified firmware
|
||||
const char *fn[2];
|
||||
fn[0] = argv[3];
|
||||
fn[1] = nullptr;
|
||||
PX4IO_Uploader *up = new PX4IO_Uploader;
|
||||
up->upload(&fn[0]);
|
||||
delete up;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* commands below here require a started driver */
|
||||
|
||||
if (g_dev == nullptr)
|
||||
@@ -2724,39 +2792,6 @@ px4io_main(int argc, char *argv[])
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1], "forceupdate")) {
|
||||
/*
|
||||
force update of the IO firmware without requiring
|
||||
the user to hold the safety switch down
|
||||
*/
|
||||
if (argc <= 3) {
|
||||
printf("usage: px4io forceupdate MAGIC filename\n");
|
||||
exit(1);
|
||||
}
|
||||
if (g_dev == nullptr) {
|
||||
printf("px4io is not started\n");
|
||||
exit(1);
|
||||
}
|
||||
uint16_t arg = atol(argv[2]);
|
||||
int ret = g_dev->ioctl(nullptr, PX4IO_REBOOT_BOOTLOADER, arg);
|
||||
if (ret != OK) {
|
||||
printf("reboot failed - %d\n", ret);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// tear down the px4io instance
|
||||
delete g_dev;
|
||||
|
||||
// upload the specified firmware
|
||||
const char *fn[2];
|
||||
fn[0] = argv[3];
|
||||
fn[1] = nullptr;
|
||||
PX4IO_Uploader *up = new PX4IO_Uploader;
|
||||
up->upload(&fn[0]);
|
||||
delete up;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1], "checkcrc")) {
|
||||
/*
|
||||
check IO CRC against CRC of a file
|
||||
|
||||
@@ -338,7 +338,12 @@ static void hrt_call_invoke(void);
|
||||
# define PPM_MIN_START 2500 /* shortest valid start gap */
|
||||
|
||||
/* decoded PPM buffer */
|
||||
#define PPM_MAX_CHANNELS 12
|
||||
#define PPM_MIN_CHANNELS 5
|
||||
#define PPM_MAX_CHANNELS 20
|
||||
|
||||
/* Number of same-sized frames required to 'lock' */
|
||||
#define PPM_CHANNEL_LOCK 2 /* should be less than the input timeout */
|
||||
|
||||
__EXPORT uint16_t ppm_buffer[PPM_MAX_CHANNELS];
|
||||
__EXPORT unsigned ppm_decoded_channels = 0;
|
||||
__EXPORT uint64_t ppm_last_valid_decode = 0;
|
||||
@@ -440,7 +445,7 @@ hrt_ppm_decode(uint32_t status)
|
||||
if (status & SR_OVF_PPM)
|
||||
goto error;
|
||||
|
||||
/* how long since the last edge? */
|
||||
/* how long since the last edge? - this handles counter wrapping implicitely. */
|
||||
width = count - ppm.last_edge;
|
||||
ppm.last_edge = count;
|
||||
|
||||
@@ -455,14 +460,38 @@ hrt_ppm_decode(uint32_t status)
|
||||
*/
|
||||
if (width >= PPM_MIN_START) {
|
||||
|
||||
/* export the last set of samples if we got something sensible */
|
||||
if (ppm.next_channel > 4) {
|
||||
for (i = 0; i < ppm.next_channel && i < PPM_MAX_CHANNELS; i++)
|
||||
ppm_buffer[i] = ppm_temp_buffer[i];
|
||||
/*
|
||||
* If the number of channels changes unexpectedly, we don't want
|
||||
* to just immediately jump on the new count as it may be a result
|
||||
* of noise or dropped edges. Instead, take a few frames to settle.
|
||||
*/
|
||||
if (ppm.next_channel != ppm_decoded_channels) {
|
||||
static unsigned new_channel_count;
|
||||
static unsigned new_channel_holdoff;
|
||||
|
||||
ppm_decoded_channels = i;
|
||||
ppm_last_valid_decode = hrt_absolute_time();
|
||||
if (new_channel_count != ppm.next_channel) {
|
||||
/* start the lock counter for the new channel count */
|
||||
new_channel_count = ppm.next_channel;
|
||||
new_channel_holdoff = PPM_CHANNEL_LOCK;
|
||||
|
||||
} else if (new_channel_holdoff > 0) {
|
||||
/* this frame matched the last one, decrement the lock counter */
|
||||
new_channel_holdoff--;
|
||||
|
||||
} else {
|
||||
/* we have seen PPM_CHANNEL_LOCK frames with the new count, accept it */
|
||||
ppm_decoded_channels = new_channel_count;
|
||||
new_channel_count = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
/* frame channel count matches expected, let's use it */
|
||||
if (ppm.next_channel > PPM_MIN_CHANNELS) {
|
||||
for (i = 0; i < ppm.next_channel; i++)
|
||||
ppm_buffer[i] = ppm_temp_buffer[i];
|
||||
|
||||
ppm_last_valid_decode = hrt_absolute_time();
|
||||
}
|
||||
}
|
||||
|
||||
/* reset for the next frame */
|
||||
|
||||
@@ -1624,8 +1624,8 @@ check_navigation_state_machine(struct vehicle_status_s *status, struct vehicle_c
|
||||
/* switch to failsafe mode */
|
||||
bool manual_control_old = control_mode->flag_control_manual_enabled;
|
||||
|
||||
if (!status->condition_landed) {
|
||||
/* in air: try to hold position */
|
||||
if (!status->condition_landed && status->condition_local_position_valid) {
|
||||
/* in air: try to hold position if possible */
|
||||
res = navigation_state_transition(status, NAVIGATION_STATE_VECTOR, control_mode);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -66,7 +66,7 @@ controls_init(void)
|
||||
sbus_init("/dev/ttyS2");
|
||||
|
||||
/* default to a 1:1 input map, all enabled */
|
||||
for (unsigned i = 0; i < PX4IO_CONTROL_CHANNELS; i++) {
|
||||
for (unsigned i = 0; i < PX4IO_RC_INPUT_CHANNELS; i++) {
|
||||
unsigned base = PX4IO_P_RC_CONFIG_STRIDE * i;
|
||||
|
||||
r_page_rc_input_config[base + PX4IO_P_RC_CONFIG_OPTIONS] = 0;
|
||||
@@ -94,6 +94,9 @@ controls_tick() {
|
||||
* other. Don't do that.
|
||||
*/
|
||||
|
||||
/* receive signal strenght indicator (RSSI). 0 = no connection, 1000: perfect connection */
|
||||
uint16_t rssi = 0;
|
||||
|
||||
perf_begin(c_gather_dsm);
|
||||
uint16_t temp_count = r_raw_rc_count;
|
||||
bool dsm_updated = dsm_input(r_raw_rc_values, &temp_count);
|
||||
@@ -104,14 +107,15 @@ controls_tick() {
|
||||
r_status_flags |= PX4IO_P_STATUS_FLAGS_RC_DSM11;
|
||||
else
|
||||
r_status_flags &= ~PX4IO_P_STATUS_FLAGS_RC_DSM11;
|
||||
|
||||
rssi = 1000;
|
||||
}
|
||||
perf_end(c_gather_dsm);
|
||||
|
||||
perf_begin(c_gather_sbus);
|
||||
bool sbus_updated = sbus_input(r_raw_rc_values, &r_raw_rc_count, PX4IO_CONTROL_CHANNELS /* XXX this should be INPUT channels, once untangled */);
|
||||
bool sbus_updated = sbus_input(r_raw_rc_values, &r_raw_rc_count, &rssi, PX4IO_RC_INPUT_CHANNELS);
|
||||
if (sbus_updated) {
|
||||
r_status_flags |= PX4IO_P_STATUS_FLAGS_RC_SBUS;
|
||||
r_raw_rc_count = 8;
|
||||
}
|
||||
perf_end(c_gather_sbus);
|
||||
|
||||
@@ -122,10 +126,19 @@ controls_tick() {
|
||||
*/
|
||||
perf_begin(c_gather_ppm);
|
||||
bool ppm_updated = ppm_input(r_raw_rc_values, &r_raw_rc_count);
|
||||
if (ppm_updated)
|
||||
if (ppm_updated) {
|
||||
|
||||
/* XXX sample RSSI properly here */
|
||||
rssi = 1000;
|
||||
|
||||
r_status_flags |= PX4IO_P_STATUS_FLAGS_RC_PPM;
|
||||
}
|
||||
perf_end(c_gather_ppm);
|
||||
|
||||
/* limit number of channels to allowable data size */
|
||||
if (r_raw_rc_count > PX4IO_RC_INPUT_CHANNELS)
|
||||
r_raw_rc_count = PX4IO_RC_INPUT_CHANNELS;
|
||||
|
||||
/*
|
||||
* In some cases we may have received a frame, but input has still
|
||||
* been lost.
|
||||
@@ -197,14 +210,16 @@ controls_tick() {
|
||||
|
||||
/* and update the scaled/mapped version */
|
||||
unsigned mapped = conf[PX4IO_P_RC_CONFIG_ASSIGNMENT];
|
||||
ASSERT(mapped < PX4IO_CONTROL_CHANNELS);
|
||||
if (mapped < PX4IO_CONTROL_CHANNELS) {
|
||||
|
||||
/* invert channel if pitch - pulling the lever down means pitching up by convention */
|
||||
if (mapped == 1) /* roll, pitch, yaw, throttle, override is the standard order */
|
||||
scaled = -scaled;
|
||||
/* invert channel if pitch - pulling the lever down means pitching up by convention */
|
||||
if (mapped == 1) /* roll, pitch, yaw, throttle, override is the standard order */
|
||||
scaled = -scaled;
|
||||
|
||||
r_rc_values[mapped] = SIGNED_TO_REG(scaled);
|
||||
assigned_channels |= (1 << mapped);
|
||||
r_rc_values[mapped] = SIGNED_TO_REG(scaled);
|
||||
assigned_channels |= (1 << mapped);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,7 +236,7 @@ controls_tick() {
|
||||
* This might happen if a protocol-based receiver returns an update
|
||||
* that contains no channels that we have mapped.
|
||||
*/
|
||||
if (assigned_channels == 0) {
|
||||
if (assigned_channels == 0 || rssi == 0) {
|
||||
rc_input_lost = true;
|
||||
} else {
|
||||
/* set RC OK flag */
|
||||
@@ -321,8 +336,8 @@ ppm_input(uint16_t *values, uint16_t *num_values)
|
||||
|
||||
/* PPM data exists, copy it */
|
||||
*num_values = ppm_decoded_channels;
|
||||
if (*num_values > PX4IO_CONTROL_CHANNELS)
|
||||
*num_values = PX4IO_CONTROL_CHANNELS;
|
||||
if (*num_values > PX4IO_RC_INPUT_CHANNELS)
|
||||
*num_values = PX4IO_RC_INPUT_CHANNELS;
|
||||
|
||||
for (unsigned i = 0; i < *num_values; i++)
|
||||
values[i] = ppm_buffer[i];
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
#define PX4IO_P_STATUS_VSERVO 6 /* [2] servo rail voltage in mV */
|
||||
#define PX4IO_P_STATUS_VRSSI 7 /* [2] RSSI voltage */
|
||||
#define PX4IO_P_STATUS_PRSSI 8 /* [2] RSSI PWM value */
|
||||
#define PX4IO_P_STATUS_NRSSI 9 /* [2] Normalized RSSI value, 0: no reception, 1000: perfect reception */
|
||||
|
||||
/* array of post-mix actuator outputs, -10000..10000 */
|
||||
#define PX4IO_PAGE_ACTUATORS 2 /* 0..CONFIG_ACTUATOR_COUNT-1 */
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#define PX4IO_SERVO_COUNT 8
|
||||
#define PX4IO_CONTROL_CHANNELS 8
|
||||
#define PX4IO_CONTROL_GROUPS 2
|
||||
#define PX4IO_RC_INPUT_CHANNELS 8 // XXX this should be 18 channels
|
||||
#define PX4IO_RC_INPUT_CHANNELS 18
|
||||
#define PX4IO_RC_MAPPED_CONTROL_CHANNELS 8 /**< This is the maximum number of channels mapped/used */
|
||||
|
||||
/*
|
||||
@@ -213,7 +213,7 @@ extern int dsm_init(const char *device);
|
||||
extern bool dsm_input(uint16_t *values, uint16_t *num_values);
|
||||
extern void dsm_bind(uint16_t cmd, int pulses);
|
||||
extern int sbus_init(const char *device);
|
||||
extern bool sbus_input(uint16_t *values, uint16_t *num_values, uint16_t max_channels);
|
||||
extern bool sbus_input(uint16_t *values, uint16_t *num_values, uint16_t *rssi, uint16_t max_channels);
|
||||
|
||||
/** global debug level for isr_debug() */
|
||||
extern volatile uint8_t debug_level;
|
||||
|
||||
@@ -54,6 +54,27 @@
|
||||
|
||||
#define SBUS_FRAME_SIZE 25
|
||||
#define SBUS_INPUT_CHANNELS 16
|
||||
#define SBUS_FLAGS_BYTE 23
|
||||
#define SBUS_FAILSAFE_BIT 3
|
||||
#define SBUS_FRAMELOST_BIT 2
|
||||
|
||||
/*
|
||||
Measured values with Futaba FX-30/R6108SB:
|
||||
-+100% on TX: PCM 1.100/1.520/1.950ms -> SBus raw values: 350/1024/1700 (100% ATV)
|
||||
-+140% on TX: PCM 0.930/1.520/2.112ms -> SBus raw values: 78/1024/1964 (140% ATV)
|
||||
-+152% on TX: PCM 0.884/1.520/2.160ms -> SBus raw values: 1/1024/2047 (140% ATV plus dirty tricks)
|
||||
*/
|
||||
|
||||
/* define range mapping here, -+100% -> 1000..2000 */
|
||||
#define SBUS_RANGE_MIN 200.0f
|
||||
#define SBUS_RANGE_MAX 1800.0f
|
||||
|
||||
#define SBUS_TARGET_MIN 1000.0f
|
||||
#define SBUS_TARGET_MAX 2000.0f
|
||||
|
||||
/* pre-calculate the floating point stuff as far as possible at compile time */
|
||||
#define SBUS_SCALE_FACTOR ((SBUS_TARGET_MAX - SBUS_TARGET_MIN) / (SBUS_RANGE_MAX - SBUS_RANGE_MIN))
|
||||
#define SBUS_SCALE_OFFSET (int)(SBUS_TARGET_MIN - (SBUS_SCALE_FACTOR * SBUS_RANGE_MIN + 0.5f))
|
||||
|
||||
static int sbus_fd = -1;
|
||||
|
||||
@@ -66,7 +87,7 @@ static unsigned partial_frame_count;
|
||||
|
||||
unsigned sbus_frame_drops;
|
||||
|
||||
static bool sbus_decode(hrt_abstime frame_time, uint16_t *values, uint16_t *num_values, uint16_t max_channels);
|
||||
static bool sbus_decode(hrt_abstime frame_time, uint16_t *values, uint16_t *num_values, uint16_t *rssi, uint16_t max_channels);
|
||||
|
||||
int
|
||||
sbus_init(const char *device)
|
||||
@@ -97,7 +118,7 @@ sbus_init(const char *device)
|
||||
}
|
||||
|
||||
bool
|
||||
sbus_input(uint16_t *values, uint16_t *num_values, uint16_t max_channels)
|
||||
sbus_input(uint16_t *values, uint16_t *num_values, uint16_t *rssi, uint16_t max_channels)
|
||||
{
|
||||
ssize_t ret;
|
||||
hrt_abstime now;
|
||||
@@ -154,7 +175,7 @@ sbus_input(uint16_t *values, uint16_t *num_values, uint16_t max_channels)
|
||||
* decode it.
|
||||
*/
|
||||
partial_frame_count = 0;
|
||||
return sbus_decode(now, values, num_values, max_channels);
|
||||
return sbus_decode(now, values, num_values, rssi, max_channels);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -194,7 +215,7 @@ static const struct sbus_bit_pick sbus_decoder[SBUS_INPUT_CHANNELS][3] = {
|
||||
};
|
||||
|
||||
static bool
|
||||
sbus_decode(hrt_abstime frame_time, uint16_t *values, uint16_t *num_values, uint16_t max_values)
|
||||
sbus_decode(hrt_abstime frame_time, uint16_t *values, uint16_t *num_values, uint16_t *rssi, uint16_t max_values)
|
||||
{
|
||||
/* check frame boundary markers to avoid out-of-sync cases */
|
||||
if ((frame[0] != 0x0f) || (frame[24] != 0x00)) {
|
||||
@@ -202,15 +223,6 @@ sbus_decode(hrt_abstime frame_time, uint16_t *values, uint16_t *num_values, uint
|
||||
return false;
|
||||
}
|
||||
|
||||
/* if the failsafe or connection lost bit is set, we consider the frame invalid */
|
||||
if ((frame[23] & (1 << 2)) && /* signal lost */
|
||||
(frame[23] & (1 << 3))) { /* failsafe */
|
||||
|
||||
/* actively announce signal loss */
|
||||
*values = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* we have received something we think is a frame */
|
||||
last_frame_time = frame_time;
|
||||
|
||||
@@ -234,8 +246,9 @@ sbus_decode(hrt_abstime frame_time, uint16_t *values, uint16_t *num_values, uint
|
||||
}
|
||||
}
|
||||
|
||||
/* convert 0-2048 values to 1000-2000 ppm encoding in a very sloppy fashion */
|
||||
values[channel] = (value / 2) + 998;
|
||||
|
||||
/* convert 0-2048 values to 1000-2000 ppm encoding in a not too sloppy fashion */
|
||||
values[channel] = (uint16_t)(value * SBUS_SCALE_FACTOR +.5f) + SBUS_SCALE_OFFSET;
|
||||
}
|
||||
|
||||
/* decode switch channels if data fields are wide enough */
|
||||
@@ -243,13 +256,31 @@ sbus_decode(hrt_abstime frame_time, uint16_t *values, uint16_t *num_values, uint
|
||||
chancount = 18;
|
||||
|
||||
/* channel 17 (index 16) */
|
||||
values[16] = (frame[23] & (1 << 0)) * 1000 + 998;
|
||||
values[16] = (frame[SBUS_FLAGS_BYTE] & (1 << 0)) * 1000 + 998;
|
||||
/* channel 18 (index 17) */
|
||||
values[17] = (frame[23] & (1 << 1)) * 1000 + 998;
|
||||
values[17] = (frame[SBUS_FLAGS_BYTE] & (1 << 1)) * 1000 + 998;
|
||||
}
|
||||
|
||||
/* note the number of channels decoded */
|
||||
*num_values = chancount;
|
||||
|
||||
/* decode and handle failsafe and frame-lost flags */
|
||||
if (frame[SBUS_FLAGS_BYTE] & (1 << SBUS_FAILSAFE_BIT)) { /* failsafe */
|
||||
/* report that we failed to read anything valid off the receiver */
|
||||
*rssi = 0;
|
||||
return false;
|
||||
}
|
||||
else if (frame[SBUS_FLAGS_BYTE] & (1 << SBUS_FRAMELOST_BIT)) { /* a frame was lost */
|
||||
/* set a special warning flag or try to calculate some kind of RSSI information - to be implemented
|
||||
*
|
||||
* Attention! This flag indicates a skipped frame only, not a total link loss! Handling this
|
||||
* condition as fail-safe greatly reduces the reliability and range of the radio link,
|
||||
* e.g. by prematurely issueing return-to-launch!!! */
|
||||
|
||||
*rssi = 100; // XXX magic number indicating bad signal, but not a signal loss (yet)
|
||||
}
|
||||
|
||||
*rssi = 1000;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -190,11 +190,30 @@ PARAM_DEFINE_FLOAT(RC15_MAX, 2000);
|
||||
PARAM_DEFINE_FLOAT(RC15_REV, 1.0f);
|
||||
PARAM_DEFINE_FLOAT(RC15_DZ, 0.0f);
|
||||
|
||||
PARAM_DEFINE_FLOAT(RC16_MIN, 1000);
|
||||
PARAM_DEFINE_FLOAT(RC16_TRIM, 1500);
|
||||
PARAM_DEFINE_FLOAT(RC16_MAX, 2000);
|
||||
PARAM_DEFINE_FLOAT(RC16_REV, 1.0f);
|
||||
PARAM_DEFINE_FLOAT(RC16_DZ, 0.0f);
|
||||
|
||||
PARAM_DEFINE_FLOAT(RC17_MIN, 1000);
|
||||
PARAM_DEFINE_FLOAT(RC17_TRIM, 1500);
|
||||
PARAM_DEFINE_FLOAT(RC17_MAX, 2000);
|
||||
PARAM_DEFINE_FLOAT(RC17_REV, 1.0f);
|
||||
PARAM_DEFINE_FLOAT(RC17_DZ, 0.0f);
|
||||
|
||||
PARAM_DEFINE_FLOAT(RC18_MIN, 1000);
|
||||
PARAM_DEFINE_FLOAT(RC18_TRIM, 1500);
|
||||
PARAM_DEFINE_FLOAT(RC18_MAX, 2000);
|
||||
PARAM_DEFINE_FLOAT(RC18_REV, 1.0f);
|
||||
PARAM_DEFINE_FLOAT(RC18_DZ, 0.0f);
|
||||
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1
|
||||
PARAM_DEFINE_INT32(RC_RL1_DSM_VCC, 0); /* Relay 1 controls DSM VCC */
|
||||
#endif
|
||||
PARAM_DEFINE_INT32(RC_DSM_BIND, -1); /* -1 = Idle, 0 = Start DSM2 bind, 1 = Start DSMX bind */
|
||||
|
||||
PARAM_DEFINE_INT32(BAT_V_SCALE_IO, 10000);
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V2
|
||||
PARAM_DEFINE_FLOAT(BAT_V_SCALING, 0.0082f);
|
||||
#else
|
||||
@@ -226,3 +245,7 @@ PARAM_DEFINE_INT32(RC_MAP_AUX3, 0); /**< default function: camera azimuth / yaw
|
||||
PARAM_DEFINE_FLOAT(RC_SCALE_ROLL, 0.6f);
|
||||
PARAM_DEFINE_FLOAT(RC_SCALE_PITCH, 0.6f);
|
||||
PARAM_DEFINE_FLOAT(RC_SCALE_YAW, 2.0f);
|
||||
|
||||
PARAM_DEFINE_INT32(RC_FS_CH, 0); /**< RC failsafe channel, 0 = disable */
|
||||
PARAM_DEFINE_INT32(RC_FS_MODE, 0); /**< RC failsafe mode: 0 = too low means signal loss, 1 = too high means signal loss */
|
||||
PARAM_DEFINE_FLOAT(RC_FS_THR, 800); /**< RC failsafe PWM threshold */
|
||||
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
int start();
|
||||
|
||||
private:
|
||||
static const unsigned _rc_max_chan_count = RC_CHANNELS_MAX; /**< maximum number of r/c channels we handle */
|
||||
static const unsigned _rc_max_chan_count = RC_INPUT_MAX_CHANNELS; /**< maximum number of r/c channels we handle */
|
||||
|
||||
hrt_abstime _rc_last_valid; /**< last time we got a valid RC signal */
|
||||
|
||||
@@ -260,6 +260,10 @@ private:
|
||||
float rc_scale_yaw;
|
||||
float rc_scale_flaps;
|
||||
|
||||
int rc_fs_ch;
|
||||
int rc_fs_mode;
|
||||
float rc_fs_thr;
|
||||
|
||||
float battery_voltage_scaling;
|
||||
|
||||
} _parameters; /**< local copies of interesting parameters */
|
||||
@@ -305,6 +309,10 @@ private:
|
||||
param_t rc_scale_yaw;
|
||||
param_t rc_scale_flaps;
|
||||
|
||||
param_t rc_fs_ch;
|
||||
param_t rc_fs_mode;
|
||||
param_t rc_fs_thr;
|
||||
|
||||
param_t battery_voltage_scaling;
|
||||
|
||||
param_t board_rotation;
|
||||
@@ -517,6 +525,11 @@ Sensors::Sensors() :
|
||||
_parameter_handles.rc_scale_yaw = param_find("RC_SCALE_YAW");
|
||||
_parameter_handles.rc_scale_flaps = param_find("RC_SCALE_FLAPS");
|
||||
|
||||
/* RC failsafe */
|
||||
_parameter_handles.rc_fs_ch = param_find("RC_FS_CH");
|
||||
_parameter_handles.rc_fs_mode = param_find("RC_FS_MODE");
|
||||
_parameter_handles.rc_fs_thr = param_find("RC_FS_THR");
|
||||
|
||||
/* gyro offsets */
|
||||
_parameter_handles.gyro_offset[0] = param_find("SENS_GYRO_XOFF");
|
||||
_parameter_handles.gyro_offset[1] = param_find("SENS_GYRO_YOFF");
|
||||
@@ -589,7 +602,7 @@ Sensors::parameters_update()
|
||||
float tmpRevFactor = 0.0f;
|
||||
|
||||
/* rc values */
|
||||
for (unsigned int i = 0; i < RC_CHANNELS_MAX; i++) {
|
||||
for (unsigned int i = 0; i < _rc_max_chan_count; i++) {
|
||||
|
||||
param_get(_parameter_handles.min[i], &(_parameters.min[i]));
|
||||
param_get(_parameter_handles.trim[i], &(_parameters.trim[i]));
|
||||
@@ -668,6 +681,9 @@ Sensors::parameters_update()
|
||||
param_get(_parameter_handles.rc_scale_pitch, &(_parameters.rc_scale_pitch));
|
||||
param_get(_parameter_handles.rc_scale_yaw, &(_parameters.rc_scale_yaw));
|
||||
param_get(_parameter_handles.rc_scale_flaps, &(_parameters.rc_scale_flaps));
|
||||
param_get(_parameter_handles.rc_fs_ch, &(_parameters.rc_fs_ch));
|
||||
param_get(_parameter_handles.rc_fs_mode, &(_parameters.rc_fs_mode));
|
||||
param_get(_parameter_handles.rc_fs_thr, &(_parameters.rc_fs_thr));
|
||||
|
||||
/* update RC function mappings */
|
||||
_rc.function[THROTTLE] = _parameters.rc_map_throttle - 1;
|
||||
@@ -1256,6 +1272,18 @@ Sensors::rc_poll()
|
||||
if (rc_input.channel_count < 4)
|
||||
return;
|
||||
|
||||
/* failsafe check */
|
||||
if (_parameters.rc_fs_ch != 0) {
|
||||
if (_parameters.rc_fs_mode == 0) {
|
||||
if (rc_input.values[_parameters.rc_fs_ch - 1] < _parameters.rc_fs_thr)
|
||||
return;
|
||||
|
||||
} else if (_parameters.rc_fs_mode == 1) {
|
||||
if (rc_input.values[_parameters.rc_fs_ch - 1] > _parameters.rc_fs_thr)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned channel_limit = rc_input.channel_count;
|
||||
|
||||
if (channel_limit > _rc_max_chan_count)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user