From 2050864e591932f026faf8e9203e400eb9011050 Mon Sep 17 00:00:00 2001 From: peabody124 Date: Sat, 2 Oct 2010 02:17:26 +0000 Subject: [PATCH] UAVObjects/VTOLStatus: Remove unused object. Also added update time to indicate stabilization loop time. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1837 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/OpenPilot/Makefile | 1 - .../simple/Stabilization/stabilization.c | 3 + .../UAVObjects/inc/actuatordesired.h | 4 +- flight/OpenPilot/UAVObjects/inc/vtolstatus.h | 105 ------------ flight/OpenPilot/UAVObjects/uavobjectsinit.c | 2 - flight/OpenPilot/UAVObjects/vtolstatus.c | 111 ------------- .../plugins/uavobjects/actuatordesired.cpp | 3 + .../src/plugins/uavobjects/actuatordesired.h | 4 +- .../src/plugins/uavobjects/actuatordesired.py | 12 +- ground/src/plugins/uavobjects/uavobjects.pro | 2 - .../src/plugins/uavobjects/uavobjectsinit.cpp | 2 - ground/src/plugins/uavobjects/vtolstatus.cpp | 149 ----------------- ground/src/plugins/uavobjects/vtolstatus.h | 92 ----------- ground/src/plugins/uavobjects/vtolstatus.py | 156 ------------------ .../uavobjectdefinition/actuatordesired.xml | 1 + .../shared/uavobjectdefinition/vtolstatus.xml | 17 -- 16 files changed, 24 insertions(+), 640 deletions(-) delete mode 100644 flight/OpenPilot/UAVObjects/inc/vtolstatus.h delete mode 100644 flight/OpenPilot/UAVObjects/vtolstatus.c delete mode 100644 ground/src/plugins/uavobjects/vtolstatus.cpp delete mode 100644 ground/src/plugins/uavobjects/vtolstatus.h delete mode 100644 ground/src/plugins/uavobjects/vtolstatus.py delete mode 100644 ground/src/shared/uavobjectdefinition/vtolstatus.xml diff --git a/flight/OpenPilot/Makefile b/flight/OpenPilot/Makefile index c928a9743..af74d08a8 100644 --- a/flight/OpenPilot/Makefile +++ b/flight/OpenPilot/Makefile @@ -177,7 +177,6 @@ SRC += $(OPUAVOBJ)/attituderaw.c SRC += $(OPUAVOBJ)/homelocation.c SRC += $(OPUAVOBJ)/attitudesettings.c SRC += $(OPUAVOBJ)/vtolsettings.c -SRC += $(OPUAVOBJ)/vtolstatus.c SRC += $(OPUAVOBJ)/mixersettings.c SRC += $(OPUAVOBJ)/mixerstatus.c #SRC += $(OPUAVOBJ)/lesstabilizationsettings.c diff --git a/flight/OpenPilot/Modules/Stabilization/simple/Stabilization/stabilization.c b/flight/OpenPilot/Modules/Stabilization/simple/Stabilization/stabilization.c index 10afd3b59..91c898c4e 100644 --- a/flight/OpenPilot/Modules/Stabilization/simple/Stabilization/stabilization.c +++ b/flight/OpenPilot/Modules/Stabilization/simple/Stabilization/stabilization.c @@ -182,6 +182,9 @@ static void stabilizationTask(void* parameters) // Setup throttle actuatorDesired.Throttle = bound(attitudeDesired.Throttle, stabSettings.ThrottleMin, stabSettings.ThrottleMax); + // Save dT + actuatorDesired.UpdateTime = dT; + // Write actuator desired (if not in manual mode) if ( manualControl.FlightMode != MANUALCONTROLCOMMAND_FLIGHTMODE_MANUAL ) { diff --git a/flight/OpenPilot/UAVObjects/inc/actuatordesired.h b/flight/OpenPilot/UAVObjects/inc/actuatordesired.h index 88af80685..c79b4a790 100644 --- a/flight/OpenPilot/UAVObjects/inc/actuatordesired.h +++ b/flight/OpenPilot/UAVObjects/inc/actuatordesired.h @@ -41,7 +41,7 @@ #define ACTUATORDESIRED_H // Object constants -#define ACTUATORDESIRED_OBJID 123085850U +#define ACTUATORDESIRED_OBJID 2919796710U #define ACTUATORDESIRED_NAME "ActuatorDesired" #define ACTUATORDESIRED_METANAME "ActuatorDesiredMeta" #define ACTUATORDESIRED_ISSINGLEINST 1 @@ -75,6 +75,7 @@ typedef struct { float Pitch; float Yaw; float Throttle; + float UpdateTime; } __attribute__((packed)) ActuatorDesiredData; @@ -83,6 +84,7 @@ typedef struct { // Field Pitch information // Field Yaw information // Field Throttle information +// Field UpdateTime information // Generic interface functions diff --git a/flight/OpenPilot/UAVObjects/inc/vtolstatus.h b/flight/OpenPilot/UAVObjects/inc/vtolstatus.h deleted file mode 100644 index 0afa4538e..000000000 --- a/flight/OpenPilot/UAVObjects/inc/vtolstatus.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - ****************************************************************************** - * @addtogroup UAVObjects OpenPilot UAVObjects - * @{ - * @addtogroup VTOLStatus VTOLStatus - * @brief Status for VTOL crafts showing the thrust from each engine - * - * Autogenerated files and functions for VTOLStatus Object - - * @{ - * - * @file vtolstatus.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Implementation of the VTOLStatus object. This file has been - * automatically generated by the UAVObjectGenerator. - * - * @note Object definition file: vtolstatus.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 VTOLSTATUS_H -#define VTOLSTATUS_H - -// Object constants -#define VTOLSTATUS_OBJID 957086004U -#define VTOLSTATUS_NAME "VTOLStatus" -#define VTOLSTATUS_METANAME "VTOLStatusMeta" -#define VTOLSTATUS_ISSINGLEINST 1 -#define VTOLSTATUS_ISSETTINGS 0 -#define VTOLSTATUS_NUMBYTES sizeof(VTOLStatusData) - -// Object access macros -/** - * @function VTOLStatusGet(dataOut) - * @brief Populate a VTOLStatusData object - * @param[out] dataOut - */ -#define VTOLStatusGet(dataOut) UAVObjGetData(VTOLStatusHandle(), dataOut) -#define VTOLStatusSet(dataIn) UAVObjSetData(VTOLStatusHandle(), dataIn) -#define VTOLStatusInstGet(instId, dataOut) UAVObjGetInstanceData(VTOLStatusHandle(), instId, dataOut) -#define VTOLStatusInstSet(instId, dataIn) UAVObjSetInstanceData(VTOLStatusHandle(), instId, dataIn) -#define VTOLStatusConnectQueue(queue) UAVObjConnectQueue(VTOLStatusHandle(), queue, EV_MASK_ALL_UPDATES) -#define VTOLStatusConnectCallback(cb) UAVObjConnectCallback(VTOLStatusHandle(), cb, EV_MASK_ALL_UPDATES) -#define VTOLStatusCreateInstance() UAVObjCreateInstance(VTOLStatusHandle()) -#define VTOLStatusRequestUpdate() UAVObjRequestUpdate(VTOLStatusHandle()) -#define VTOLStatusRequestInstUpdate(instId) UAVObjRequestInstanceUpdate(VTOLStatusHandle(), instId) -#define VTOLStatusUpdated() UAVObjUpdated(VTOLStatusHandle()) -#define VTOLStatusInstUpdated(instId) UAVObjUpdated(VTOLStatusHandle(), instId) -#define VTOLStatusGetMetadata(dataOut) UAVObjGetMetadata(VTOLStatusHandle(), dataOut) -#define VTOLStatusSetMetadata(dataIn) UAVObjSetMetadata(VTOLStatusHandle(), dataIn) -#define VTOLStatusReadOnly(dataIn) UAVObjReadOnly(VTOLStatusHandle()) - -// Object data -typedef struct { - float MotorN; - float MotorNE; - float MotorE; - float MotorSE; - float MotorS; - float MotorSW; - float MotorW; - float MotorNW; - -} __attribute__((packed)) VTOLStatusData; - -// Field information -// Field MotorN information -// Field MotorNE information -// Field MotorE information -// Field MotorSE information -// Field MotorS information -// Field MotorSW information -// Field MotorW information -// Field MotorNW information - - -// Generic interface functions -int32_t VTOLStatusInitialize(); -UAVObjHandle VTOLStatusHandle(); - -#endif // VTOLSTATUS_H - -/** - * @} - * @} - */ diff --git a/flight/OpenPilot/UAVObjects/uavobjectsinit.c b/flight/OpenPilot/UAVObjects/uavobjectsinit.c index 168dbe00d..cad551995 100644 --- a/flight/OpenPilot/UAVObjects/uavobjectsinit.c +++ b/flight/OpenPilot/UAVObjects/uavobjectsinit.c @@ -65,7 +65,6 @@ #include "velocityactual.h" #include "velocitydesired.h" #include "vtolsettings.h" -#include "vtolstatus.h" /** @@ -111,6 +110,5 @@ void UAVObjectsInitializeAll() VelocityActualInitialize(); VelocityDesiredInitialize(); VTOLSettingsInitialize(); - VTOLStatusInitialize(); } diff --git a/flight/OpenPilot/UAVObjects/vtolstatus.c b/flight/OpenPilot/UAVObjects/vtolstatus.c deleted file mode 100644 index 1a47d775a..000000000 --- a/flight/OpenPilot/UAVObjects/vtolstatus.c +++ /dev/null @@ -1,111 +0,0 @@ -/** - ****************************************************************************** - * @addtogroup UAVObjects OpenPilot UAVObjects - * @{ - * @addtogroup VTOLStatus VTOLStatus - * @brief Status for VTOL crafts showing the thrust from each engine - * - * Autogenerated files and functions for VTOLStatus Object - * @{ - * - * @file vtolstatus.c - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Implementation of the VTOLStatus object. This file has been - * automatically generated by the UAVObjectGenerator. - * - * @note Object definition file: vtolstatus.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 "vtolstatus.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 VTOLStatusInitialize() -{ - // Register object with the object manager - handle = UAVObjRegister(VTOLSTATUS_OBJID, VTOLSTATUS_NAME, VTOLSTATUS_METANAME, 0, - VTOLSTATUS_ISSINGLEINST, VTOLSTATUS_ISSETTINGS, VTOLSTATUS_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) -{ - VTOLStatusData data; - UAVObjMetadata metadata; - - // Initialize object fields to their default values - UAVObjGetInstanceData(obj, instId, &data); - memset(&data, 0, sizeof(VTOLStatusData)); - - UAVObjSetInstanceData(obj, instId, &data); - - // Initialize object metadata to their default values - metadata.access = ACCESS_READWRITE; - metadata.gcsAccess = ACCESS_READWRITE; - metadata.telemetryAcked = 0; - metadata.telemetryUpdateMode = UPDATEMODE_PERIODIC; - metadata.telemetryUpdatePeriod = 1000; - metadata.gcsTelemetryAcked = 0; - metadata.gcsTelemetryUpdateMode = UPDATEMODE_MANUAL; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdateMode = UPDATEMODE_PERIODIC; - metadata.loggingUpdatePeriod = 1000; - UAVObjSetMetadata(obj, &metadata); -} - -/** - * Get object handle - */ -UAVObjHandle VTOLStatusHandle() -{ - return handle; -} - -/** - * @} - */ - diff --git a/ground/src/plugins/uavobjects/actuatordesired.cpp b/ground/src/plugins/uavobjects/actuatordesired.cpp index 4a0f5916b..cb2724cff 100644 --- a/ground/src/plugins/uavobjects/actuatordesired.cpp +++ b/ground/src/plugins/uavobjects/actuatordesired.cpp @@ -54,6 +54,9 @@ ActuatorDesired::ActuatorDesired(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTING QStringList ThrottleElemNames; ThrottleElemNames.append("0"); fields.append( new UAVObjectField(QString("Throttle"), QString("%"), UAVObjectField::FLOAT32, ThrottleElemNames, QStringList()) ); + QStringList UpdateTimeElemNames; + UpdateTimeElemNames.append("0"); + fields.append( new UAVObjectField(QString("UpdateTime"), QString("ms"), UAVObjectField::FLOAT32, UpdateTimeElemNames, QStringList()) ); // Initialize object initializeFields(fields, (quint8*)&data, NUMBYTES); diff --git a/ground/src/plugins/uavobjects/actuatordesired.h b/ground/src/plugins/uavobjects/actuatordesired.h index 3274c63fb..efd74ac0a 100644 --- a/ground/src/plugins/uavobjects/actuatordesired.h +++ b/ground/src/plugins/uavobjects/actuatordesired.h @@ -47,6 +47,7 @@ public: float Pitch; float Yaw; float Throttle; + float UpdateTime; } __attribute__((packed)) DataFields; @@ -55,10 +56,11 @@ public: // Field Pitch information // Field Yaw information // Field Throttle information + // Field UpdateTime information // Constants - static const quint32 OBJID = 123085850U; + static const quint32 OBJID = 2919796710U; static const QString NAME; static const bool ISSINGLEINST = 1; static const bool ISSETTINGS = 0; diff --git a/ground/src/plugins/uavobjects/actuatordesired.py b/ground/src/plugins/uavobjects/actuatordesired.py index 005e37a3b..39069aa28 100644 --- a/ground/src/plugins/uavobjects/actuatordesired.py +++ b/ground/src/plugins/uavobjects/actuatordesired.py @@ -77,12 +77,22 @@ _fields = [ \ { } ), + uavobject.UAVObjectField( + 'UpdateTime', + 'f', + 1, + [ + '0', + ], + { + } + ), ] class ActuatorDesired(uavobject.UAVObject): ## Object constants - OBJID = 123085850 + OBJID = 2919796710 NAME = "ActuatorDesired" METANAME = "ActuatorDesiredMeta" ISSINGLEINST = 1 diff --git a/ground/src/plugins/uavobjects/uavobjects.pro b/ground/src/plugins/uavobjects/uavobjects.pro index 9bc14694c..5e069cfbe 100644 --- a/ground/src/plugins/uavobjects/uavobjects.pro +++ b/ground/src/plugins/uavobjects/uavobjects.pro @@ -41,7 +41,6 @@ HEADERS += uavobjects_global.h \ flightbatterystate.h \ homelocation.h \ vtolsettings.h \ - vtolstatus.h \ mixersettings.h \ mixerstatus.h \ velocitydesired.h \ @@ -87,7 +86,6 @@ SOURCES += uavobject.cpp \ flightbatterystate.cpp \ homelocation.cpp \ vtolsettings.cpp \ - vtolstatus.cpp \ mixersettings.cpp \ mixerstatus.cpp \ velocitydesired.cpp \ diff --git a/ground/src/plugins/uavobjects/uavobjectsinit.cpp b/ground/src/plugins/uavobjects/uavobjectsinit.cpp index 893e17432..0db40224d 100644 --- a/ground/src/plugins/uavobjects/uavobjectsinit.cpp +++ b/ground/src/plugins/uavobjects/uavobjectsinit.cpp @@ -67,7 +67,6 @@ #include "velocityactual.h" #include "velocitydesired.h" #include "vtolsettings.h" -#include "vtolstatus.h" /** @@ -113,6 +112,5 @@ void UAVObjectsInitialize(UAVObjectManager* objMngr) objMngr->registerObject( new VelocityActual() ); objMngr->registerObject( new VelocityDesired() ); objMngr->registerObject( new VTOLSettings() ); - objMngr->registerObject( new VTOLStatus() ); } diff --git a/ground/src/plugins/uavobjects/vtolstatus.cpp b/ground/src/plugins/uavobjects/vtolstatus.cpp deleted file mode 100644 index 663a4bddc..000000000 --- a/ground/src/plugins/uavobjects/vtolstatus.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/** - ****************************************************************************** - * - * @file vtolstatus.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: vtolstatus.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 "vtolstatus.h" -#include "uavobjectfield.h" - -const QString VTOLStatus::NAME = QString("VTOLStatus"); - -/** - * Constructor - */ -VTOLStatus::VTOLStatus(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME) -{ - // Create fields - QList fields; - QStringList MotorNElemNames; - MotorNElemNames.append("0"); - fields.append( new UAVObjectField(QString("MotorN"), QString(""), UAVObjectField::FLOAT32, MotorNElemNames, QStringList()) ); - QStringList MotorNEElemNames; - MotorNEElemNames.append("0"); - fields.append( new UAVObjectField(QString("MotorNE"), QString(""), UAVObjectField::FLOAT32, MotorNEElemNames, QStringList()) ); - QStringList MotorEElemNames; - MotorEElemNames.append("0"); - fields.append( new UAVObjectField(QString("MotorE"), QString(""), UAVObjectField::FLOAT32, MotorEElemNames, QStringList()) ); - QStringList MotorSEElemNames; - MotorSEElemNames.append("0"); - fields.append( new UAVObjectField(QString("MotorSE"), QString(""), UAVObjectField::FLOAT32, MotorSEElemNames, QStringList()) ); - QStringList MotorSElemNames; - MotorSElemNames.append("0"); - fields.append( new UAVObjectField(QString("MotorS"), QString(""), UAVObjectField::FLOAT32, MotorSElemNames, QStringList()) ); - QStringList MotorSWElemNames; - MotorSWElemNames.append("0"); - fields.append( new UAVObjectField(QString("MotorSW"), QString(""), UAVObjectField::FLOAT32, MotorSWElemNames, QStringList()) ); - QStringList MotorWElemNames; - MotorWElemNames.append("0"); - fields.append( new UAVObjectField(QString("MotorW"), QString(""), UAVObjectField::FLOAT32, MotorWElemNames, QStringList()) ); - QStringList MotorNWElemNames; - MotorNWElemNames.append("0"); - 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 VTOLStatus::getDefaultMetadata() -{ - UAVObject::Metadata metadata; - metadata.flightAccess = ACCESS_READWRITE; - metadata.gcsAccess = ACCESS_READWRITE; - metadata.gcsTelemetryAcked = 0; - metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_MANUAL; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.flightTelemetryAcked = 0; - metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.loggingUpdateMode = UAVObject::UPDATEMODE_PERIODIC; - metadata.loggingUpdatePeriod = 1000; - 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 VTOLStatus::setDefaultFieldValues() -{ - -} - -/** - * Get the object data fields - */ -VTOLStatus::DataFields VTOLStatus::getData() -{ - QMutexLocker locker(mutex); - return data; -} - -/** - * Set the object data fields - */ -void VTOLStatus::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* VTOLStatus::clone(quint32 instID) -{ - VTOLStatus* obj = new VTOLStatus(); - obj->initialize(instID, this->getMetaObject()); - return obj; -} - -/** - * Static function to retrieve an instance of the object. - */ -VTOLStatus* VTOLStatus::GetInstance(UAVObjectManager* objMngr, quint32 instID) -{ - return dynamic_cast(objMngr->getObject(VTOLStatus::OBJID, instID)); -} diff --git a/ground/src/plugins/uavobjects/vtolstatus.h b/ground/src/plugins/uavobjects/vtolstatus.h deleted file mode 100644 index 800800ba0..000000000 --- a/ground/src/plugins/uavobjects/vtolstatus.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - ****************************************************************************** - * - * @file vtolstatus.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: vtolstatus.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 VTOLSTATUS_H -#define VTOLSTATUS_H - -#include "uavdataobject.h" -#include "uavobjectmanager.h" - -class UAVOBJECTS_EXPORT VTOLStatus: public UAVDataObject -{ - Q_OBJECT - -public: - // Field structure - typedef struct { - float MotorN; - float MotorNE; - float MotorE; - float MotorSE; - float MotorS; - float MotorSW; - float MotorW; - float MotorNW; - - } __attribute__((packed)) DataFields; - - // Field information - // Field MotorN information - // Field MotorNE information - // Field MotorE information - // Field MotorSE information - // Field MotorS information - // Field MotorSW information - // Field MotorW information - // Field MotorNW information - - - // Constants - static const quint32 OBJID = 957086004U; - static const QString NAME; - static const bool ISSINGLEINST = 1; - static const bool ISSETTINGS = 0; - static const quint32 NUMBYTES = sizeof(DataFields); - - // Functions - VTOLStatus(); - - DataFields getData(); - void setData(const DataFields& data); - Metadata getDefaultMetadata(); - UAVDataObject* clone(quint32 instID); - - static VTOLStatus* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0); - -private: - DataFields data; - - void setDefaultFieldValues(); - -}; - -#endif // VTOLSTATUS_H diff --git a/ground/src/plugins/uavobjects/vtolstatus.py b/ground/src/plugins/uavobjects/vtolstatus.py deleted file mode 100644 index f2fe41ee7..000000000 --- a/ground/src/plugins/uavobjects/vtolstatus.py +++ /dev/null @@ -1,156 +0,0 @@ -## -############################################################################## -# -# @file vtolstatus.py -# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. -# @brief Implementation of the VTOLStatus object. This file has been -# automatically generated by the UAVObjectGenerator. -# -# @note Object definition file: vtolstatus.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', - 1, - [ - '0', - ], - { - } - ), - uavobject.UAVObjectField( - 'MotorNE', - 'f', - 1, - [ - '0', - ], - { - } - ), - uavobject.UAVObjectField( - 'MotorE', - 'f', - 1, - [ - '0', - ], - { - } - ), - uavobject.UAVObjectField( - 'MotorSE', - 'f', - 1, - [ - '0', - ], - { - } - ), - uavobject.UAVObjectField( - 'MotorS', - 'f', - 1, - [ - '0', - ], - { - } - ), - uavobject.UAVObjectField( - 'MotorSW', - 'f', - 1, - [ - '0', - ], - { - } - ), - uavobject.UAVObjectField( - 'MotorW', - 'f', - 1, - [ - '0', - ], - { - } - ), - uavobject.UAVObjectField( - 'MotorNW', - 'f', - 1, - [ - '0', - ], - { - } - ), -] - - -class VTOLStatus(uavobject.UAVObject): - ## Object constants - OBJID = 957086004 - NAME = "VTOLStatus" - METANAME = "VTOLStatusMeta" - ISSINGLEINST = 1 - ISSETTINGS = 0 - - 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 = VTOLStatus() - print (x) - -if __name__ == "__main__": - #import pdb ; pdb.run('main()') - main() diff --git a/ground/src/shared/uavobjectdefinition/actuatordesired.xml b/ground/src/shared/uavobjectdefinition/actuatordesired.xml index 79b6a5e40..417479500 100644 --- a/ground/src/shared/uavobjectdefinition/actuatordesired.xml +++ b/ground/src/shared/uavobjectdefinition/actuatordesired.xml @@ -5,6 +5,7 @@ + diff --git a/ground/src/shared/uavobjectdefinition/vtolstatus.xml b/ground/src/shared/uavobjectdefinition/vtolstatus.xml deleted file mode 100644 index ee2491bbc..000000000 --- a/ground/src/shared/uavobjectdefinition/vtolstatus.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - Status for VTOL crafts showing the thrust from each engine - - - - - - - - - - - - - -