Commit 5297d77a authored by LM's avatar LM

Merge branch 'master' of github.com:mavlink/qgroundcontrol

parents 6a55b6cd cd49ed03
......@@ -3,7 +3,7 @@
CMakeFiles
*Makefile*
tags
build
build*/
Info.plist
obj
.DS_Store
......
......@@ -198,32 +198,25 @@ macx|macx-g++42|macx-g++: {
}
# GNU/Linux
linux-g++ {
linux-g++|linux-g++-64{
CONFIG -= console
debug {
#DESTDIR = $$TARGETDIR/debug
#CONFIG += debug console
}
release {
#DESTDIR = $$TARGETDIR/release
DEFINES += QT_NO_DEBUG
#CONFIG -= console
}
#QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
message("Compiling for linux 32")
INCLUDEPATH += /usr/include \
/usr/local/include \
/usr/include/qt4/phonon
message(Building for GNU/Linux 32bit/i386)
LIBS += \
-L/usr/lib \
-L/usr/local/lib64 \
......@@ -244,10 +237,16 @@ message("Compiling for linux 32")
-losgGA \
-losgDB \
-losgText \
-losgQt \
-lOpenThreads
DEFINES += QGC_OSG_ENABLED
}
exists(/usr/include/osg/osgQt) | exists(/usr/include/osgQt) |
exists(/usr/local/include/osg/osgQt) | exists(/usr/local/include/osgQt) {
message("Building support for OpenSceneGraph Qt")
# Include OpenSceneGraph Qt libraries
LIBS += -losgQt
DEFINES += QGC_OSG_QT_ENABLED
}
......@@ -272,8 +271,11 @@ message("Compiling for linux 32")
}
# Validated copy commands
!exists($$TARGETDIR){
QMAKE_POST_LINK += && mkdir -p $$TARGETDIR
}
DESTDIR = $$TARGETDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR
QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/images
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$TARGETDIR/images/Vera.ttf
......@@ -283,106 +285,14 @@ message("Compiling for linux 32")
QMAKE_CXXFLAGS += -Wl,-E
}
linux-g++ {
message("Building for GNU/Linux 32bit/i386")
}
linux-g++-64 {
CONFIG -= console
debug {
#DESTDIR = $$TARGETDIR/debug
#CONFIG += debug console
}
release {
#DESTDIR = $$TARGETDIR/release
DEFINES += QT_NO_DEBUG
#CONFIG -= console
}
#QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
INCLUDEPATH += /usr/include \
/usr/include/qt4/phonon
# 64-bit Linux
message(Building for GNU/Linux 64bit/x64 (g++-64))
LIBS += \
-L/usr/lib \
-L/usr/local/lib64 \
-lm \
-lflite_cmu_us_kal \
-lflite_usenglish \
-lflite_cmulex \
-lflite \
-lSDL \
-lSDLmain
exists(/usr/include/osg) | exists(/usr/local/include/osg) {
message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph libraries
LIBS += -losg \
-losgViewer \
-losgGA \
-losgDB \
-losgText \
-losgQt \
-lOpenThreads
message("Building for GNU/Linux 64bit/x64 (g++-64)")
exists(/usr/local/lib64) {
LIBS += -L/usr/local/lib64
}
DEFINES += QGC_OSG_ENABLED
DEFINES += QGC_OSG_QT_ENABLED
}
exists(/usr/local/include/google/protobuf) {
message("Building support for Protocol Buffers")
DEPENDENCIES_PRESENT += protobuf
# Include Protocol Buffers libraries
LIBS += -lprotobuf \
-lprotobuf-lite \
-lprotoc
DEFINES += QGC_PROTOBUF_ENABLED
}
exists(/usr/local/include/libfreenect) {
message("Building support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect
INCLUDEPATH += /usr/include/libusb-1.0
# Include libfreenect libraries
LIBS += -lfreenect
DEFINES += QGC_LIBFREENECT_ENABLED
LIBS += -L/usr/local/lib64
}
# Validated copy commands
debug {
!exists($$TARGETDIR/debug){
QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/debug
}
DESTDIR = $$TARGETDIR/debug
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/debug
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/debug
QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/debug/images
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$TARGETDIR/debug/images/Vera.ttf
}
release {
!exists($$TARGETDIR/release){
QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/release
}
DESTDIR = $$TARGETDIR/release
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/release
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/release
QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/release/images
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$TARGETDIR/release/images/Vera.ttf
}
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
QMAKE_CXXFLAGS += -Wl,-E
}
# Windows (32bit)
......
......@@ -32,14 +32,21 @@ QT += network \
TEMPLATE = app
TARGET = qgroundcontrol
BASEDIR = $${IN_PWD}
TARGETDIR = $${OUT_PWD}
BUILDDIR = $${TARGETDIR}/build
debug {
TARGETDIR = $${OUT_PWD}/debug
BUILDDIR = $${OUT_PWD}/build-debug
}
release {
TARGETDIR = $${OUT_PWD}/release
BUILDDIR = $${OUT_PWD}/build-release
}
LANGUAGE = C++
OBJECTS_DIR = $${BUILDDIR}/obj
MOC_DIR = $${BUILDDIR}/moc
UI_DIR = $${BUILDDIR}/ui
RCC_DIR = $${BUILDDIR}/rcc
MAVLINK_CONF = ""
MAVLINKPATH = $$BASEDIR/thirdParty/mavlink/include
DEFINES += MAVLINK_NO_DATA
win32 {
......@@ -87,58 +94,47 @@ exists(user_config.pri) {
message("Adding support for additional MAVLink messages for: " $$MAVLINK_CONF)
message("------------------------------------------------------------------------")
}
INCLUDEPATH += $$BASEDIR/../mavlink/include/common
INCLUDEPATH += $$BASEDIR/../mavlink/include
INCLUDEPATH += $$BASEDIR/thirdParty/mavlink/include/common
INCLUDEPATH += $$BASEDIR/thirdParty/mavlink/include
INCLUDEPATH += $$MAVLINKPATH/common
INCLUDEPATH += $$MAVLINKPATH
contains(MAVLINK_CONF, pixhawk) {
# Remove the default set - it is included anyway
INCLUDEPATH -= $$BASEDIR/../mavlink/include/common
INCLUDEPATH -= $$BASEDIR/thirdParty/mavlink/include/common
INCLUDEPATH -= $$MAVLINKPATH/common
# PIXHAWK SPECIAL MESSAGES
INCLUDEPATH += $$BASEDIR/../mavlink/include/pixhawk
INCLUDEPATH += $$BASEDIR/thirdParty/mavlink/include/pixhawk
INCLUDEPATH += $$MAVLINKPATH/pixhawk
DEFINES += QGC_USE_PIXHAWK_MESSAGES
}
contains(MAVLINK_CONF, slugs) {
# Remove the default set - it is included anyway
INCLUDEPATH -= $$BASEDIR/../mavlink/include/common
INCLUDEPATH -= $$BASEDIR/thirdParty/mavlink/include/common
INCLUDEPATH -= $$MAVLINKPATH/common
# SLUGS SPECIAL MESSAGES
INCLUDEPATH += $$BASEDIR/../mavlink/include/slugs
INCLUDEPATH += $$BASEDIR/thirdParty/mavlink/include/slugs
INCLUDEPATH += $$MAVLINKPATH/slugs
DEFINES += QGC_USE_SLUGS_MESSAGES
}
contains(MAVLINK_CONF, ualberta) {
# Remove the default set - it is included anyway
INCLUDEPATH -= $$BASEDIR/../mavlink/include/common
INCLUDEPATH -= $$BASEDIR/thirdParty/mavlink/include/common
INCLUDEPATH -= $$MAVLINKPATH/common
# UALBERTA SPECIAL MESSAGES
INCLUDEPATH += $$BASEDIR/../mavlink/include/ualberta
INCLUDEPATH += $$BASEDIR/thirdParty/mavlink/include/ualberta
INCLUDEPATH += $$MAVLINKPATH/ualberta
DEFINES += QGC_USE_UALBERTA_MESSAGES
}
contains(MAVLINK_CONF, ardupilotmega) {
# Remove the default set - it is included anyway
INCLUDEPATH -= $$BASEDIR/../mavlink/include/common
INCLUDEPATH -= $$MAVLINKPATH/common
INCLUDEPATH -= $$BASEDIR/thirdParty/mavlink/include/common
# UALBERTA SPECIAL MESSAGES
INCLUDEPATH += $$BASEDIR/../mavlink/include/ardupilotmega
INCLUDEPATH += $$BASEDIR/thirdParty/mavlink/include/ardupilotmega
INCLUDEPATH += $$MAVLINKPATH/ardupilotmega
DEFINES += QGC_USE_ARDUPILOTMEGA_MESSAGES
}
contains(MAVLINK_CONF, senseSoar) {
# Remove the default set - it is included anyway
INCLUDEPATH -= $$BASEDIR/../mavlink/include/common
INCLUDEPATH -= $$BASEDIR/thirdParty/mavlink/include/common
INCLUDEPATH -= $$MAVLINKPATH/common
# SENSESOAR SPECIAL MESSAGES
INCLUDEPATH += $$BASEDIR/../mavlink/include/SenseSoar
INCLUDEPATH += $$BASEDIR/thirdParty/mavlink/include/SenseSoar
INCLUDEPATH += $$MAVLINKPATH/SenseSoar
DEFINES += QGC_USE_SENSESOAR_MESSAGES
}
......@@ -149,6 +145,7 @@ contains(MAVLINK_CONF, senseSoar) {
include(qgroundcontrol.pri)
# Include MAVLink generator
# has been deprecated
DEPENDPATH += \
src/apps/mavlinkgen
......@@ -177,7 +174,7 @@ INCLUDEPATH += . \
src/libs/qextserialport
# Include serial port library (QSerial)
include(thirdParty/qserialport/qgroundcontrol-qserialport.pri)
include(qserialport.pri)
# Serial port detection (ripped-off from qextserialport library)
macx|macx-g++|macx-g++42::SOURCES += src/libs/qextserialport/qextserialenumerator_osx.cpp
......
######################################################################
# Automatically generated by qmake (2.01a) Sa. Apr 2 10:42:30 2011
######################################################################
QSERIALPORT_ROOT=thirdParty/qserialport
DEFINES += QSERIALPORT_STATIC
DEPENDPATH += . \
$$QSERIALPORT_ROOT/include/QtSerialPort \
$$QSERIALPORT_ROOT/src/common \
$$QSERIALPORT_ROOT/src/posix \
$$QSERIALPORT_ROOT/src/win32
INCLUDEPATH += $$QSERIALPORT_ROOT/include \
$$QSERIALPORT_ROOT/include/QtSerialPort \
$$QSERIALPORT_ROOT/src/posix \
$$QSERIALPORT_ROOT/src/win32
# Input
HEADERS += $$QSERIALPORT_ROOT/include/QtSerialPort/qportsettings.h \
$$QSERIALPORT_ROOT/include/QtSerialPort/qserialport.h \
$$QSERIALPORT_ROOT/include/QtSerialPort/qserialport_export.h \
$$QSERIALPORT_ROOT/include/QtSerialPort/qserialportnative.h
macx|linux-g++|linux-g++-64 {
HEADERS += $$QSERIALPORT_ROOT/src/posix/termioshelper.h
}
win32-msvc2008|win32-msvc2010|win32-g++ {
HEADERS += $$QSERIALPORT_ROOT/src/win32/commdcbhelper.h \
$$QSERIALPORT_ROOT/src/win32/qwincommevtnotifier.h \
$$QSERIALPORT_ROOT/src/win32/wincommevtbreaker.h \
$$QSERIALPORT_ROOT/src/win32/commdcbhelper.h \
$$QSERIALPORT_ROOT/src/win32/qwincommevtnotifier.h \
$$QSERIALPORT_ROOT/src/win32/wincommevtbreaker.h
}
SOURCES += $$QSERIALPORT_ROOT/src/common/qportsettings.cpp \
$$QSERIALPORT_ROOT/src/common/qserialport.cpp
macx|linux-g++|linux-g++-64 {
SOURCES += $$QSERIALPORT_ROOT/src/posix/qserialportnative_posix.cpp \
$$QSERIALPORT_ROOT/src/posix/termioshelper.cpp
}
win32-msvc2008|win32-msvc2010|win32-g++ {
SOURCES += $$QSERIALPORT_ROOT/src/win32/commdcbhelper.cpp \
$$QSERIALPORT_ROOT/src/win32/qserialportnative_win32.cpp \
$$QSERIALPORT_ROOT/src/win32/qwincommevtnotifier.cpp \
$$QSERIALPORT_ROOT/src/win32/wincommevtbreaker.cpp
}
......@@ -2329,7 +2329,9 @@ void UAS::shutdown()
void UAS::setTargetPosition(float x, float y, float z, float yaw)
{
mavlink_message_t msg;
mavlink_msg_command_long_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, uasId, MAV_COMP_ID_ALL, MAV_CMD_NAV_PATHPLANNING, 1, 2, 3, 0, yaw, x, y, z);
mavlink_msg_command_long_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, uasId, MAV_COMP_ID_ALL, MAV_CMD_NAV_PATHPLANNING, 1, 1, 0, 0, yaw, x, y, z);
sendMessage(msg);
mavlink_msg_command_long_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, uasId, MAV_COMP_ID_ALL, MAV_CMD_NAV_PATHPLANNING, 1, 0, 1, 0, yaw, x, y, z);
sendMessage(msg);
}
......
......@@ -35,8 +35,6 @@ QGCCommandButton::QGCCommandButton(QWidget *parent) :
ui->editLine2->setStyleSheet("QWidget { border: 1px solid #66666B; border-radius: 3px; padding: 10px 0px 0px 0px; background: #111122; }");
// Add commands to combo box
ui->editCommandComboBox->addItem("DO: Control Video", MAV_CMD_DO_CONTROL_VIDEO);
ui->editCommandComboBox->addItem("PREFLIGHT: Calibration", MAV_CMD_PREFLIGHT_CALIBRATION);
ui->editCommandComboBox->addItem("CUSTOM 0", 0);
ui->editCommandComboBox->addItem("CUSTOM 1", 1);
ui->editCommandComboBox->addItem("CUSTOM 2", 2);
......@@ -53,21 +51,35 @@ QGCCommandButton::QGCCommandButton(QWidget *parent) :
ui->editCommandComboBox->addItem("CUSTOM 13", 13);
ui->editCommandComboBox->addItem("CUSTOM 14", 14);
ui->editCommandComboBox->addItem("CUSTOM 15", 15);
ui->editCommandComboBox->addItem("NAV_WAYPOINT", 16);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_LOITER_UNLIM", 17);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_LOITER_TURNS", 18);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_LOITER_TIME", 19);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_RETURN_TO_LAUNCH", 20);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_LAND", 21);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_TAKEOFF", 22);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_ROI", 80);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_PATHPLANNING", 81);
ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_MODE", 176);
ui->editCommandComboBox->addItem("MAV_CMD_DO_CHANGE_SPEED", 178);
ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_HOME", 179);
ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_RELAY", 181);
ui->editCommandComboBox->addItem("MAV_CMD_DO_REPEAT_RELAY", 182);
ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_SERVO", 183);
ui->editCommandComboBox->addItem("NAV_WAYPOINT", MAV_CMD_NAV_WAYPOINT);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_LOITER_UNLIM", MAV_CMD_NAV_LOITER_UNLIM);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_LOITER_TURNS", MAV_CMD_NAV_LOITER_TURNS);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_LOITER_TIME", MAV_CMD_NAV_LOITER_TIME);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_RETURN_TO_LAUNCH", MAV_CMD_NAV_RETURN_TO_LAUNCH);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_LAND", MAV_CMD_NAV_LAND);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_TAKEOFF", MAV_CMD_NAV_TAKEOFF);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_ROI", MAV_CMD_NAV_ROI);
ui->editCommandComboBox->addItem("MAV_CMD_NAV_PATHPLANNING", MAV_CMD_NAV_PATHPLANNING);
ui->editCommandComboBox->addItem("MAV_CMD_CONDITION_CHANGE_ALT", MAV_CMD_CONDITION_CHANGE_ALT);
ui->editCommandComboBox->addItem("MAV_CMD_CONDITION_DISTANCE", MAV_CMD_CONDITION_DISTANCE);
ui->editCommandComboBox->addItem("MAV_CMD_CONDITION_YAW", MAV_CMD_CONDITION_YAW);
ui->editCommandComboBox->addItem("MAV_CMD_CONDITION_LAST", MAV_CMD_CONDITION_LAST);
ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_MODE", MAV_CMD_DO_SET_MODE);
ui->editCommandComboBox->addItem("MAV_CMD_DO_JUMP", MAV_CMD_DO_JUMP);
ui->editCommandComboBox->addItem("MAV_CMD_DO_CHANGE_SPEED", MAV_CMD_DO_CHANGE_SPEED);
ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_HOME", MAV_CMD_DO_SET_HOME);
ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_PARAMETER", MAV_CMD_DO_SET_PARAMETER);
ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_RELAY", MAV_CMD_DO_SET_RELAY);
ui->editCommandComboBox->addItem("MAV_CMD_DO_REPEAT_RELAY", MAV_CMD_DO_REPEAT_RELAY);
ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_SERVO", MAV_CMD_DO_SET_SERVO);
ui->editCommandComboBox->addItem("MAV_CMD_DO_REPEAT_SERVO", MAV_CMD_DO_REPEAT_SERVO);
ui->editCommandComboBox->addItem("MAV_CMD_DO_CONTROL_VIDEO", MAV_CMD_DO_CONTROL_VIDEO);
ui->editCommandComboBox->addItem("MAV_CMD_PREFLIGHT_CALIBRATION", MAV_CMD_PREFLIGHT_CALIBRATION);
ui->editCommandComboBox->addItem("MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS", MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS);
ui->editCommandComboBox->addItem("MAV_CMD_PREFLIGHT_STORAGE", MAV_CMD_PREFLIGHT_STORAGE);
ui->editCommandComboBox->addItem("MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN", MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN);
ui->editCommandComboBox->addItem("MAV_CMD_OVERRIDE_GOTO", MAV_CMD_OVERRIDE_GOTO);
ui->editCommandComboBox->addItem("MAV_CMD_MISSION_START", MAV_CMD_MISSION_START);
ui->editCommandComboBox->setEditable(true);
}
......@@ -78,22 +90,37 @@ QGCCommandButton::~QGCCommandButton()
void QGCCommandButton::sendCommand()
{
if (QGCToolWidgetItem::uas) {
int index = ui->editCommandComboBox->itemData(ui->editCommandComboBox->currentIndex()).toInt();
MAV_CMD command = static_cast<MAV_CMD>(index);
int confirm = (ui->editConfirmationCheckBox->isChecked()) ? 1 : 0;
float param1 = ui->editParam1SpinBox->value();
float param2 = ui->editParam2SpinBox->value();
float param3 = ui->editParam3SpinBox->value();
float param4 = ui->editParam4SpinBox->value();
float param5 = ui->editParam5SpinBox->value();
float param6 = ui->editParam6SpinBox->value();
float param7 = ui->editParam7SpinBox->value();
int component = ui->editComponentSpinBox->value();
QGCToolWidgetItem::uas->executeCommand(command, confirm, param1, param2, param3, param4, param5, param6, param7, component);
qDebug() << __FILE__ << __LINE__ << "SENDING COMMAND" << index;
} else {
if (QGCToolWidgetItem::uas)
{
// Check if command text is a number
bool ok;
int index = 0;
index = ui->editCommandComboBox->currentText().toInt(&ok);
if (!ok)
{
// Command was not a number, assume it was one of the text items
index = ui->editCommandComboBox->itemData(ui->editCommandComboBox->currentIndex()).toInt(&ok);
if (ok)
{
// Text item found, proceed
MAV_CMD command = static_cast<MAV_CMD>(index);
int confirm = (ui->editConfirmationCheckBox->isChecked()) ? 1 : 0;
float param1 = ui->editParam1SpinBox->value();
float param2 = ui->editParam2SpinBox->value();
float param3 = ui->editParam3SpinBox->value();
float param4 = ui->editParam4SpinBox->value();
float param5 = ui->editParam5SpinBox->value();
float param6 = ui->editParam6SpinBox->value();
float param7 = ui->editParam7SpinBox->value();
int component = ui->editComponentSpinBox->value();
QGCToolWidgetItem::uas->executeCommand(command, confirm, param1, param2, param3, param4, param5, param6, param7, component);
qDebug() << __FILE__ << __LINE__ << "SENDING COMMAND" << index;
}
}
}
else
{
qDebug() << __FILE__ << __LINE__ << "NO UAS SET, DOING NOTHING";
}
}
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>882</width>
<width>1183</width>
<height>430</height>
</rect>
</property>
......@@ -27,7 +27,11 @@
<number>3</number>
</property>
<item row="7" column="0" colspan="3">
<widget class="QComboBox" name="editCommandComboBox"/>
<widget class="QComboBox" name="editCommandComboBox">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QPushButton" name="editFinishButton">
......
......@@ -3,7 +3,8 @@
#include <QStringList>
GlobalViewParams::GlobalViewParams()
: mDisplayWorldGrid(true)
: mDisplayTerrain(true)
, mDisplayWorldGrid(true)
, mImageryType(Imagery::BLANK_MAP)
, mFollowCameraId(-1)
, mFrame(MAV_FRAME_LOCAL_NED)
......@@ -11,6 +12,18 @@ GlobalViewParams::GlobalViewParams()
}
bool&
GlobalViewParams::displayTerrain(void)
{
return mDisplayTerrain;
}
bool
GlobalViewParams::displayTerrain(void) const
{
return mDisplayTerrain;
}
bool&
GlobalViewParams::displayWorldGrid(void)
{
......@@ -113,3 +126,16 @@ GlobalViewParams::toggleWorldGrid(int state)
mDisplayWorldGrid = false;
}
}
void
GlobalViewParams::toggleTerrain(int state)
{
if (state == Qt::Checked)
{
mDisplayTerrain = true;
}
else
{
mDisplayTerrain = false;
}
}
......@@ -15,6 +15,9 @@ class GlobalViewParams : public QObject
public:
GlobalViewParams();
bool& displayTerrain(void);
bool displayTerrain(void) const;
bool& displayWorldGrid(void);
bool displayWorldGrid(void) const;
......@@ -31,12 +34,14 @@ public slots:
void followCameraChanged(const QString& text);
void frameChanged(const QString &text);
void imageryTypeChanged(int index);
void toggleTerrain(int state);
void toggleWorldGrid(int state);
signals:
void followCameraChanged(int systemId);
private:
bool mDisplayTerrain;
bool mDisplayWorldGrid;
Imagery::Type mImageryType;
int mFollowCameraId;
......
......@@ -163,10 +163,21 @@ Pixhawk3DWidget::localPositionChanged(UASInterface* uas, int component,
systemData.trailIndexMap().insert(component,
systemData.trailMap().size() - 1);
osg::Vec4 color((float)qrand() / RAND_MAX,
(float)qrand() / RAND_MAX,
(float)qrand() / RAND_MAX,
0.5);
// generate nice bright random color
float golden_ratio_conjugate = 0.618033988749895f;
float h = (float)qrand() / RAND_MAX + golden_ratio_conjugate;
if (h > 1.0f)
{
h -= 1.0f;
}
QColor colorHSV;
colorHSV.setHsvF(h, 0.99, 0.99, 0.5);
QColor colorRGB = colorHSV.toRgb();
osg::Vec4f color(colorRGB.redF(), colorRGB.greenF(), colorRGB.blueF(), colorRGB.alphaF());
systemData.trailNode()->addDrawable(createTrail(color));
systemData.trailNode()->addDrawable(createLink(uas->getColor()));
......@@ -374,6 +385,24 @@ Pixhawk3DWidget::setpointChanged(int uasId, float x, float y, float z,
}
}
void
Pixhawk3DWidget::clearData(void)
{
QMutableMapIterator<int, SystemContainer> it(mSystemContainerMap);
while (it.hasNext())
{
it.next();
SystemContainer& systemData = it.value();
// clear setpoint data
systemData.setpointGroupNode()->removeChildren(0, systemData.setpointGroupNode()->getNumChildren());
// clear trail data
systemData.trailMap().clear();
}
}
void
Pixhawk3DWidget::showViewParamWindow(void)
{
......@@ -459,6 +488,39 @@ Pixhawk3DWidget::setBirdEyeView(void)
m3DWidget->setCameraDistance(100.0);
}
void
Pixhawk3DWidget::loadTerrainModel(void)
{
QString filename = QFileDialog::getOpenFileName(this, "Load Terrain Model",
QDesktopServices::storageLocation(QDesktopServices::DesktopLocation),
tr("Collada (*.dae)"));
if (filename.isNull())
{
return;
}
osg::ref_ptr<osg::Node> node =
osgDB::readNodeFile(filename.toStdString().c_str());
if (node)
{
if (mTerrainNode.get())
{
m3DWidget->worldMap()->removeChild(mTerrainNode);
}
mTerrainNode = node;
m3DWidget->worldMap()->addChild(mTerrainNode);
}
else
{
QMessageBox msgBox(QMessageBox::Warning,
"Error loading model",
QString("Error: Unable to load terrain model (%1).").arg(filename));
msgBox.exec();
}
}
void
Pixhawk3DWidget::selectTargetHeading(void)
{
......@@ -773,6 +835,8 @@ Pixhawk3DWidget::update(void)
MAV_FRAME frame = mGlobalViewParams->frame();
// set node visibility
m3DWidget->worldMap()->setChildValue(mTerrainNode,
mGlobalViewParams->displayTerrain());
m3DWidget->worldMap()->setChildValue(mWorldGridNode,
mGlobalViewParams->displayWorldGrid());
if (mGlobalViewParams->imageryType() == Imagery::BLANK_MAP)
......@@ -991,12 +1055,16 @@ Pixhawk3DWidget::addModels(QVector< osg::ref_ptr<osg::Node> >& models,
void
Pixhawk3DWidget::buildLayout(void)
{
QPushButton* clearDataButton = new QPushButton(this);
clearDataButton->setText("Clear Data");
QPushButton* viewParamWindowButton = new QPushButton(this);
viewParamWindowButton->setCheckable(true);
viewParamWindowButton->setText("View Parameters");
QHBoxLayout* layoutTop = new QHBoxLayout;
layoutTop->addItem(new QSpacerItem(10, 0, QSizePolicy::Expanding, QSizePolicy::Expanding));
layoutTop->addWidget(clearDataButton);
layoutTop->addWidget(viewParamWindowButton);
QPushButton* recenterButton = new QPushButton(this);
......@@ -1005,10 +1073,14 @@ Pixhawk3DWidget::buildLayout(void)
QPushButton* birdEyeViewButton = new QPushButton(this);
birdEyeViewButton->setText("Bird's Eye View");
QPushButton* loadTerrainModelButton = new QPushButton(this);
loadTerrainModelButton->setText("Load Terrain Model");
QHBoxLayout* layoutBottom = new QHBoxLayout;
layoutBottom->addWidget(recenterButton);
layoutBottom->addWidget(birdEyeViewButton);
layoutBottom->addItem(new QSpacerItem(10, 0, QSizePolicy::Expanding, QSizePolicy::Expanding));
layoutBottom->addWidget(loadTerrainModelButton);
QGridLayout* layout = new QGridLayout(this);
layout->setMargin(0);
......@@ -1020,12 +1092,16 @@ Pixhawk3DWidget::buildLayout(void)
layout->setRowStretch(1, 100);
layout->setRowStretch(2, 1);
connect(clearDataButton, SIGNAL(clicked()),
this, SLOT(clearData()));
connect(viewParamWindowButton, SIGNAL(clicked()),
this, SLOT(showViewParamWindow()));
connect(recenterButton, SIGNAL(clicked()),
this, SLOT(recenterActiveCamera()));
connect(birdEyeViewButton, SIGNAL(clicked()),
this, SLOT(setBirdEyeView()));
connect(loadTerrainModelButton, SIGNAL(clicked()),
this, SLOT(loadTerrainModel()));
}
void
......
......@@ -66,11 +66,13 @@ signals:
void systemCreatedSignal(UASInterface* uas);
private slots:
void clearData(void);
void showViewParamWindow(void);
void followCameraChanged(int systemId);
void recenterActiveCamera(void);
void modelChanged(int systemId, int index);
void setBirdEyeView(void);
void loadTerrainModel(void);
void selectTargetHeading(void);
void selectTarget(void);
......@@ -195,6 +197,7 @@ private:
osg::ref_ptr<Imagery> mImageryNode;
osg::ref_ptr<HUDScaleGeode> mScaleGeode;
osg::ref_ptr<osgText::Text> mStatusText;
osg::ref_ptr<osg::Node> mTerrainNode;
osg::ref_ptr<osg::Geode> mWorldGridNode;
QPoint mCachedMousePos;
......
......@@ -84,6 +84,9 @@ ViewParamWidget::buildLayout(QVBoxLayout* layout)
imageryComboBox->addItem("Map (Google)");
imageryComboBox->addItem("Satellite (Google)");
QCheckBox* terrainModelCheckBox = new QCheckBox(this);
terrainModelCheckBox->setChecked(mGlobalViewParams->displayTerrain());
QCheckBox* worldGridCheckBox = new QCheckBox(this);
worldGridCheckBox->setChecked(mGlobalViewParams->displayWorldGrid());
......@@ -101,6 +104,7 @@ ViewParamWidget::buildLayout(QVBoxLayout* layout)
formLayout->addRow(tr("Follow Camera"), mFollowCameraComboBox);
formLayout->addRow(tr("Frame"), frameComboBox);
formLayout->addRow(tr("Imagery"), imageryComboBox);
formLayout->addRow(tr("Terrain"), terrainModelCheckBox);
formLayout->addRow(tr("World Grid"), worldGridCheckBox);
layout->addLayout(formLayout);
......@@ -113,6 +117,8 @@ ViewParamWidget::buildLayout(QVBoxLayout* layout)
mGlobalViewParams.data(), SLOT(frameChanged(const QString&)));
connect(imageryComboBox, SIGNAL(currentIndexChanged(int)),
mGlobalViewParams.data(), SLOT(imageryTypeChanged(int)));
connect(terrainModelCheckBox, SIGNAL(stateChanged(int)),
mGlobalViewParams.data(), SLOT(toggleTerrain(int)));
connect(worldGridCheckBox, SIGNAL(stateChanged(int)),
mGlobalViewParams.data(), SLOT(toggleWorldGrid(int)));
}
......
#!/bin/bash
QSERIAL_TAG=004e3de552fe25fee593dfcb03e2ffa82cb0b152
MAVLINK_VERSION=1.0.0
PS3='Please enter your choice: '
LIST="all mavlink qserialport end"
echo
echo this script grabs upstream releases
echo
libList="mavlink qserialport"
topDir=$PWD
function fetch_qserialport
{
echo
rm -rf qserialport
git clone git://gitorious.org/inbiza-labs/qserialport.git
rm -rf qserialport/.git
}
function fetch_mavlink
function fetch_git
{
echo
rm -rf mavlink
git clone git@github.com:openmav/mavlink.git
rm -rf mavlink/.git
name=$1
url=$2
tag=$4
echo
echo updating: $name @ $url to tag $tag
cd $topDir
rm -rf $name
git clone $url
cd $name && git checkout $tag && rm -rf .git
cd $topDir
}
echo
select OPT in $LIST
do
case $OPT in
function processLib
{
lib=$1
case $lib in
"qserialport")
fetch_qserialport
exit 0
fetch_git qserialport git://gitorious.org/inbiza-labs/qserialport.git master $QSERIAL_TAG
;;
"mavlink")
fetch_mavlink
exit 0
rm -rf mavlink
mavlinkName=mavlink-$MAVLINK_VERSION-Linux
wget https://github.com/downloads/mavlink/mavlink/$mavlinkName.tar.gz
tar -xzvf $mavlinkName.tar.gz
mv $mavlinkName/usr/local/include/mavlink mavlink
rm -rf $mavlinkName
rm -rf $mavlinkName.tar.gz
;;
"all")
fetch_mavlink
fetch_qserialport
for lib in $libList
do
$0 $lib
done
exit 0
;;
"exit")
exit 0
;;
*)
echo unknown option
echo unknown lib, possiblities are: $libList
exit 1
esac
done
}
if [ $# == 0 ]
then
#menu
echo This script grabs upstream releases.
PS3='Please enter your choice: '
select OPT in $libList all exit
do
processLib $OPT
done
elif [ $# == 1 ]
then
lib=$1
processLib $lib
else
echo usage: $0 lib
fi
*~
doc/html
doc/*.log
missionlib/testing/*.xcodeproj/*
This diff is collapsed.
MAVLink Micro Air Vehicle Message Marshalling Library
The mavlink_to_html_table.xsl file is used to transform the MAVLink XML into a human-readable HTML table for online documentation.
For more information, please visit:
http://pixhawk.ethz.ch/software/mavlink
(c) 2009-2010 Lorenz Meier / PIXHAWK Team
table.sortable {
spacing: 5px;
border: 1px solid #656575;
width: 100%;
}
table.sortable th {
margin: 5px;
}
tr:nth-child(odd) { background-color:#eee; }
tr:nth-child(even) { background-color:#fff; }
table.sortable thead {
background-color:#eee;
color:#666666;
font-weight: bold;
cursor: default;
}
table.sortable td {
margin: 5px 5px 20px 5px;
vertical-align: top;
}
table.sortable td.mavlink_name {
color:#226633;
font-weight: bold;
width: 25%;
vertical-align: top;
}
table.sortable td.mavlink_mission_param {
color:#334455;
font-weight: bold;
width: 25%;
}
table.sortable td.mavlink_type {
color:#323232;
font-weight: normal;
width: 12%;
}
table.sortable td.mavlink_comment {
color:#555555;
font-weight: normal;
width: 60%;
}
p.description {
color:#808080;
font-weight: normal;
}
\ No newline at end of file
<?php>
// Requires the installation of php5-xsl
// e.g. on Debian/Ubuntu: sudo apt-get install php5-xsl
// Load the file from the repository / server.
// Update this URL if the file location changes
$xml_file_name = "http://github.com/pixhawk/mavlink/raw/master/mavlink_standard_message.xml";
// Load the XSL transformation file from the repository / server.
// This file can be updated by any client to adjust the table
$xsl_file_name= "http://github.com/pixhawk/mavlink/raw/master/doc/mavlink_to_html_table.xsl";
// Load data XML file
$xml = file_get_contents($xml_file_name);
$xml_doc = new DomDocument;
$xml_doc->loadXML($xml);
// Load stylesheet XSL file
$xsl = file_get_contents($xsl_file_name);
$xsl_doc = new DomDocument;
$xsl_doc->loadXML($xsl);
$xsltproc = new XsltProcessor();
$xsltproc->importStylesheet($xsl_doc);
// process the files and write the output to $out_file
if ($html = $xsltproc->transformToXML($xml_doc))
{
echo $html;
}
else
{
trigger_error('XSL transformation failed.',E_USER_ERROR);
}
</php>
<h2> Messages XML Definition </h2>
Messages are defined by the <a href="http://github.com/pixhawk/mavlink/blob/master/mavlink_standard_message.xml">mavlink_standard_message.xml</a> file. The C packing/unpacking code is generated from this specification, as well as the HTML documentaiton in the section above.<br />
<br />
<i>The XML displayed here is updated on every commit and therefore up-to-date.</i>
<?php>
//require_once("inc/geshi.php");
//$xml_file_name = "http://github.com/pixhawk/mavlink/raw/master/mavlink_standard_message.xml";
//
//// Load data XML file
//$xml = file_get_contents($xml_file_name);
//
//// Show the current code
//$geshi_xml = new GeSHi($xml, 'xml');
//$display_xml = $geshi_xml->parse_code();
//
//echo $display_xml;
</php>
\ No newline at end of file
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="//include">
<h1>MAVLink Include Files</h1>
<p><strong><em>Including files: </em><xsl:value-of select="." /></strong></p>
</xsl:template>
<xsl:template match="//enums">
<h1>MAVLink Type Enumerations</h1>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="//messages">
<h1>MAVLink Messages</h1>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="//message">
<h3 class="mavlink_message_name"><xsl:value-of select="@name" /> (#<xsl:value-of select="@id" />)</h3>
<p class="description"><xsl:value-of select="description" /></p>
<table class="sortable">
<thead>
<tr>
<th class="mavlink_field_header">Field Name</th>
<th class="mavlink_field_header">Type</th>
<th class="mavlink_field_header">Description</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="field" />
</tbody>
</table>
</xsl:template>
<xsl:template match="//field">
<tr class="mavlink_field">
<td class="mavlink_name" valign="top"><xsl:value-of select="@name" /></td>
<td class="mavlink_type" valign="top"><xsl:value-of select="@type" /></td>
<td class="mavlink_comment"><xsl:value-of select="." /></td>
</tr>
</xsl:template>
<xsl:template match="//version">
<h1>MAVLink Protocol Version</h1>
<p>This file has protocol version: <xsl:value-of select="." />. The version numbers range from 1-255.</p>
</xsl:template>
<xsl:template match="//enum">
<h3 class="mavlink_message_name"><xsl:value-of select="@name" /></h3>
<p class="description"><xsl:value-of select="description" /></p>
<table class="sortable">
<thead>
<tr>
<th class="mavlink_field_header">CMD ID</th>
<th class="mavlink_field_header">Field Name</th>
<th class="mavlink_field_header">Description</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="entry" />
</tbody>
</table>
</xsl:template>
<xsl:template match="//entry">
<tr class="mavlink_field">
<td class="mavlink_type" valign="top"><xsl:value-of select="@value" /></td>
<td class="mavlink_name" valign="top"><xsl:value-of select="@name" /></td>
<td class="mavlink_comment"><xsl:value-of select="description" /></td>
</tr>
<tr>
<td></td>
<xsl:apply-templates select="param" />
</tr>
<tr>
<td colspan="3"><br /></td>
</tr>
</xsl:template>
<xsl:template match="//param">
<tr>
<td></td>
<td class="mavlink_mission_param" valign="top">Mission Param #<xsl:value-of select="@index" /></td>
<td class="mavlink_comment"><xsl:value-of select="." /></td>
</tr>
</xsl:template>
</xsl:stylesheet>
A more detailed version of this quickstart is available at:
http://qgroundcontrol.org/dev/mavlink_linux_integration_tutorial
MAVLINK UDP QUICKSTART INSTRUCTIONS
===================================
MAVLink UDP Example for *nix system (Linux, MacOS, BSD, etc.)
To compile with GCC, just enter:
gcc -I ../../include/common -o mavlink_udp mavlink_udp.c
To run, type:
./mavlink_udp
If you run QGroundControl on the same machine, a MAV should pop up.
/*******************************************************************************
Copyright (C) 2010 Bryan Godbolt godbolt ( a t ) ualberta.ca
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
/*
This program sends some data to qgroundcontrol using the mavlink protocol. The sent packets
cause qgroundcontrol to respond with heartbeats. Any settings or custom commands sent from
qgroundcontrol are printed by this program along with the heartbeats.
I compiled this program sucessfully on Ubuntu 10.04 with the following command
gcc -I ../../pixhawk/mavlink/include -o udp-server udp-server-test.c
the rt library is needed for the clock_gettime on linux
*/
/* These headers are for QNX, but should all be standard on unix/linux */
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#if (defined __QNX__) | (defined __QNXNTO__)
/* QNX specific headers */
#include <unix.h>
#else
/* Linux / MacOS POSIX timer headers */
#include <sys/time.h>
#include <time.h>
#include <arpa/inet.h>
#endif
/* This assumes you have the mavlink headers on your include path
or in the same folder as this source file */
#include <mavlink.h>
#define BUFFER_LENGTH 2041 // minimum buffer size that can be used with qnx (I don't know why)
uint64_t microsSinceEpoch();
int main(int argc, char* argv[])
{
char help[] = "--help";
char target_ip[100];
float position[6] = {};
int sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
struct sockaddr_in gcAddr;
struct sockaddr_in locAddr;
//struct sockaddr_in fromAddr;
uint8_t buf[BUFFER_LENGTH];
ssize_t recsize;
socklen_t fromlen;
int bytes_sent;
mavlink_message_t msg;
uint16_t len;
int i = 0;
//int success = 0;
unsigned int temp = 0;
// Check if --help flag was used
if ((argc == 2) && (strcmp(argv[1], help) == 0))
{
printf("\n");
printf("\tUsage:\n\n");
printf("\t");
printf("%s", argv[0]);
printf(" <ip address of QGroundControl>\n");
printf("\tDefault for localhost: udp-server 127.0.0.1\n\n");
exit(EXIT_FAILURE);
}
// Change the target ip if parameter was given
strcpy(target_ip, "127.0.0.1");
if (argc == 2)
{
strcpy(target_ip, argv[1]);
}
memset(&locAddr, 0, sizeof(locAddr));
locAddr.sin_family = AF_INET;
locAddr.sin_addr.s_addr = INADDR_ANY;
locAddr.sin_port = htons(14551);
/* Bind the socket to port 14551 - necessary to receive packets from qgroundcontrol */
if (-1 == bind(sock,(struct sockaddr *)&locAddr, sizeof(struct sockaddr)))
{
perror("error bind failed");
close(sock);
exit(EXIT_FAILURE);
}
/* Attempt to make it non blocking */
if (fcntl(sock, F_SETFL, O_NONBLOCK | FASYNC) < 0)
{
fprintf(stderr, "error setting nonblocking: %s\n", strerror(errno));
close(sock);
exit(EXIT_FAILURE);
}
memset(&gcAddr, 0, sizeof(gcAddr));
gcAddr.sin_family = AF_INET;
gcAddr.sin_addr.s_addr = inet_addr(target_ip);
gcAddr.sin_port = htons(14550);
for (;;)
{
/*Send Heartbeat */
mavlink_msg_heartbeat_pack(1, 200, &msg, MAV_TYPE_HELICOPTER, MAV_AUTOPILOT_GENERIC, MAV_MODE_GUIDED_ARMED, 0, MAV_STATE_ACTIVE);
len = mavlink_msg_to_send_buffer(buf, &msg);
bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof(struct sockaddr_in));
/* Send Status */
mavlink_msg_sys_status_pack(1, 200, &msg, 0, 0, 0, 500, 11000, -1, -1, 0, 0, 0, 0, 0, 0);
len = mavlink_msg_to_send_buffer(buf, &msg);
bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof (struct sockaddr_in));
/* Send Local Position */
mavlink_msg_local_position_ned_pack(1, 200, &msg, microsSinceEpoch(),
position[0], position[1], position[2],
position[3], position[4], position[5]);
len = mavlink_msg_to_send_buffer(buf, &msg);
bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof(struct sockaddr_in));
/* Send attitude */
mavlink_msg_attitude_pack(1, 200, &msg, microsSinceEpoch(), 1.2, 1.7, 3.14, 0.01, 0.02, 0.03);
len = mavlink_msg_to_send_buffer(buf, &msg);
bytes_sent = sendto(sock, buf, len, 0, (struct sockaddr*)&gcAddr, sizeof(struct sockaddr_in));
memset(buf, 0, BUFFER_LENGTH);
recsize = recvfrom(sock, (void *)buf, BUFFER_LENGTH, 0, (struct sockaddr *)&gcAddr, &fromlen);
if (recsize > 0)
{
// Something received - print out all bytes and parse packet
mavlink_message_t msg;
mavlink_status_t status;
printf("Bytes Received: %d\nDatagram: ", (int)recsize);
for (i = 0; i < recsize; ++i)
{
temp = buf[i];
printf("%02x ", (unsigned char)temp);
if (mavlink_parse_char(MAVLINK_COMM_0, buf[i], &msg, &status))
{
// Packet received
printf("\nReceived packet: SYS: %d, COMP: %d, LEN: %d, MSG ID: %d\n", msg.sysid, msg.compid, msg.len, msg.msgid);
}
}
printf("\n");
}
memset(buf, 0, BUFFER_LENGTH);
sleep(1); // Sleep one second
}
}
/* QNX timer version */
#if (defined __QNX__) | (defined __QNXNTO__)
uint64_t microsSinceEpoch()
{
struct timespec time;
uint64_t micros = 0;
clock_gettime(CLOCK_REALTIME, &time);
micros = (uint64_t)time.tv_sec * 100000 + time.tv_nsec/1000;
return micros;
}
#else
uint64_t microsSinceEpoch()
{
struct timeval tv;
uint64_t micros = 0;
gettimeofday(&tv, NULL);
micros = ((uint64_t)tv.tv_sec) * 1000000 + tv.tv_usec;
return micros;
}
#endif
#!/bin/bash
# this script generates all the include files with pymavlink
# settings
wireProtocol=1.0
pymavlinkTag=51f3d6713e9a5b94c232ab9bf9d08095a0c97866
# download pymavlink
topDir=$PWD
rm -rf include
rm -rf pymavlink
git clone https://github.com/mavlink/pymavlink.git -b master pymavlink
cd pymavlink && git checkout $pymavlinkTag && rm -rf .git
# generate includes using message definitions
cd $topDir
for file in $(find message_definitions -name "*.xml")
do
echo generating mavlink includes for definition: $file
./pymavlink/generator/mavgen.py --lang=C --wire-protocol=$wireProtocol --output=include $file
done
# cleanup
rm -rf pymavlink
This diff is collapsed.
/** @file
* @brief MAVLink comm protocol built from sensesoar.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#ifndef MAVLINK_STX
#define MAVLINK_STX 254
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 1
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 1
#endif
#include "version.h"
#include "sensesoar.h"
#endif // MAVLINK_H
// MESSAGE CMD_AIRSPEED_ACK PACKING
#define MAVLINK_MSG_ID_CMD_AIRSPEED_ACK 194
typedef struct __mavlink_cmd_airspeed_ack_t
{
float spCmd; ///< commanded airspeed
uint8_t ack; ///< 0:ack, 1:nack
} mavlink_cmd_airspeed_ack_t;
#define MAVLINK_MSG_ID_CMD_AIRSPEED_ACK_LEN 5
#define MAVLINK_MSG_ID_194_LEN 5
#define MAVLINK_MESSAGE_INFO_CMD_AIRSPEED_ACK { \
"CMD_AIRSPEED_ACK", \
2, \
{ { "spCmd", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_cmd_airspeed_ack_t, spCmd) }, \
{ "ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_cmd_airspeed_ack_t, ack) }, \
} \
}
/**
* @brief Pack a cmd_airspeed_ack message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param spCmd commanded airspeed
* @param ack 0:ack, 1:nack
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_cmd_airspeed_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float spCmd, uint8_t ack)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[5];
_mav_put_float(buf, 0, spCmd);
_mav_put_uint8_t(buf, 4, ack);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5);
#else
mavlink_cmd_airspeed_ack_t packet;
packet.spCmd = spCmd;
packet.ack = ack;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5);
#endif
msg->msgid = MAVLINK_MSG_ID_CMD_AIRSPEED_ACK;
return mavlink_finalize_message(msg, system_id, component_id, 5, 243);
}
/**
* @brief Pack a cmd_airspeed_ack message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into
* @param spCmd commanded airspeed
* @param ack 0:ack, 1:nack
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_cmd_airspeed_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float spCmd,uint8_t ack)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[5];
_mav_put_float(buf, 0, spCmd);
_mav_put_uint8_t(buf, 4, ack);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5);
#else
mavlink_cmd_airspeed_ack_t packet;
packet.spCmd = spCmd;
packet.ack = ack;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5);
#endif
msg->msgid = MAVLINK_MSG_ID_CMD_AIRSPEED_ACK;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 5, 243);
}
/**
* @brief Encode a cmd_airspeed_ack struct into a 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 cmd_airspeed_ack C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_cmd_airspeed_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_cmd_airspeed_ack_t* cmd_airspeed_ack)
{
return mavlink_msg_cmd_airspeed_ack_pack(system_id, component_id, msg, cmd_airspeed_ack->spCmd, cmd_airspeed_ack->ack);
}
/**
* @brief Send a cmd_airspeed_ack message
* @param chan MAVLink channel to send the message
*
* @param spCmd commanded airspeed
* @param ack 0:ack, 1:nack
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_cmd_airspeed_ack_send(mavlink_channel_t chan, float spCmd, uint8_t ack)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[5];
_mav_put_float(buf, 0, spCmd);
_mav_put_uint8_t(buf, 4, ack);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CMD_AIRSPEED_ACK, buf, 5, 243);
#else
mavlink_cmd_airspeed_ack_t packet;
packet.spCmd = spCmd;
packet.ack = ack;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CMD_AIRSPEED_ACK, (const char *)&packet, 5, 243);
#endif
}
#endif
// MESSAGE CMD_AIRSPEED_ACK UNPACKING
/**
* @brief Get field spCmd from cmd_airspeed_ack message
*
* @return commanded airspeed
*/
static inline float mavlink_msg_cmd_airspeed_ack_get_spCmd(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field ack from cmd_airspeed_ack message
*
* @return 0:ack, 1:nack
*/
static inline uint8_t mavlink_msg_cmd_airspeed_ack_get_ack(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Decode a cmd_airspeed_ack message into a struct
*
* @param msg The message to decode
* @param cmd_airspeed_ack C-struct to decode the message contents into
*/
static inline void mavlink_msg_cmd_airspeed_ack_decode(const mavlink_message_t* msg, mavlink_cmd_airspeed_ack_t* cmd_airspeed_ack)
{
#if MAVLINK_NEED_BYTE_SWAP
cmd_airspeed_ack->spCmd = mavlink_msg_cmd_airspeed_ack_get_spCmd(msg);
cmd_airspeed_ack->ack = mavlink_msg_cmd_airspeed_ack_get_ack(msg);
#else
memcpy(cmd_airspeed_ack, _MAV_PAYLOAD(msg), 5);
#endif
}
// MESSAGE CMD_AIRSPEED_CHNG PACKING
#define MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG 192
typedef struct __mavlink_cmd_airspeed_chng_t
{
float spCmd; ///< commanded airspeed
uint8_t target; ///< Target ID
} mavlink_cmd_airspeed_chng_t;
#define MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG_LEN 5
#define MAVLINK_MSG_ID_192_LEN 5
#define MAVLINK_MESSAGE_INFO_CMD_AIRSPEED_CHNG { \
"CMD_AIRSPEED_CHNG", \
2, \
{ { "spCmd", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_cmd_airspeed_chng_t, spCmd) }, \
{ "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_cmd_airspeed_chng_t, target) }, \
} \
}
/**
* @brief Pack a cmd_airspeed_chng 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 Target ID
* @param spCmd commanded airspeed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_cmd_airspeed_chng_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target, float spCmd)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[5];
_mav_put_float(buf, 0, spCmd);
_mav_put_uint8_t(buf, 4, target);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5);
#else
mavlink_cmd_airspeed_chng_t packet;
packet.spCmd = spCmd;
packet.target = target;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5);
#endif
msg->msgid = MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG;
return mavlink_finalize_message(msg, system_id, component_id, 5, 209);
}
/**
* @brief Pack a cmd_airspeed_chng 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target Target ID
* @param spCmd commanded airspeed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_cmd_airspeed_chng_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target,float spCmd)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[5];
_mav_put_float(buf, 0, spCmd);
_mav_put_uint8_t(buf, 4, target);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 5);
#else
mavlink_cmd_airspeed_chng_t packet;
packet.spCmd = spCmd;
packet.target = target;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 5);
#endif
msg->msgid = MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 5, 209);
}
/**
* @brief Encode a cmd_airspeed_chng struct into a 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 cmd_airspeed_chng C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_cmd_airspeed_chng_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_cmd_airspeed_chng_t* cmd_airspeed_chng)
{
return mavlink_msg_cmd_airspeed_chng_pack(system_id, component_id, msg, cmd_airspeed_chng->target, cmd_airspeed_chng->spCmd);
}
/**
* @brief Send a cmd_airspeed_chng message
* @param chan MAVLink channel to send the message
*
* @param target Target ID
* @param spCmd commanded airspeed
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_cmd_airspeed_chng_send(mavlink_channel_t chan, uint8_t target, float spCmd)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[5];
_mav_put_float(buf, 0, spCmd);
_mav_put_uint8_t(buf, 4, target);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG, buf, 5, 209);
#else
mavlink_cmd_airspeed_chng_t packet;
packet.spCmd = spCmd;
packet.target = target;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG, (const char *)&packet, 5, 209);
#endif
}
#endif
// MESSAGE CMD_AIRSPEED_CHNG UNPACKING
/**
* @brief Get field target from cmd_airspeed_chng message
*
* @return Target ID
*/
static inline uint8_t mavlink_msg_cmd_airspeed_chng_get_target(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field spCmd from cmd_airspeed_chng message
*
* @return commanded airspeed
*/
static inline float mavlink_msg_cmd_airspeed_chng_get_spCmd(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Decode a cmd_airspeed_chng message into a struct
*
* @param msg The message to decode
* @param cmd_airspeed_chng C-struct to decode the message contents into
*/
static inline void mavlink_msg_cmd_airspeed_chng_decode(const mavlink_message_t* msg, mavlink_cmd_airspeed_chng_t* cmd_airspeed_chng)
{
#if MAVLINK_NEED_BYTE_SWAP
cmd_airspeed_chng->spCmd = mavlink_msg_cmd_airspeed_chng_get_spCmd(msg);
cmd_airspeed_chng->target = mavlink_msg_cmd_airspeed_chng_get_target(msg);
#else
memcpy(cmd_airspeed_chng, _MAV_PAYLOAD(msg), 5);
#endif
}
// MESSAGE FILT_ROT_VEL PACKING
#define MAVLINK_MSG_ID_FILT_ROT_VEL 184
typedef struct __mavlink_filt_rot_vel_t
{
float rotVel[3]; ///< rotational velocity
} mavlink_filt_rot_vel_t;
#define MAVLINK_MSG_ID_FILT_ROT_VEL_LEN 12
#define MAVLINK_MSG_ID_184_LEN 12
#define MAVLINK_MSG_FILT_ROT_VEL_FIELD_ROTVEL_LEN 3
#define MAVLINK_MESSAGE_INFO_FILT_ROT_VEL { \
"FILT_ROT_VEL", \
1, \
{ { "rotVel", NULL, MAVLINK_TYPE_FLOAT, 3, 0, offsetof(mavlink_filt_rot_vel_t, rotVel) }, \
} \
}
/**
* @brief Pack a filt_rot_vel 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 rotVel rotational velocity
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_filt_rot_vel_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const float *rotVel)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float_array(buf, 0, rotVel, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_filt_rot_vel_t packet;
mav_array_memcpy(packet.rotVel, rotVel, sizeof(float)*3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_FILT_ROT_VEL;
return mavlink_finalize_message(msg, system_id, component_id, 12, 79);
}
/**
* @brief Pack a filt_rot_vel 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param rotVel rotational velocity
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_filt_rot_vel_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
const float *rotVel)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float_array(buf, 0, rotVel, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_filt_rot_vel_t packet;
mav_array_memcpy(packet.rotVel, rotVel, sizeof(float)*3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_FILT_ROT_VEL;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 79);
}
/**
* @brief Encode a filt_rot_vel struct into a 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 filt_rot_vel C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_filt_rot_vel_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_filt_rot_vel_t* filt_rot_vel)
{
return mavlink_msg_filt_rot_vel_pack(system_id, component_id, msg, filt_rot_vel->rotVel);
}
/**
* @brief Send a filt_rot_vel message
* @param chan MAVLink channel to send the message
*
* @param rotVel rotational velocity
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_filt_rot_vel_send(mavlink_channel_t chan, const float *rotVel)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float_array(buf, 0, rotVel, 3);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILT_ROT_VEL, buf, 12, 79);
#else
mavlink_filt_rot_vel_t packet;
mav_array_memcpy(packet.rotVel, rotVel, sizeof(float)*3);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILT_ROT_VEL, (const char *)&packet, 12, 79);
#endif
}
#endif
// MESSAGE FILT_ROT_VEL UNPACKING
/**
* @brief Get field rotVel from filt_rot_vel message
*
* @return rotational velocity
*/
static inline uint16_t mavlink_msg_filt_rot_vel_get_rotVel(const mavlink_message_t* msg, float *rotVel)
{
return _MAV_RETURN_float_array(msg, rotVel, 3, 0);
}
/**
* @brief Decode a filt_rot_vel message into a struct
*
* @param msg The message to decode
* @param filt_rot_vel C-struct to decode the message contents into
*/
static inline void mavlink_msg_filt_rot_vel_decode(const mavlink_message_t* msg, mavlink_filt_rot_vel_t* filt_rot_vel)
{
#if MAVLINK_NEED_BYTE_SWAP
mavlink_msg_filt_rot_vel_get_rotVel(msg, filt_rot_vel->rotVel);
#else
memcpy(filt_rot_vel, _MAV_PAYLOAD(msg), 12);
#endif
}
// MESSAGE LLC_OUT PACKING
#define MAVLINK_MSG_ID_LLC_OUT 186
typedef struct __mavlink_llc_out_t
{
int16_t servoOut[4]; ///< Servo signal
int16_t MotorOut[2]; ///< motor signal
} mavlink_llc_out_t;
#define MAVLINK_MSG_ID_LLC_OUT_LEN 12
#define MAVLINK_MSG_ID_186_LEN 12
#define MAVLINK_MSG_LLC_OUT_FIELD_SERVOOUT_LEN 4
#define MAVLINK_MSG_LLC_OUT_FIELD_MOTOROUT_LEN 2
#define MAVLINK_MESSAGE_INFO_LLC_OUT { \
"LLC_OUT", \
2, \
{ { "servoOut", NULL, MAVLINK_TYPE_INT16_T, 4, 0, offsetof(mavlink_llc_out_t, servoOut) }, \
{ "MotorOut", NULL, MAVLINK_TYPE_INT16_T, 2, 8, offsetof(mavlink_llc_out_t, MotorOut) }, \
} \
}
/**
* @brief Pack a llc_out 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 servoOut Servo signal
* @param MotorOut motor signal
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_llc_out_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const int16_t *servoOut, const int16_t *MotorOut)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_int16_t_array(buf, 0, servoOut, 4);
_mav_put_int16_t_array(buf, 8, MotorOut, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_llc_out_t packet;
mav_array_memcpy(packet.servoOut, servoOut, sizeof(int16_t)*4);
mav_array_memcpy(packet.MotorOut, MotorOut, sizeof(int16_t)*2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_LLC_OUT;
return mavlink_finalize_message(msg, system_id, component_id, 12, 5);
}
/**
* @brief Pack a llc_out 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param servoOut Servo signal
* @param MotorOut motor signal
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_llc_out_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
const int16_t *servoOut,const int16_t *MotorOut)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_int16_t_array(buf, 0, servoOut, 4);
_mav_put_int16_t_array(buf, 8, MotorOut, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_llc_out_t packet;
mav_array_memcpy(packet.servoOut, servoOut, sizeof(int16_t)*4);
mav_array_memcpy(packet.MotorOut, MotorOut, sizeof(int16_t)*2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_LLC_OUT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 5);
}
/**
* @brief Encode a llc_out struct into a 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 llc_out C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_llc_out_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_llc_out_t* llc_out)
{
return mavlink_msg_llc_out_pack(system_id, component_id, msg, llc_out->servoOut, llc_out->MotorOut);
}
/**
* @brief Send a llc_out message
* @param chan MAVLink channel to send the message
*
* @param servoOut Servo signal
* @param MotorOut motor signal
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_llc_out_send(mavlink_channel_t chan, const int16_t *servoOut, const int16_t *MotorOut)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_int16_t_array(buf, 0, servoOut, 4);
_mav_put_int16_t_array(buf, 8, MotorOut, 2);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LLC_OUT, buf, 12, 5);
#else
mavlink_llc_out_t packet;
mav_array_memcpy(packet.servoOut, servoOut, sizeof(int16_t)*4);
mav_array_memcpy(packet.MotorOut, MotorOut, sizeof(int16_t)*2);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LLC_OUT, (const char *)&packet, 12, 5);
#endif
}
#endif
// MESSAGE LLC_OUT UNPACKING
/**
* @brief Get field servoOut from llc_out message
*
* @return Servo signal
*/
static inline uint16_t mavlink_msg_llc_out_get_servoOut(const mavlink_message_t* msg, int16_t *servoOut)
{
return _MAV_RETURN_int16_t_array(msg, servoOut, 4, 0);
}
/**
* @brief Get field MotorOut from llc_out message
*
* @return motor signal
*/
static inline uint16_t mavlink_msg_llc_out_get_MotorOut(const mavlink_message_t* msg, int16_t *MotorOut)
{
return _MAV_RETURN_int16_t_array(msg, MotorOut, 2, 8);
}
/**
* @brief Decode a llc_out message into a struct
*
* @param msg The message to decode
* @param llc_out C-struct to decode the message contents into
*/
static inline void mavlink_msg_llc_out_decode(const mavlink_message_t* msg, mavlink_llc_out_t* llc_out)
{
#if MAVLINK_NEED_BYTE_SWAP
mavlink_msg_llc_out_get_servoOut(msg, llc_out->servoOut);
mavlink_msg_llc_out_get_MotorOut(msg, llc_out->MotorOut);
#else
memcpy(llc_out, _MAV_PAYLOAD(msg), 12);
#endif
}
// MESSAGE OBS_AIR_TEMP PACKING
#define MAVLINK_MSG_ID_OBS_AIR_TEMP 183
typedef struct __mavlink_obs_air_temp_t
{
float airT; ///< Air Temperatur
} mavlink_obs_air_temp_t;
#define MAVLINK_MSG_ID_OBS_AIR_TEMP_LEN 4
#define MAVLINK_MSG_ID_183_LEN 4
#define MAVLINK_MESSAGE_INFO_OBS_AIR_TEMP { \
"OBS_AIR_TEMP", \
1, \
{ { "airT", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_obs_air_temp_t, airT) }, \
} \
}
/**
* @brief Pack a obs_air_temp 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 airT Air Temperatur
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_air_temp_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float airT)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_float(buf, 0, airT);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_obs_air_temp_t packet;
packet.airT = airT;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_AIR_TEMP;
return mavlink_finalize_message(msg, system_id, component_id, 4, 248);
}
/**
* @brief Pack a obs_air_temp 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param airT Air Temperatur
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_air_temp_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float airT)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_float(buf, 0, airT);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_obs_air_temp_t packet;
packet.airT = airT;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_AIR_TEMP;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 248);
}
/**
* @brief Encode a obs_air_temp struct into a 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 obs_air_temp C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_obs_air_temp_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_air_temp_t* obs_air_temp)
{
return mavlink_msg_obs_air_temp_pack(system_id, component_id, msg, obs_air_temp->airT);
}
/**
* @brief Send a obs_air_temp message
* @param chan MAVLink channel to send the message
*
* @param airT Air Temperatur
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_obs_air_temp_send(mavlink_channel_t chan, float airT)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_float(buf, 0, airT);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_AIR_TEMP, buf, 4, 248);
#else
mavlink_obs_air_temp_t packet;
packet.airT = airT;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_AIR_TEMP, (const char *)&packet, 4, 248);
#endif
}
#endif
// MESSAGE OBS_AIR_TEMP UNPACKING
/**
* @brief Get field airT from obs_air_temp message
*
* @return Air Temperatur
*/
static inline float mavlink_msg_obs_air_temp_get_airT(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Decode a obs_air_temp message into a struct
*
* @param msg The message to decode
* @param obs_air_temp C-struct to decode the message contents into
*/
static inline void mavlink_msg_obs_air_temp_decode(const mavlink_message_t* msg, mavlink_obs_air_temp_t* obs_air_temp)
{
#if MAVLINK_NEED_BYTE_SWAP
obs_air_temp->airT = mavlink_msg_obs_air_temp_get_airT(msg);
#else
memcpy(obs_air_temp, _MAV_PAYLOAD(msg), 4);
#endif
}
// MESSAGE OBS_AIR_VELOCITY PACKING
#define MAVLINK_MSG_ID_OBS_AIR_VELOCITY 178
typedef struct __mavlink_obs_air_velocity_t
{
float magnitude; ///< Air speed
float aoa; ///< angle of attack
float slip; ///< slip angle
} mavlink_obs_air_velocity_t;
#define MAVLINK_MSG_ID_OBS_AIR_VELOCITY_LEN 12
#define MAVLINK_MSG_ID_178_LEN 12
#define MAVLINK_MESSAGE_INFO_OBS_AIR_VELOCITY { \
"OBS_AIR_VELOCITY", \
3, \
{ { "magnitude", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_obs_air_velocity_t, magnitude) }, \
{ "aoa", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_obs_air_velocity_t, aoa) }, \
{ "slip", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_obs_air_velocity_t, slip) }, \
} \
}
/**
* @brief Pack a obs_air_velocity 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 magnitude Air speed
* @param aoa angle of attack
* @param slip slip angle
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_air_velocity_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float magnitude, float aoa, float slip)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float(buf, 0, magnitude);
_mav_put_float(buf, 4, aoa);
_mav_put_float(buf, 8, slip);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_obs_air_velocity_t packet;
packet.magnitude = magnitude;
packet.aoa = aoa;
packet.slip = slip;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_AIR_VELOCITY;
return mavlink_finalize_message(msg, system_id, component_id, 12, 32);
}
/**
* @brief Pack a obs_air_velocity 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param magnitude Air speed
* @param aoa angle of attack
* @param slip slip angle
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_air_velocity_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float magnitude,float aoa,float slip)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float(buf, 0, magnitude);
_mav_put_float(buf, 4, aoa);
_mav_put_float(buf, 8, slip);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_obs_air_velocity_t packet;
packet.magnitude = magnitude;
packet.aoa = aoa;
packet.slip = slip;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_AIR_VELOCITY;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 32);
}
/**
* @brief Encode a obs_air_velocity struct into a 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 obs_air_velocity C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_obs_air_velocity_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_air_velocity_t* obs_air_velocity)
{
return mavlink_msg_obs_air_velocity_pack(system_id, component_id, msg, obs_air_velocity->magnitude, obs_air_velocity->aoa, obs_air_velocity->slip);
}
/**
* @brief Send a obs_air_velocity message
* @param chan MAVLink channel to send the message
*
* @param magnitude Air speed
* @param aoa angle of attack
* @param slip slip angle
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_obs_air_velocity_send(mavlink_channel_t chan, float magnitude, float aoa, float slip)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float(buf, 0, magnitude);
_mav_put_float(buf, 4, aoa);
_mav_put_float(buf, 8, slip);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_AIR_VELOCITY, buf, 12, 32);
#else
mavlink_obs_air_velocity_t packet;
packet.magnitude = magnitude;
packet.aoa = aoa;
packet.slip = slip;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_AIR_VELOCITY, (const char *)&packet, 12, 32);
#endif
}
#endif
// MESSAGE OBS_AIR_VELOCITY UNPACKING
/**
* @brief Get field magnitude from obs_air_velocity message
*
* @return Air speed
*/
static inline float mavlink_msg_obs_air_velocity_get_magnitude(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field aoa from obs_air_velocity message
*
* @return angle of attack
*/
static inline float mavlink_msg_obs_air_velocity_get_aoa(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field slip from obs_air_velocity message
*
* @return slip angle
*/
static inline float mavlink_msg_obs_air_velocity_get_slip(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Decode a obs_air_velocity message into a struct
*
* @param msg The message to decode
* @param obs_air_velocity C-struct to decode the message contents into
*/
static inline void mavlink_msg_obs_air_velocity_decode(const mavlink_message_t* msg, mavlink_obs_air_velocity_t* obs_air_velocity)
{
#if MAVLINK_NEED_BYTE_SWAP
obs_air_velocity->magnitude = mavlink_msg_obs_air_velocity_get_magnitude(msg);
obs_air_velocity->aoa = mavlink_msg_obs_air_velocity_get_aoa(msg);
obs_air_velocity->slip = mavlink_msg_obs_air_velocity_get_slip(msg);
#else
memcpy(obs_air_velocity, _MAV_PAYLOAD(msg), 12);
#endif
}
// MESSAGE OBS_ATTITUDE PACKING
#define MAVLINK_MSG_ID_OBS_ATTITUDE 174
typedef struct __mavlink_obs_attitude_t
{
double quat[4]; ///< Quaternion re;im
} mavlink_obs_attitude_t;
#define MAVLINK_MSG_ID_OBS_ATTITUDE_LEN 32
#define MAVLINK_MSG_ID_174_LEN 32
#define MAVLINK_MSG_OBS_ATTITUDE_FIELD_QUAT_LEN 4
#define MAVLINK_MESSAGE_INFO_OBS_ATTITUDE { \
"OBS_ATTITUDE", \
1, \
{ { "quat", NULL, MAVLINK_TYPE_DOUBLE, 4, 0, offsetof(mavlink_obs_attitude_t, quat) }, \
} \
}
/**
* @brief Pack a obs_attitude message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param quat Quaternion re;im
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_attitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const double *quat)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_double_array(buf, 0, quat, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_obs_attitude_t packet;
mav_array_memcpy(packet.quat, quat, sizeof(double)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_ATTITUDE;
return mavlink_finalize_message(msg, system_id, component_id, 32, 146);
}
/**
* @brief Pack a obs_attitude message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into
* @param quat Quaternion re;im
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_attitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
const double *quat)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_double_array(buf, 0, quat, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_obs_attitude_t packet;
mav_array_memcpy(packet.quat, quat, sizeof(double)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_ATTITUDE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 146);
}
/**
* @brief Encode a obs_attitude struct into a 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 obs_attitude C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_obs_attitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_attitude_t* obs_attitude)
{
return mavlink_msg_obs_attitude_pack(system_id, component_id, msg, obs_attitude->quat);
}
/**
* @brief Send a obs_attitude message
* @param chan MAVLink channel to send the message
*
* @param quat Quaternion re;im
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_obs_attitude_send(mavlink_channel_t chan, const double *quat)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_double_array(buf, 0, quat, 4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_ATTITUDE, buf, 32, 146);
#else
mavlink_obs_attitude_t packet;
mav_array_memcpy(packet.quat, quat, sizeof(double)*4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_ATTITUDE, (const char *)&packet, 32, 146);
#endif
}
#endif
// MESSAGE OBS_ATTITUDE UNPACKING
/**
* @brief Get field quat from obs_attitude message
*
* @return Quaternion re;im
*/
static inline uint16_t mavlink_msg_obs_attitude_get_quat(const mavlink_message_t* msg, double *quat)
{
return _MAV_RETURN_double_array(msg, quat, 4, 0);
}
/**
* @brief Decode a obs_attitude message into a struct
*
* @param msg The message to decode
* @param obs_attitude C-struct to decode the message contents into
*/
static inline void mavlink_msg_obs_attitude_decode(const mavlink_message_t* msg, mavlink_obs_attitude_t* obs_attitude)
{
#if MAVLINK_NEED_BYTE_SWAP
mavlink_msg_obs_attitude_get_quat(msg, obs_attitude->quat);
#else
memcpy(obs_attitude, _MAV_PAYLOAD(msg), 32);
#endif
}
// MESSAGE OBS_BIAS PACKING
#define MAVLINK_MSG_ID_OBS_BIAS 180
typedef struct __mavlink_obs_bias_t
{
float accBias[3]; ///< accelerometer bias
float gyroBias[3]; ///< gyroscope bias
} mavlink_obs_bias_t;
#define MAVLINK_MSG_ID_OBS_BIAS_LEN 24
#define MAVLINK_MSG_ID_180_LEN 24
#define MAVLINK_MSG_OBS_BIAS_FIELD_ACCBIAS_LEN 3
#define MAVLINK_MSG_OBS_BIAS_FIELD_GYROBIAS_LEN 3
#define MAVLINK_MESSAGE_INFO_OBS_BIAS { \
"OBS_BIAS", \
2, \
{ { "accBias", NULL, MAVLINK_TYPE_FLOAT, 3, 0, offsetof(mavlink_obs_bias_t, accBias) }, \
{ "gyroBias", NULL, MAVLINK_TYPE_FLOAT, 3, 12, offsetof(mavlink_obs_bias_t, gyroBias) }, \
} \
}
/**
* @brief Pack a obs_bias 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 accBias accelerometer bias
* @param gyroBias gyroscope bias
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_bias_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const float *accBias, const float *gyroBias)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_float_array(buf, 0, accBias, 3);
_mav_put_float_array(buf, 12, gyroBias, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 24);
#else
mavlink_obs_bias_t packet;
mav_array_memcpy(packet.accBias, accBias, sizeof(float)*3);
mav_array_memcpy(packet.gyroBias, gyroBias, sizeof(float)*3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 24);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_BIAS;
return mavlink_finalize_message(msg, system_id, component_id, 24, 159);
}
/**
* @brief Pack a obs_bias 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param accBias accelerometer bias
* @param gyroBias gyroscope bias
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_bias_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
const float *accBias,const float *gyroBias)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_float_array(buf, 0, accBias, 3);
_mav_put_float_array(buf, 12, gyroBias, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 24);
#else
mavlink_obs_bias_t packet;
mav_array_memcpy(packet.accBias, accBias, sizeof(float)*3);
mav_array_memcpy(packet.gyroBias, gyroBias, sizeof(float)*3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 24);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_BIAS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 24, 159);
}
/**
* @brief Encode a obs_bias struct into a 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 obs_bias C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_obs_bias_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_bias_t* obs_bias)
{
return mavlink_msg_obs_bias_pack(system_id, component_id, msg, obs_bias->accBias, obs_bias->gyroBias);
}
/**
* @brief Send a obs_bias message
* @param chan MAVLink channel to send the message
*
* @param accBias accelerometer bias
* @param gyroBias gyroscope bias
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_obs_bias_send(mavlink_channel_t chan, const float *accBias, const float *gyroBias)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_float_array(buf, 0, accBias, 3);
_mav_put_float_array(buf, 12, gyroBias, 3);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_BIAS, buf, 24, 159);
#else
mavlink_obs_bias_t packet;
mav_array_memcpy(packet.accBias, accBias, sizeof(float)*3);
mav_array_memcpy(packet.gyroBias, gyroBias, sizeof(float)*3);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_BIAS, (const char *)&packet, 24, 159);
#endif
}
#endif
// MESSAGE OBS_BIAS UNPACKING
/**
* @brief Get field accBias from obs_bias message
*
* @return accelerometer bias
*/
static inline uint16_t mavlink_msg_obs_bias_get_accBias(const mavlink_message_t* msg, float *accBias)
{
return _MAV_RETURN_float_array(msg, accBias, 3, 0);
}
/**
* @brief Get field gyroBias from obs_bias message
*
* @return gyroscope bias
*/
static inline uint16_t mavlink_msg_obs_bias_get_gyroBias(const mavlink_message_t* msg, float *gyroBias)
{
return _MAV_RETURN_float_array(msg, gyroBias, 3, 12);
}
/**
* @brief Decode a obs_bias message into a struct
*
* @param msg The message to decode
* @param obs_bias C-struct to decode the message contents into
*/
static inline void mavlink_msg_obs_bias_decode(const mavlink_message_t* msg, mavlink_obs_bias_t* obs_bias)
{
#if MAVLINK_NEED_BYTE_SWAP
mavlink_msg_obs_bias_get_accBias(msg, obs_bias->accBias);
mavlink_msg_obs_bias_get_gyroBias(msg, obs_bias->gyroBias);
#else
memcpy(obs_bias, _MAV_PAYLOAD(msg), 24);
#endif
}
// MESSAGE OBS_POSITION PACKING
#define MAVLINK_MSG_ID_OBS_POSITION 170
typedef struct __mavlink_obs_position_t
{
int32_t lon; ///< Longitude expressed in 1E7
int32_t lat; ///< Latitude expressed in 1E7
int32_t alt; ///< Altitude expressed in milimeters
} mavlink_obs_position_t;
#define MAVLINK_MSG_ID_OBS_POSITION_LEN 12
#define MAVLINK_MSG_ID_170_LEN 12
#define MAVLINK_MESSAGE_INFO_OBS_POSITION { \
"OBS_POSITION", \
3, \
{ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_obs_position_t, lon) }, \
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_obs_position_t, lat) }, \
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_obs_position_t, alt) }, \
} \
}
/**
* @brief Pack a obs_position message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param lon Longitude expressed in 1E7
* @param lat Latitude expressed in 1E7
* @param alt Altitude expressed in milimeters
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
int32_t lon, int32_t lat, int32_t alt)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_int32_t(buf, 0, lon);
_mav_put_int32_t(buf, 4, lat);
_mav_put_int32_t(buf, 8, alt);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_obs_position_t packet;
packet.lon = lon;
packet.lat = lat;
packet.alt = alt;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_POSITION;
return mavlink_finalize_message(msg, system_id, component_id, 12, 15);
}
/**
* @brief Pack a obs_position message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into
* @param lon Longitude expressed in 1E7
* @param lat Latitude expressed in 1E7
* @param alt Altitude expressed in milimeters
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
int32_t lon,int32_t lat,int32_t alt)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_int32_t(buf, 0, lon);
_mav_put_int32_t(buf, 4, lat);
_mav_put_int32_t(buf, 8, alt);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_obs_position_t packet;
packet.lon = lon;
packet.lat = lat;
packet.alt = alt;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_POSITION;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 15);
}
/**
* @brief Encode a obs_position struct into a 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 obs_position C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_obs_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_position_t* obs_position)
{
return mavlink_msg_obs_position_pack(system_id, component_id, msg, obs_position->lon, obs_position->lat, obs_position->alt);
}
/**
* @brief Send a obs_position message
* @param chan MAVLink channel to send the message
*
* @param lon Longitude expressed in 1E7
* @param lat Latitude expressed in 1E7
* @param alt Altitude expressed in milimeters
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_obs_position_send(mavlink_channel_t chan, int32_t lon, int32_t lat, int32_t alt)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_int32_t(buf, 0, lon);
_mav_put_int32_t(buf, 4, lat);
_mav_put_int32_t(buf, 8, alt);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_POSITION, buf, 12, 15);
#else
mavlink_obs_position_t packet;
packet.lon = lon;
packet.lat = lat;
packet.alt = alt;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_POSITION, (const char *)&packet, 12, 15);
#endif
}
#endif
// MESSAGE OBS_POSITION UNPACKING
/**
* @brief Get field lon from obs_position message
*
* @return Longitude expressed in 1E7
*/
static inline int32_t mavlink_msg_obs_position_get_lon(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 0);
}
/**
* @brief Get field lat from obs_position message
*
* @return Latitude expressed in 1E7
*/
static inline int32_t mavlink_msg_obs_position_get_lat(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 4);
}
/**
* @brief Get field alt from obs_position message
*
* @return Altitude expressed in milimeters
*/
static inline int32_t mavlink_msg_obs_position_get_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 8);
}
/**
* @brief Decode a obs_position message into a struct
*
* @param msg The message to decode
* @param obs_position C-struct to decode the message contents into
*/
static inline void mavlink_msg_obs_position_decode(const mavlink_message_t* msg, mavlink_obs_position_t* obs_position)
{
#if MAVLINK_NEED_BYTE_SWAP
obs_position->lon = mavlink_msg_obs_position_get_lon(msg);
obs_position->lat = mavlink_msg_obs_position_get_lat(msg);
obs_position->alt = mavlink_msg_obs_position_get_alt(msg);
#else
memcpy(obs_position, _MAV_PAYLOAD(msg), 12);
#endif
}
// MESSAGE OBS_QFF PACKING
#define MAVLINK_MSG_ID_OBS_QFF 182
typedef struct __mavlink_obs_qff_t
{
float qff; ///< Wind
} mavlink_obs_qff_t;
#define MAVLINK_MSG_ID_OBS_QFF_LEN 4
#define MAVLINK_MSG_ID_182_LEN 4
#define MAVLINK_MESSAGE_INFO_OBS_QFF { \
"OBS_QFF", \
1, \
{ { "qff", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_obs_qff_t, qff) }, \
} \
}
/**
* @brief Pack a obs_qff 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 qff Wind
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_qff_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float qff)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_float(buf, 0, qff);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_obs_qff_t packet;
packet.qff = qff;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_QFF;
return mavlink_finalize_message(msg, system_id, component_id, 4, 24);
}
/**
* @brief Pack a obs_qff 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param qff Wind
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_qff_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float qff)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_float(buf, 0, qff);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_obs_qff_t packet;
packet.qff = qff;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_QFF;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 24);
}
/**
* @brief Encode a obs_qff struct into a 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 obs_qff C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_obs_qff_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_qff_t* obs_qff)
{
return mavlink_msg_obs_qff_pack(system_id, component_id, msg, obs_qff->qff);
}
/**
* @brief Send a obs_qff message
* @param chan MAVLink channel to send the message
*
* @param qff Wind
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_obs_qff_send(mavlink_channel_t chan, float qff)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_float(buf, 0, qff);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_QFF, buf, 4, 24);
#else
mavlink_obs_qff_t packet;
packet.qff = qff;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_QFF, (const char *)&packet, 4, 24);
#endif
}
#endif
// MESSAGE OBS_QFF UNPACKING
/**
* @brief Get field qff from obs_qff message
*
* @return Wind
*/
static inline float mavlink_msg_obs_qff_get_qff(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Decode a obs_qff message into a struct
*
* @param msg The message to decode
* @param obs_qff C-struct to decode the message contents into
*/
static inline void mavlink_msg_obs_qff_decode(const mavlink_message_t* msg, mavlink_obs_qff_t* obs_qff)
{
#if MAVLINK_NEED_BYTE_SWAP
obs_qff->qff = mavlink_msg_obs_qff_get_qff(msg);
#else
memcpy(obs_qff, _MAV_PAYLOAD(msg), 4);
#endif
}
// MESSAGE OBS_VELOCITY PACKING
#define MAVLINK_MSG_ID_OBS_VELOCITY 172
typedef struct __mavlink_obs_velocity_t
{
float vel[3]; ///< Velocity
} mavlink_obs_velocity_t;
#define MAVLINK_MSG_ID_OBS_VELOCITY_LEN 12
#define MAVLINK_MSG_ID_172_LEN 12
#define MAVLINK_MSG_OBS_VELOCITY_FIELD_VEL_LEN 3
#define MAVLINK_MESSAGE_INFO_OBS_VELOCITY { \
"OBS_VELOCITY", \
1, \
{ { "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 0, offsetof(mavlink_obs_velocity_t, vel) }, \
} \
}
/**
* @brief Pack a obs_velocity 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 vel Velocity
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_velocity_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const float *vel)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float_array(buf, 0, vel, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_obs_velocity_t packet;
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_VELOCITY;
return mavlink_finalize_message(msg, system_id, component_id, 12, 108);
}
/**
* @brief Pack a obs_velocity 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param vel Velocity
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_velocity_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
const float *vel)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float_array(buf, 0, vel, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_obs_velocity_t packet;
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_VELOCITY;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 108);
}
/**
* @brief Encode a obs_velocity struct into a 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 obs_velocity C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_obs_velocity_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_velocity_t* obs_velocity)
{
return mavlink_msg_obs_velocity_pack(system_id, component_id, msg, obs_velocity->vel);
}
/**
* @brief Send a obs_velocity message
* @param chan MAVLink channel to send the message
*
* @param vel Velocity
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_obs_velocity_send(mavlink_channel_t chan, const float *vel)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float_array(buf, 0, vel, 3);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_VELOCITY, buf, 12, 108);
#else
mavlink_obs_velocity_t packet;
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_VELOCITY, (const char *)&packet, 12, 108);
#endif
}
#endif
// MESSAGE OBS_VELOCITY UNPACKING
/**
* @brief Get field vel from obs_velocity message
*
* @return Velocity
*/
static inline uint16_t mavlink_msg_obs_velocity_get_vel(const mavlink_message_t* msg, float *vel)
{
return _MAV_RETURN_float_array(msg, vel, 3, 0);
}
/**
* @brief Decode a obs_velocity message into a struct
*
* @param msg The message to decode
* @param obs_velocity C-struct to decode the message contents into
*/
static inline void mavlink_msg_obs_velocity_decode(const mavlink_message_t* msg, mavlink_obs_velocity_t* obs_velocity)
{
#if MAVLINK_NEED_BYTE_SWAP
mavlink_msg_obs_velocity_get_vel(msg, obs_velocity->vel);
#else
memcpy(obs_velocity, _MAV_PAYLOAD(msg), 12);
#endif
}
// MESSAGE OBS_WIND PACKING
#define MAVLINK_MSG_ID_OBS_WIND 176
typedef struct __mavlink_obs_wind_t
{
float wind[3]; ///< Wind
} mavlink_obs_wind_t;
#define MAVLINK_MSG_ID_OBS_WIND_LEN 12
#define MAVLINK_MSG_ID_176_LEN 12
#define MAVLINK_MSG_OBS_WIND_FIELD_WIND_LEN 3
#define MAVLINK_MESSAGE_INFO_OBS_WIND { \
"OBS_WIND", \
1, \
{ { "wind", NULL, MAVLINK_TYPE_FLOAT, 3, 0, offsetof(mavlink_obs_wind_t, wind) }, \
} \
}
/**
* @brief Pack a obs_wind 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 wind Wind
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_wind_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const float *wind)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float_array(buf, 0, wind, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_obs_wind_t packet;
mav_array_memcpy(packet.wind, wind, sizeof(float)*3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_WIND;
return mavlink_finalize_message(msg, system_id, component_id, 12, 16);
}
/**
* @brief Pack a obs_wind 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param wind Wind
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_obs_wind_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
const float *wind)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float_array(buf, 0, wind, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_obs_wind_t packet;
mav_array_memcpy(packet.wind, wind, sizeof(float)*3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_OBS_WIND;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 16);
}
/**
* @brief Encode a obs_wind struct into a 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 obs_wind C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_obs_wind_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_obs_wind_t* obs_wind)
{
return mavlink_msg_obs_wind_pack(system_id, component_id, msg, obs_wind->wind);
}
/**
* @brief Send a obs_wind message
* @param chan MAVLink channel to send the message
*
* @param wind Wind
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_obs_wind_send(mavlink_channel_t chan, const float *wind)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_float_array(buf, 0, wind, 3);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_WIND, buf, 12, 16);
#else
mavlink_obs_wind_t packet;
mav_array_memcpy(packet.wind, wind, sizeof(float)*3);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OBS_WIND, (const char *)&packet, 12, 16);
#endif
}
#endif
// MESSAGE OBS_WIND UNPACKING
/**
* @brief Get field wind from obs_wind message
*
* @return Wind
*/
static inline uint16_t mavlink_msg_obs_wind_get_wind(const mavlink_message_t* msg, float *wind)
{
return _MAV_RETURN_float_array(msg, wind, 3, 0);
}
/**
* @brief Decode a obs_wind message into a struct
*
* @param msg The message to decode
* @param obs_wind C-struct to decode the message contents into
*/
static inline void mavlink_msg_obs_wind_decode(const mavlink_message_t* msg, mavlink_obs_wind_t* obs_wind)
{
#if MAVLINK_NEED_BYTE_SWAP
mavlink_msg_obs_wind_get_wind(msg, obs_wind->wind);
#else
memcpy(obs_wind, _MAV_PAYLOAD(msg), 12);
#endif
}
/** @file
* @brief MAVLink comm protocol testsuite generated from ardupilotmega.xml
* @see http://qgroundcontrol.org/mavlink/
* Generated on Wed Aug 24 17:14:16 2011
*/
#ifndef ARDUPILOTMEGA_TESTSUITE_H
#define ARDUPILOTMEGA_TESTSUITE_H
#ifdef __cplusplus
extern "C" {
#endif
static void mavtest_generate_outputs(mavlink_channel_t chan)
{
mavlink_msg_sensor_offsets_send(chan , 19107 , 19211 , 19315 , 17.0 , 963497672 , 963497880 , 101.0 , 129.0 , 157.0 , 185.0 , 213.0 , 241.0 );
mavlink_msg_set_mag_offsets_send(chan , 151 , 218 , 17235 , 17339 , 17443 );
}
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // ARDUPILOTMEGA_TESTSUITE_H
......@@ -54,6 +54,12 @@ public:
registerType(msg);
}
// register Path
{
std::tr1::shared_ptr<px::Path> msg(new px::Path);
registerType(msg);
}
srand(time(NULL));
mStreamID = rand() + 1;
}
......@@ -156,7 +162,7 @@ public:
if (typecode >= mTypeMap.size())
{
std::cout << "# WARNING: Protobuf message with type code "
<< typecode << " is not registered." << std::endl;
<< static_cast<int>(typecode) << " is not registered." << std::endl;
return false;
}
......
<?xml version='1.0'?>
<mavlink>
<include>common.xml</include>
<enums>
<enum name="SENSESOAR_MODE">
<description> Different flight modes </description>
<entry name="SENSESOAR_MODE_GLIDING"> Gliding mode with motors off</entry>
<entry name="SENSESOAR_MODE_AUTONOMOUS"> Autonomous flight</entry>
<entry name="SENSESOAR_MODE_MANUAL"> RC controlled</entry>
</enum>
</enums>
<messages>
<message id="170" name="OBS_POSITION">
Position estimate of the observer in global frame
<field type="int32_t" name="lon">Longitude expressed in 1E7</field>
<field type="int32_t" name="lat">Latitude expressed in 1E7</field>
<field type="int32_t" name="alt">Altitude expressed in milimeters</field>
</message>
<message id="172" name="OBS_VELOCITY">
velocity estimate of the observer in NED inertial frame
<field type="float[3]" name="vel">Velocity</field>
</message>
<message id="174" name="OBS_ATTITUDE">
attitude estimate of the observer
<field type="double[4]" name="quat">Quaternion re;im</field>
</message>
<message id="176" name="OBS_WIND">
Wind estimate in NED inertial frame
<field type="float[3]" name="wind">Wind</field>
</message>
<message id="178" name="OBS_AIR_VELOCITY">
Estimate of the air velocity
<field type="float" name="magnitude">Air speed</field>
<field type="float" name="aoa">angle of attack</field>
<field type="float" name="slip">slip angle</field>
</message>
<message id="180" name="OBS_BIAS">
IMU biases
<field type="float[3]" name="accBias">accelerometer bias</field>
<field type="float[3]" name="gyroBias">gyroscope bias</field>
</message>
<message id="182" name="OBS_QFF">
estimate of the pressure at sea level
<field type="float" name="qff">Wind</field>
</message>
<message id="183" name="OBS_AIR_TEMP">
ambient air temperature
<field type="float" name="airT">Air Temperatur</field>
</message>
<message id="184" name="FILT_ROT_VEL">
filtered rotational velocity
<field type="float[3]" name="rotVel">rotational velocity</field>
</message>
<message id="186" name="LLC_OUT">
low level control output
<field type="int16_t[4]" name="servoOut">Servo signal</field>
<field type="int16_t[2]" name="MotorOut">motor signal</field>
</message>
<message id="188" name="PM_ELEC">
Power managment
<field type="float" name="PwCons">current power consumption</field>
<field type="float" name="BatStat">battery status</field>
<field type="float[3]" name="PwGen">Power generation from each module</field>
</message>
<message id="190" name="SYS_Stat">
system status
<field type="uint8_t" name="gps">gps status</field>
<field type="uint8_t" name="act">actuator status</field>
<field type="uint8_t" name="mod">module status</field>
<field type="uint8_t" name="commRssi">module status</field>
</message>
<message id="192" name="CMD_AIRSPEED_CHNG">
change commanded air speed
<field type="uint8_t" name="target">Target ID</field>
<field type="float" name="spCmd">commanded airspeed</field>
</message>
<message id="194" name="CMD_AIRSPEED_ACK">
accept change of airspeed
<field type="float" name="spCmd">commanded airspeed</field>
<field type="uint8_t" name="ack">0:ack, 1:nack</field>
</message>
</messages>
</mavlink>
......@@ -1459,10 +1459,10 @@
<description>Optical flow from a flow sensor (e.g. optical mouse sensor)</description>
<field type="uint64_t" name="time_usec">Timestamp (UNIX)</field>
<field type="uint8_t" name="sensor_id">Sensor ID</field>
<field type="int16_t" name="flow_x">Flow in pixels in x-sensor direction</field>
<field type="int16_t" name="flow_y">Flow in pixels in y-sensor direction</field>
<field type="float" name="flow_x">Flow in x-sensor direction</field>
<field type="float" name="flow_y">Flow in y-sensor direction</field>
<field type="uint8_t" name="quality">Optical flow quality / confidence. 0: bad, 255: maximum quality</field>
<field type="float" name="ground_distance">Ground distance in meters</field>
<field type="float" name="ground_distance">Ground distance in meters (-1 for unknown, flow is then in pixel / arbitrary scale)</field>
</message>
<message id="101" name="GLOBAL_VISION_POSITION_ESTIMATE">
<field type="uint64_t" name="usec">Timestamp (milliseconds)</field>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment