1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

UAVObjects/Delete old VTOLSettings object

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1854 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2010-10-03 18:14:27 +00:00 committed by peabody124
parent eeb5eab177
commit 754200f9cf
10 changed files with 0 additions and 813 deletions

View File

@ -176,7 +176,6 @@ SRC += $(OPUAVOBJ)/flightbatterystate.c
SRC += $(OPUAVOBJ)/attituderaw.c
SRC += $(OPUAVOBJ)/homelocation.c
SRC += $(OPUAVOBJ)/attitudesettings.c
SRC += $(OPUAVOBJ)/vtolsettings.c
SRC += $(OPUAVOBJ)/mixersettings.c
SRC += $(OPUAVOBJ)/mixerstatus.c
#SRC += $(OPUAVOBJ)/lesstabilizationsettings.c

View File

@ -1,137 +0,0 @@
/**
******************************************************************************
* @addtogroup UAVObjects OpenPilot UAVObjects
* @{
* @addtogroup VTOLSettings VTOLSettings
* @brief Sets the mixing coefficients for all the motors on a multicoptor
*
* Autogenerated files and functions for VTOLSettings Object
* @{
*
* @file vtolsettings.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Implementation of the VTOLSettings object. This file has been
* automatically generated by the UAVObjectGenerator.
*
* @note Object definition file: vtolsettings.xml.
* This is an automatically generated file.
* DO NOT modify manually.
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* 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, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef VTOLSETTINGS_H
#define VTOLSETTINGS_H
// Object constants
#define VTOLSETTINGS_OBJID 254340004U
#define VTOLSETTINGS_NAME "VTOLSettings"
#define VTOLSETTINGS_METANAME "VTOLSettingsMeta"
#define VTOLSETTINGS_ISSINGLEINST 1
#define VTOLSETTINGS_ISSETTINGS 1
#define VTOLSETTINGS_NUMBYTES sizeof(VTOLSettingsData)
// Object access macros
/**
* @function VTOLSettingsGet(dataOut)
* @brief Populate a VTOLSettingsData object
* @param[out] dataOut
*/
#define VTOLSettingsGet(dataOut) UAVObjGetData(VTOLSettingsHandle(), dataOut)
#define VTOLSettingsSet(dataIn) UAVObjSetData(VTOLSettingsHandle(), dataIn)
#define VTOLSettingsInstGet(instId, dataOut) UAVObjGetInstanceData(VTOLSettingsHandle(), instId, dataOut)
#define VTOLSettingsInstSet(instId, dataIn) UAVObjSetInstanceData(VTOLSettingsHandle(), instId, dataIn)
#define VTOLSettingsConnectQueue(queue) UAVObjConnectQueue(VTOLSettingsHandle(), queue, EV_MASK_ALL_UPDATES)
#define VTOLSettingsConnectCallback(cb) UAVObjConnectCallback(VTOLSettingsHandle(), cb, EV_MASK_ALL_UPDATES)
#define VTOLSettingsCreateInstance() UAVObjCreateInstance(VTOLSettingsHandle())
#define VTOLSettingsRequestUpdate() UAVObjRequestUpdate(VTOLSettingsHandle())
#define VTOLSettingsRequestInstUpdate(instId) UAVObjRequestInstanceUpdate(VTOLSettingsHandle(), instId)
#define VTOLSettingsUpdated() UAVObjUpdated(VTOLSettingsHandle())
#define VTOLSettingsInstUpdated(instId) UAVObjUpdated(VTOLSettingsHandle(), instId)
#define VTOLSettingsGetMetadata(dataOut) UAVObjGetMetadata(VTOLSettingsHandle(), dataOut)
#define VTOLSettingsSetMetadata(dataIn) UAVObjSetMetadata(VTOLSettingsHandle(), dataIn)
#define VTOLSettingsReadOnly(dataIn) UAVObjReadOnly(VTOLSettingsHandle())
// Object data
typedef struct {
float MotorN[4];
float MotorNE[4];
float MotorE[4];
float MotorSE[4];
float MotorS[4];
float MotorSW[4];
float MotorW[4];
float MotorNW[4];
} __attribute__((packed)) VTOLSettingsData;
// Field information
// Field MotorN information
/* Array element names for field MotorN */
typedef enum { VTOLSETTINGS_MOTORN_THROTTLE=0, VTOLSETTINGS_MOTORN_ROLL=1, VTOLSETTINGS_MOTORN_PITCH=2, VTOLSETTINGS_MOTORN_YAW=3 } VTOLSettingsMotorNElem;
/* Number of elements for field MotorN */
#define VTOLSETTINGS_MOTORN_NUMELEM 4
// Field MotorNE information
/* Array element names for field MotorNE */
typedef enum { VTOLSETTINGS_MOTORNE_THROTTLE=0, VTOLSETTINGS_MOTORNE_ROLL=1, VTOLSETTINGS_MOTORNE_PITCH=2, VTOLSETTINGS_MOTORNE_YAW=3 } VTOLSettingsMotorNEElem;
/* Number of elements for field MotorNE */
#define VTOLSETTINGS_MOTORNE_NUMELEM 4
// Field MotorE information
/* Array element names for field MotorE */
typedef enum { VTOLSETTINGS_MOTORE_THROTTLE=0, VTOLSETTINGS_MOTORE_ROLL=1, VTOLSETTINGS_MOTORE_PITCH=2, VTOLSETTINGS_MOTORE_YAW=3 } VTOLSettingsMotorEElem;
/* Number of elements for field MotorE */
#define VTOLSETTINGS_MOTORE_NUMELEM 4
// Field MotorSE information
/* Array element names for field MotorSE */
typedef enum { VTOLSETTINGS_MOTORSE_THROTTLE=0, VTOLSETTINGS_MOTORSE_ROLL=1, VTOLSETTINGS_MOTORSE_PITCH=2, VTOLSETTINGS_MOTORSE_YAW=3 } VTOLSettingsMotorSEElem;
/* Number of elements for field MotorSE */
#define VTOLSETTINGS_MOTORSE_NUMELEM 4
// Field MotorS information
/* Array element names for field MotorS */
typedef enum { VTOLSETTINGS_MOTORS_THROTTLE=0, VTOLSETTINGS_MOTORS_ROLL=1, VTOLSETTINGS_MOTORS_PITCH=2, VTOLSETTINGS_MOTORS_YAW=3 } VTOLSettingsMotorSElem;
/* Number of elements for field MotorS */
#define VTOLSETTINGS_MOTORS_NUMELEM 4
// Field MotorSW information
/* Array element names for field MotorSW */
typedef enum { VTOLSETTINGS_MOTORSW_THROTTLE=0, VTOLSETTINGS_MOTORSW_ROLL=1, VTOLSETTINGS_MOTORSW_PITCH=2, VTOLSETTINGS_MOTORSW_YAW=3 } VTOLSettingsMotorSWElem;
/* Number of elements for field MotorSW */
#define VTOLSETTINGS_MOTORSW_NUMELEM 4
// Field MotorW information
/* Array element names for field MotorW */
typedef enum { VTOLSETTINGS_MOTORW_THROTTLE=0, VTOLSETTINGS_MOTORW_ROLL=1, VTOLSETTINGS_MOTORW_PITCH=2, VTOLSETTINGS_MOTORW_YAW=3 } VTOLSettingsMotorWElem;
/* Number of elements for field MotorW */
#define VTOLSETTINGS_MOTORW_NUMELEM 4
// Field MotorNW information
/* Array element names for field MotorNW */
typedef enum { VTOLSETTINGS_MOTORNW_THROTTLE=0, VTOLSETTINGS_MOTORNW_ROLL=1, VTOLSETTINGS_MOTORNW_PITCH=2, VTOLSETTINGS_MOTORNW_YAW=3 } VTOLSettingsMotorNWElem;
/* Number of elements for field MotorNW */
#define VTOLSETTINGS_MOTORNW_NUMELEM 4
// Generic interface functions
int32_t VTOLSettingsInitialize();
UAVObjHandle VTOLSettingsHandle();
#endif // VTOLSETTINGS_H
/**
* @}
* @}
*/

View File

@ -64,7 +64,6 @@
#include "telemetrysettings.h"
#include "velocityactual.h"
#include "velocitydesired.h"
#include "vtolsettings.h"
/**
@ -109,6 +108,5 @@ void UAVObjectsInitializeAll()
TelemetrySettingsInitialize();
VelocityActualInitialize();
VelocityDesiredInitialize();
VTOLSettingsInitialize();
}

View File

@ -1,143 +0,0 @@
/**
******************************************************************************
* @addtogroup UAVObjects OpenPilot UAVObjects
* @{
* @addtogroup VTOLSettings VTOLSettings
* @brief Sets the mixing coefficients for all the motors on a multicoptor
*
* Autogenerated files and functions for VTOLSettings Object
* @{
*
* @file vtolsettings.c
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Implementation of the VTOLSettings object. This file has been
* automatically generated by the UAVObjectGenerator.
*
* @note Object definition file: vtolsettings.xml.
* This is an automatically generated file.
* DO NOT modify manually.
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* 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, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "openpilot.h"
#include "vtolsettings.h"
// Private variables
static UAVObjHandle handle;
// Private functions
static void setDefaults(UAVObjHandle obj, uint16_t instId);
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure
*/
int32_t VTOLSettingsInitialize()
{
// Register object with the object manager
handle = UAVObjRegister(VTOLSETTINGS_OBJID, VTOLSETTINGS_NAME, VTOLSETTINGS_METANAME, 0,
VTOLSETTINGS_ISSINGLEINST, VTOLSETTINGS_ISSETTINGS, VTOLSETTINGS_NUMBYTES, &setDefaults);
// Done
if (handle != 0)
{
return 0;
}
else
{
return -1;
}
}
/**
* Initialize object fields and metadata with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
static void setDefaults(UAVObjHandle obj, uint16_t instId)
{
VTOLSettingsData data;
UAVObjMetadata metadata;
// Initialize object fields to their default values
UAVObjGetInstanceData(obj, instId, &data);
memset(&data, 0, sizeof(VTOLSettingsData));
data.MotorN[0] = 0;
data.MotorN[1] = 0;
data.MotorN[2] = 0;
data.MotorN[3] = 0;
data.MotorNE[0] = 0;
data.MotorNE[1] = 0;
data.MotorNE[2] = 0;
data.MotorNE[3] = 0;
data.MotorE[0] = 0;
data.MotorE[1] = 0;
data.MotorE[2] = 0;
data.MotorE[3] = 0;
data.MotorSE[0] = 0;
data.MotorSE[1] = 0;
data.MotorSE[2] = 0;
data.MotorSE[3] = 0;
data.MotorS[0] = 0;
data.MotorS[1] = 0;
data.MotorS[2] = 0;
data.MotorS[3] = 0;
data.MotorSW[0] = 0;
data.MotorSW[1] = 0;
data.MotorSW[2] = 0;
data.MotorSW[3] = 0;
data.MotorW[0] = 0;
data.MotorW[1] = 0;
data.MotorW[2] = 0;
data.MotorW[3] = 0;
data.MotorNW[0] = 0;
data.MotorNW[1] = 0;
data.MotorNW[2] = 0;
data.MotorNW[3] = 0;
UAVObjSetInstanceData(obj, instId, &data);
// Initialize object metadata to their default values
metadata.access = ACCESS_READWRITE;
metadata.gcsAccess = ACCESS_READWRITE;
metadata.telemetryAcked = 1;
metadata.telemetryUpdateMode = UPDATEMODE_ONCHANGE;
metadata.telemetryUpdatePeriod = 0;
metadata.gcsTelemetryAcked = 1;
metadata.gcsTelemetryUpdateMode = UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
UAVObjSetMetadata(obj, &metadata);
}
/**
* Get object handle
*/
UAVObjHandle VTOLSettingsHandle()
{
return handle;
}
/**
* @}
*/

View File

@ -40,7 +40,6 @@ HEADERS += uavobjects_global.h \
positionactual.h \
flightbatterystate.h \
homelocation.h \
vtolsettings.h \
mixersettings.h \
mixerstatus.h \
velocitydesired.h \
@ -85,7 +84,6 @@ SOURCES += uavobject.cpp \
positionactual.cpp \
flightbatterystate.cpp \
homelocation.cpp \
vtolsettings.cpp \
mixersettings.cpp \
mixerstatus.cpp \
velocitydesired.cpp \

View File

@ -66,7 +66,6 @@
#include "telemetrysettings.h"
#include "velocityactual.h"
#include "velocitydesired.h"
#include "vtolsettings.h"
/**
@ -111,6 +110,5 @@ void UAVObjectsInitialize(UAVObjectManager* objMngr)
objMngr->registerObject( new TelemetrySettings() );
objMngr->registerObject( new VelocityActual() );
objMngr->registerObject( new VelocityDesired() );
objMngr->registerObject( new VTOLSettings() );
}

View File

@ -1,205 +0,0 @@
/**
******************************************************************************
*
* @file vtolsettings.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @see The GNU Public License (GPL) Version 3
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup UAVObjectsPlugin UAVObjects Plugin
* @{
*
* @note Object definition file: vtolsettings.xml.
* This is an automatically generated file.
* DO NOT modify manually.
*
* @brief The UAVUObjects GCS plugin
*****************************************************************************/
/*
* 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, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "vtolsettings.h"
#include "uavobjectfield.h"
const QString VTOLSettings::NAME = QString("VTOLSettings");
/**
* Constructor
*/
VTOLSettings::VTOLSettings(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
{
// Create fields
QList<UAVObjectField*> fields;
QStringList MotorNElemNames;
MotorNElemNames.append("Throttle");
MotorNElemNames.append("Roll");
MotorNElemNames.append("Pitch");
MotorNElemNames.append("Yaw");
fields.append( new UAVObjectField(QString("MotorN"), QString(""), UAVObjectField::FLOAT32, MotorNElemNames, QStringList()) );
QStringList MotorNEElemNames;
MotorNEElemNames.append("Throttle");
MotorNEElemNames.append("Roll");
MotorNEElemNames.append("Pitch");
MotorNEElemNames.append("Yaw");
fields.append( new UAVObjectField(QString("MotorNE"), QString(""), UAVObjectField::FLOAT32, MotorNEElemNames, QStringList()) );
QStringList MotorEElemNames;
MotorEElemNames.append("Throttle");
MotorEElemNames.append("Roll");
MotorEElemNames.append("Pitch");
MotorEElemNames.append("Yaw");
fields.append( new UAVObjectField(QString("MotorE"), QString(""), UAVObjectField::FLOAT32, MotorEElemNames, QStringList()) );
QStringList MotorSEElemNames;
MotorSEElemNames.append("Throttle");
MotorSEElemNames.append("Roll");
MotorSEElemNames.append("Pitch");
MotorSEElemNames.append("Yaw");
fields.append( new UAVObjectField(QString("MotorSE"), QString(""), UAVObjectField::FLOAT32, MotorSEElemNames, QStringList()) );
QStringList MotorSElemNames;
MotorSElemNames.append("Throttle");
MotorSElemNames.append("Roll");
MotorSElemNames.append("Pitch");
MotorSElemNames.append("Yaw");
fields.append( new UAVObjectField(QString("MotorS"), QString(""), UAVObjectField::FLOAT32, MotorSElemNames, QStringList()) );
QStringList MotorSWElemNames;
MotorSWElemNames.append("Throttle");
MotorSWElemNames.append("Roll");
MotorSWElemNames.append("Pitch");
MotorSWElemNames.append("Yaw");
fields.append( new UAVObjectField(QString("MotorSW"), QString(""), UAVObjectField::FLOAT32, MotorSWElemNames, QStringList()) );
QStringList MotorWElemNames;
MotorWElemNames.append("Throttle");
MotorWElemNames.append("Roll");
MotorWElemNames.append("Pitch");
MotorWElemNames.append("Yaw");
fields.append( new UAVObjectField(QString("MotorW"), QString(""), UAVObjectField::FLOAT32, MotorWElemNames, QStringList()) );
QStringList MotorNWElemNames;
MotorNWElemNames.append("Throttle");
MotorNWElemNames.append("Roll");
MotorNWElemNames.append("Pitch");
MotorNWElemNames.append("Yaw");
fields.append( new UAVObjectField(QString("MotorNW"), QString(""), UAVObjectField::FLOAT32, MotorNWElemNames, QStringList()) );
// Initialize object
initializeFields(fields, (quint8*)&data, NUMBYTES);
// Set the default field values
setDefaultFieldValues();
}
/**
* Get the default metadata for this object
*/
UAVObject::Metadata VTOLSettings::getDefaultMetadata()
{
UAVObject::Metadata metadata;
metadata.flightAccess = ACCESS_READWRITE;
metadata.gcsAccess = ACCESS_READWRITE;
metadata.gcsTelemetryAcked = 1;
metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightTelemetryAcked = 1;
metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject::UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
void VTOLSettings::setDefaultFieldValues()
{
data.MotorN[0] = 0;
data.MotorN[1] = 0;
data.MotorN[2] = 0;
data.MotorN[3] = 0;
data.MotorNE[0] = 0;
data.MotorNE[1] = 0;
data.MotorNE[2] = 0;
data.MotorNE[3] = 0;
data.MotorE[0] = 0;
data.MotorE[1] = 0;
data.MotorE[2] = 0;
data.MotorE[3] = 0;
data.MotorSE[0] = 0;
data.MotorSE[1] = 0;
data.MotorSE[2] = 0;
data.MotorSE[3] = 0;
data.MotorS[0] = 0;
data.MotorS[1] = 0;
data.MotorS[2] = 0;
data.MotorS[3] = 0;
data.MotorSW[0] = 0;
data.MotorSW[1] = 0;
data.MotorSW[2] = 0;
data.MotorSW[3] = 0;
data.MotorW[0] = 0;
data.MotorW[1] = 0;
data.MotorW[2] = 0;
data.MotorW[3] = 0;
data.MotorNW[0] = 0;
data.MotorNW[1] = 0;
data.MotorNW[2] = 0;
data.MotorNW[3] = 0;
}
/**
* Get the object data fields
*/
VTOLSettings::DataFields VTOLSettings::getData()
{
QMutexLocker locker(mutex);
return data;
}
/**
* Set the object data fields
*/
void VTOLSettings::setData(const DataFields& data)
{
QMutexLocker locker(mutex);
// Get metadata
Metadata mdata = getMetadata();
// Update object if the access mode permits
if ( mdata.gcsAccess == ACCESS_READWRITE )
{
this->data = data;
emit objectUpdatedAuto(this); // trigger object updated event
emit objectUpdated(this);
}
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
UAVDataObject* VTOLSettings::clone(quint32 instID)
{
VTOLSettings* obj = new VTOLSettings();
obj->initialize(instID, this->getMetaObject());
return obj;
}
/**
* Static function to retrieve an instance of the object.
*/
VTOLSettings* VTOLSettings::GetInstance(UAVObjectManager* objMngr, quint32 instID)
{
return dynamic_cast<VTOLSettings*>(objMngr->getObject(VTOLSettings::OBJID, instID));
}

View File

@ -1,124 +0,0 @@
/**
******************************************************************************
*
* @file vtolsettings.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @see The GNU Public License (GPL) Version 3
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup UAVObjectsPlugin UAVObjects Plugin
* @{
*
* @note Object definition file: vtolsettings.xml.
* This is an automatically generated file.
* DO NOT modify manually.
*
* @brief The UAVUObjects GCS plugin
*****************************************************************************/
/*
* 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, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef VTOLSETTINGS_H
#define VTOLSETTINGS_H
#include "uavdataobject.h"
#include "uavobjectmanager.h"
class UAVOBJECTS_EXPORT VTOLSettings: public UAVDataObject
{
Q_OBJECT
public:
// Field structure
typedef struct {
float MotorN[4];
float MotorNE[4];
float MotorE[4];
float MotorSE[4];
float MotorS[4];
float MotorSW[4];
float MotorW[4];
float MotorNW[4];
} __attribute__((packed)) DataFields;
// Field information
// Field MotorN information
/* Array element names for field MotorN */
typedef enum { MOTORN_THROTTLE=0, MOTORN_ROLL=1, MOTORN_PITCH=2, MOTORN_YAW=3 } MotorNElem;
/* Number of elements for field MotorN */
static const quint32 MOTORN_NUMELEM = 4;
// Field MotorNE information
/* Array element names for field MotorNE */
typedef enum { MOTORNE_THROTTLE=0, MOTORNE_ROLL=1, MOTORNE_PITCH=2, MOTORNE_YAW=3 } MotorNEElem;
/* Number of elements for field MotorNE */
static const quint32 MOTORNE_NUMELEM = 4;
// Field MotorE information
/* Array element names for field MotorE */
typedef enum { MOTORE_THROTTLE=0, MOTORE_ROLL=1, MOTORE_PITCH=2, MOTORE_YAW=3 } MotorEElem;
/* Number of elements for field MotorE */
static const quint32 MOTORE_NUMELEM = 4;
// Field MotorSE information
/* Array element names for field MotorSE */
typedef enum { MOTORSE_THROTTLE=0, MOTORSE_ROLL=1, MOTORSE_PITCH=2, MOTORSE_YAW=3 } MotorSEElem;
/* Number of elements for field MotorSE */
static const quint32 MOTORSE_NUMELEM = 4;
// Field MotorS information
/* Array element names for field MotorS */
typedef enum { MOTORS_THROTTLE=0, MOTORS_ROLL=1, MOTORS_PITCH=2, MOTORS_YAW=3 } MotorSElem;
/* Number of elements for field MotorS */
static const quint32 MOTORS_NUMELEM = 4;
// Field MotorSW information
/* Array element names for field MotorSW */
typedef enum { MOTORSW_THROTTLE=0, MOTORSW_ROLL=1, MOTORSW_PITCH=2, MOTORSW_YAW=3 } MotorSWElem;
/* Number of elements for field MotorSW */
static const quint32 MOTORSW_NUMELEM = 4;
// Field MotorW information
/* Array element names for field MotorW */
typedef enum { MOTORW_THROTTLE=0, MOTORW_ROLL=1, MOTORW_PITCH=2, MOTORW_YAW=3 } MotorWElem;
/* Number of elements for field MotorW */
static const quint32 MOTORW_NUMELEM = 4;
// Field MotorNW information
/* Array element names for field MotorNW */
typedef enum { MOTORNW_THROTTLE=0, MOTORNW_ROLL=1, MOTORNW_PITCH=2, MOTORNW_YAW=3 } MotorNWElem;
/* Number of elements for field MotorNW */
static const quint32 MOTORNW_NUMELEM = 4;
// Constants
static const quint32 OBJID = 254340004U;
static const QString NAME;
static const bool ISSINGLEINST = 1;
static const bool ISSETTINGS = 1;
static const quint32 NUMBYTES = sizeof(DataFields);
// Functions
VTOLSettings();
DataFields getData();
void setData(const DataFields& data);
Metadata getDefaultMetadata();
UAVDataObject* clone(quint32 instID);
static VTOLSettings* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
private:
DataFields data;
void setDefaultFieldValues();
};
#endif // VTOLSETTINGS_H

View File

@ -1,180 +0,0 @@
##
##############################################################################
#
# @file vtolsettings.py
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
# @brief Implementation of the VTOLSettings object. This file has been
# automatically generated by the UAVObjectGenerator.
#
# @note Object definition file: vtolsettings.xml.
# This is an automatically generated file.
# DO NOT modify manually.
#
# @see The GNU Public License (GPL) Version 3
#
#############################################################################/
#
# 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, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
import uavobject
import struct
from collections import namedtuple
# This is a list of instances of the data fields contained in this object
_fields = [ \
uavobject.UAVObjectField(
'MotorN',
'f',
4,
[
'Throttle',
'Roll',
'Pitch',
'Yaw',
],
{
}
),
uavobject.UAVObjectField(
'MotorNE',
'f',
4,
[
'Throttle',
'Roll',
'Pitch',
'Yaw',
],
{
}
),
uavobject.UAVObjectField(
'MotorE',
'f',
4,
[
'Throttle',
'Roll',
'Pitch',
'Yaw',
],
{
}
),
uavobject.UAVObjectField(
'MotorSE',
'f',
4,
[
'Throttle',
'Roll',
'Pitch',
'Yaw',
],
{
}
),
uavobject.UAVObjectField(
'MotorS',
'f',
4,
[
'Throttle',
'Roll',
'Pitch',
'Yaw',
],
{
}
),
uavobject.UAVObjectField(
'MotorSW',
'f',
4,
[
'Throttle',
'Roll',
'Pitch',
'Yaw',
],
{
}
),
uavobject.UAVObjectField(
'MotorW',
'f',
4,
[
'Throttle',
'Roll',
'Pitch',
'Yaw',
],
{
}
),
uavobject.UAVObjectField(
'MotorNW',
'f',
4,
[
'Throttle',
'Roll',
'Pitch',
'Yaw',
],
{
}
),
]
class VTOLSettings(uavobject.UAVObject):
## Object constants
OBJID = 254340004
NAME = "VTOLSettings"
METANAME = "VTOLSettingsMeta"
ISSINGLEINST = 1
ISSETTINGS = 1
def __init__(self):
uavobject.UAVObject.__init__(self,
self.OBJID,
self.NAME,
self.METANAME,
0,
self.ISSINGLEINST)
for f in _fields:
self.add_field(f)
def __str__(self):
s = ("0x%08X (%10u) %-30s %3u bytes format '%s'\n"
% (self.OBJID, self.OBJID, self.NAME, self.get_struct().size, self.get_struct().format))
for f in self.get_tuple()._fields:
s += ("\t%s\n" % f)
return (s)
def main():
# Instantiate the object and dump out some interesting info
x = VTOLSettings()
print (x)
if __name__ == "__main__":
#import pdb ; pdb.run('main()')
main()

View File

@ -1,17 +0,0 @@
<xml>
<object name="VTOLSettings" singleinstance="true" settings="true">
<description>Sets the mixing coefficients for all the motors on a multicoptor</description>
<field name="MotorN" units="" type="float" elements="4" elementnames="Throttle,Roll,Pitch,Yaw" defaultvalue="0"/>
<field name="MotorNE" units="" type="float" elements="4" elementnames="Throttle,Roll,Pitch,Yaw" defaultvalue="0"/>
<field name="MotorE" units="" type="float" elements="4" elementnames="Throttle,Roll,Pitch,Yaw" defaultvalue="0"/>
<field name="MotorSE" units="" type="float" elements="4" elementnames="Throttle,Roll,Pitch,Yaw" defaultvalue="0"/>
<field name="MotorS" units="" type="float" elements="4" elementnames="Throttle,Roll,Pitch,Yaw" defaultvalue="0"/>
<field name="MotorSW" units="" type="float" elements="4" elementnames="Throttle,Roll,Pitch,Yaw" defaultvalue="0"/>
<field name="MotorW" units="" type="float" elements="4" elementnames="Throttle,Roll,Pitch,Yaw" defaultvalue="0"/>
<field name="MotorNW" units="" type="float" elements="4" elementnames="Throttle,Roll,Pitch,Yaw" defaultvalue="0"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
<telemetryflight acked="true" updatemode="onchange" period="0"/>
<logging updatemode="never" period="0"/>
</object>
</xml>