mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
GCS/GPS Renamed GPSObject to PositionActual and added field for GPS status (NoGPS, NoFix, Fix2D and Fix3D)
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@733 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
5472d531e7
commit
6844743050
@ -45,7 +45,7 @@ FlightGearBridge::FlightGearBridge()
|
|||||||
actDesired = ActuatorDesired::GetInstance(objManager);
|
actDesired = ActuatorDesired::GetInstance(objManager);
|
||||||
altActual = AltitudeActual::GetInstance(objManager);
|
altActual = AltitudeActual::GetInstance(objManager);
|
||||||
attActual = AttitudeActual::GetInstance(objManager);
|
attActual = AttitudeActual::GetInstance(objManager);
|
||||||
gps = GpsObject::GetInstance(objManager);
|
posActual = PositionActual::GetInstance(objManager);
|
||||||
telStats = GCSTelemetryStats::GetInstance(objManager);
|
telStats = GCSTelemetryStats::GetInstance(objManager);
|
||||||
|
|
||||||
// Listen to autopilot connection events
|
// Listen to autopilot connection events
|
||||||
@ -152,7 +152,7 @@ void FlightGearBridge::setupObjects()
|
|||||||
setupInputObject(actDesired, 50);
|
setupInputObject(actDesired, 50);
|
||||||
setupOutputObject(altActual, 250);
|
setupOutputObject(altActual, 250);
|
||||||
setupOutputObject(attActual, 50);
|
setupOutputObject(attActual, 50);
|
||||||
setupOutputObject(gps, 250);
|
setupOutputObject(posActual, 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlightGearBridge::setupInputObject(UAVObject* obj, int updatePeriod)
|
void FlightGearBridge::setupInputObject(UAVObject* obj, int updatePeriod)
|
||||||
@ -270,15 +270,15 @@ void FlightGearBridge::processUpdate(QString& data)
|
|||||||
attActual->setData(attActualData);
|
attActual->setData(attActualData);
|
||||||
|
|
||||||
// Update gps objects
|
// Update gps objects
|
||||||
GpsObject::DataFields gpsData;
|
PositionActual::DataFields gpsData;
|
||||||
gpsData.Altitude = altitude;
|
gpsData.Altitude = altitude;
|
||||||
gpsData.Heading = heading;
|
gpsData.Heading = heading;
|
||||||
gpsData.GroundSpeed = groundspeed;
|
gpsData.Groundspeed = groundspeed;
|
||||||
gpsData.Latitude = latitude;
|
gpsData.Latitude = latitude;
|
||||||
gpsData.Longitude = longitude;
|
gpsData.Longitude = longitude;
|
||||||
gpsData.Satellites = 10;
|
gpsData.Satellites = 10;
|
||||||
gpsData.Updates = 0;
|
gpsData.Status = PositionActual::STATUS_FIX3D;
|
||||||
gps->setData(gpsData);
|
posActual->setData(gpsData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlightGearBridge::telStatsUpdated(UAVObject* obj)
|
void FlightGearBridge::telStatsUpdated(UAVObject* obj)
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include "uavobjects/actuatordesired.h"
|
#include "uavobjects/actuatordesired.h"
|
||||||
#include "uavobjects/altitudeactual.h"
|
#include "uavobjects/altitudeactual.h"
|
||||||
#include "uavobjects/attitudeactual.h"
|
#include "uavobjects/attitudeactual.h"
|
||||||
#include "uavobjects/gpsobject.h"
|
#include "uavobjects/positionactual.h"
|
||||||
#include "uavobjects/gcstelemetrystats.h"
|
#include "uavobjects/gcstelemetrystats.h"
|
||||||
|
|
||||||
class FlightGearBridge: public QObject
|
class FlightGearBridge: public QObject
|
||||||
@ -75,7 +75,7 @@ private:
|
|||||||
ActuatorDesired* actDesired;
|
ActuatorDesired* actDesired;
|
||||||
AltitudeActual* altActual;
|
AltitudeActual* altActual;
|
||||||
AttitudeActual* attActual;
|
AttitudeActual* attActual;
|
||||||
GpsObject* gps;
|
PositionActual* posActual;
|
||||||
GCSTelemetryStats* telStats;
|
GCSTelemetryStats* telStats;
|
||||||
QHostAddress fgHost;
|
QHostAddress fgHost;
|
||||||
int inPort;
|
int inPort;
|
||||||
|
@ -68,7 +68,7 @@ MapGadgetWidget::MapGadgetWidget(QWidget *parent) : QWidget(parent)
|
|||||||
// Get required UAVObjects
|
// Get required UAVObjects
|
||||||
ExtensionSystem::PluginManager* pm = ExtensionSystem::PluginManager::instance();
|
ExtensionSystem::PluginManager* pm = ExtensionSystem::PluginManager::instance();
|
||||||
UAVObjectManager* objManager = pm->getObject<UAVObjectManager>();
|
UAVObjectManager* objManager = pm->getObject<UAVObjectManager>();
|
||||||
m_gpsObj = GpsObject::GetInstance(objManager);
|
m_positionActual = PositionActual::GetInstance(objManager);
|
||||||
|
|
||||||
m_updateTimer = new QTimer();
|
m_updateTimer = new QTimer();
|
||||||
m_updateTimer->setInterval(250);
|
m_updateTimer->setInterval(250);
|
||||||
@ -94,7 +94,7 @@ void MapGadgetWidget::setPosition(QPointF pos)
|
|||||||
|
|
||||||
void MapGadgetWidget::updatePosition()
|
void MapGadgetWidget::updatePosition()
|
||||||
{
|
{
|
||||||
GpsObject::DataFields data = m_gpsObj->getData();
|
PositionActual::DataFields data = m_positionActual->getData();
|
||||||
setPosition(QPointF(data.Longitude, data.Latitude));
|
setPosition(QPointF(data.Longitude, data.Latitude));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "qmapcontrol/qmapcontrol.h"
|
#include "qmapcontrol/qmapcontrol.h"
|
||||||
#include <QtGui/QWidget>
|
#include <QtGui/QWidget>
|
||||||
#include "uavobjects/uavobjectmanager.h"
|
#include "uavobjects/uavobjectmanager.h"
|
||||||
#include "uavobjects/gpsobject.h"
|
#include "uavobjects/positionactual.h"
|
||||||
|
|
||||||
using namespace qmapcontrol;
|
using namespace qmapcontrol;
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ private:
|
|||||||
Layer *m_googleSatLayer;
|
Layer *m_googleSatLayer;
|
||||||
Layer *m_yahooLayer;
|
Layer *m_yahooLayer;
|
||||||
QTimer *m_updateTimer;
|
QTimer *m_updateTimer;
|
||||||
GpsObject *m_gpsObj;
|
PositionActual *m_positionActual;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MAPGADGETWIDGET_H_ */
|
#endif /* MAPGADGETWIDGET_H_ */
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "uavobjects/uavobject.h"
|
#include "uavobjects/uavobject.h"
|
||||||
#include "uavobjects/altitudeactual.h"
|
#include "uavobjects/altitudeactual.h"
|
||||||
#include "uavobjects/gpsobject.h"
|
#include "uavobjects/positionactual.h"
|
||||||
|
|
||||||
|
|
||||||
#include "qwt/src/qwt.h"
|
#include "qwt/src/qwt.h"
|
||||||
|
@ -273,7 +273,7 @@ TestDataGen::TestDataGen()
|
|||||||
UAVObjectManager* objManager = pm->getObject<UAVObjectManager>();
|
UAVObjectManager* objManager = pm->getObject<UAVObjectManager>();
|
||||||
|
|
||||||
altActual = AltitudeActual::GetInstance(objManager);
|
altActual = AltitudeActual::GetInstance(objManager);
|
||||||
gps = GpsObject::GetInstance(objManager);
|
gps = PositionActual::GetInstance(objManager);
|
||||||
|
|
||||||
//Setup timer
|
//Setup timer
|
||||||
timer = new QTimer(this);
|
timer = new QTimer(this);
|
||||||
@ -292,14 +292,13 @@ void TestDataGen::genTestData()
|
|||||||
|
|
||||||
|
|
||||||
// Update gps objects
|
// Update gps objects
|
||||||
GpsObject::DataFields gpsData;
|
PositionActual::DataFields gpsData;
|
||||||
gpsData.Altitude = 0;
|
gpsData.Altitude = 0;
|
||||||
gpsData.Heading = 0;
|
gpsData.Heading = 0;
|
||||||
gpsData.GroundSpeed = 0;
|
gpsData.Groundspeed = 0;
|
||||||
gpsData.Latitude = 0;
|
gpsData.Latitude = 0;
|
||||||
gpsData.Longitude = 0;
|
gpsData.Longitude = 0;
|
||||||
gpsData.Satellites = 10;
|
gpsData.Satellites = 10;
|
||||||
gpsData.Updates = 0;
|
|
||||||
gps->setData(gpsData);
|
gps->setData(gpsData);
|
||||||
|
|
||||||
testTime++;
|
testTime++;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "plotdata.h"
|
#include "plotdata.h"
|
||||||
#include "uavobjects/uavobject.h"
|
#include "uavobjects/uavobject.h"
|
||||||
#include "uavobjects/altitudeactual.h"
|
#include "uavobjects/altitudeactual.h"
|
||||||
#include "uavobjects/gpsobject.h"
|
#include "uavobjects/positionactual.h"
|
||||||
|
|
||||||
|
|
||||||
#include "qwt/src/qwt.h"
|
#include "qwt/src/qwt.h"
|
||||||
@ -69,7 +69,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
AltitudeActual* altActual;
|
AltitudeActual* altActual;
|
||||||
GpsObject* gps;
|
PositionActual* gps;
|
||||||
|
|
||||||
QTimer *timer;
|
QTimer *timer;
|
||||||
double testTime;
|
double testTime;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file gpsobject.cpp
|
* @file positionactual.cpp
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @brief Implementation of the GpsObject object. This file has been
|
* @brief Implementation of the PositionActual object. This file has been
|
||||||
* automatically generated by the UAVObjectGenerator.
|
* automatically generated by the UAVObjectGenerator.
|
||||||
*
|
*
|
||||||
* @note Object definition file: gpsobject.xml.
|
* @note Object definition file: positionactual.xml.
|
||||||
* This is an automatically generated file.
|
* This is an automatically generated file.
|
||||||
* DO NOT modify manually.
|
* DO NOT modify manually.
|
||||||
*
|
*
|
||||||
@ -28,18 +28,26 @@
|
|||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include "gpsobject.h"
|
#include "positionactual.h"
|
||||||
#include "uavobjectfield.h"
|
#include "uavobjectfield.h"
|
||||||
|
|
||||||
const QString GpsObject::NAME = QString("GpsObject");
|
const QString PositionActual::NAME = QString("PositionActual");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
GpsObject::GpsObject(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
PositionActual::PositionActual(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
||||||
{
|
{
|
||||||
// Create fields
|
// Create fields
|
||||||
QList<UAVObjectField*> fields;
|
QList<UAVObjectField*> fields;
|
||||||
|
QStringList StatusElemNames;
|
||||||
|
StatusElemNames.append("0");
|
||||||
|
QStringList StatusEnumOptions;
|
||||||
|
StatusEnumOptions.append("NoGPS");
|
||||||
|
StatusEnumOptions.append("NoFix");
|
||||||
|
StatusEnumOptions.append("Fix2D");
|
||||||
|
StatusEnumOptions.append("Fix3D");
|
||||||
|
fields.append( new UAVObjectField(QString("Status"), QString(""), UAVObjectField::ENUM, StatusElemNames, StatusEnumOptions) );
|
||||||
QStringList LatitudeElemNames;
|
QStringList LatitudeElemNames;
|
||||||
LatitudeElemNames.append("0");
|
LatitudeElemNames.append("0");
|
||||||
fields.append( new UAVObjectField(QString("Latitude"), QString("degrees"), UAVObjectField::FLOAT32, LatitudeElemNames, QStringList()) );
|
fields.append( new UAVObjectField(QString("Latitude"), QString("degrees"), UAVObjectField::FLOAT32, LatitudeElemNames, QStringList()) );
|
||||||
@ -52,18 +60,12 @@ GpsObject::GpsObject(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
|||||||
QStringList HeadingElemNames;
|
QStringList HeadingElemNames;
|
||||||
HeadingElemNames.append("0");
|
HeadingElemNames.append("0");
|
||||||
fields.append( new UAVObjectField(QString("Heading"), QString("degrees"), UAVObjectField::FLOAT32, HeadingElemNames, QStringList()) );
|
fields.append( new UAVObjectField(QString("Heading"), QString("degrees"), UAVObjectField::FLOAT32, HeadingElemNames, QStringList()) );
|
||||||
QStringList GroundSpeedElemNames;
|
QStringList GroundspeedElemNames;
|
||||||
GroundSpeedElemNames.append("0");
|
GroundspeedElemNames.append("0");
|
||||||
fields.append( new UAVObjectField(QString("GroundSpeed"), QString("m/s"), UAVObjectField::FLOAT32, GroundSpeedElemNames, QStringList()) );
|
fields.append( new UAVObjectField(QString("Groundspeed"), QString("m/s"), UAVObjectField::FLOAT32, GroundspeedElemNames, QStringList()) );
|
||||||
QStringList SatellitesElemNames;
|
QStringList SatellitesElemNames;
|
||||||
SatellitesElemNames.append("0");
|
SatellitesElemNames.append("0");
|
||||||
fields.append( new UAVObjectField(QString("Satellites"), QString(""), UAVObjectField::INT8, SatellitesElemNames, QStringList()) );
|
fields.append( new UAVObjectField(QString("Satellites"), QString(""), UAVObjectField::INT8, SatellitesElemNames, QStringList()) );
|
||||||
QStringList UpdatesElemNames;
|
|
||||||
UpdatesElemNames.append("0");
|
|
||||||
fields.append( new UAVObjectField(QString("Updates"), QString(""), UAVObjectField::UINT16, UpdatesElemNames, QStringList()) );
|
|
||||||
QStringList FailuresElemNames;
|
|
||||||
FailuresElemNames.append("0");
|
|
||||||
fields.append( new UAVObjectField(QString("Failures"), QString(""), UAVObjectField::UINT16, FailuresElemNames, QStringList()) );
|
|
||||||
QStringList PDOPElemNames;
|
QStringList PDOPElemNames;
|
||||||
PDOPElemNames.append("0");
|
PDOPElemNames.append("0");
|
||||||
fields.append( new UAVObjectField(QString("PDOP"), QString(""), UAVObjectField::FLOAT32, PDOPElemNames, QStringList()) );
|
fields.append( new UAVObjectField(QString("PDOP"), QString(""), UAVObjectField::FLOAT32, PDOPElemNames, QStringList()) );
|
||||||
@ -83,7 +85,7 @@ GpsObject::GpsObject(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
|||||||
/**
|
/**
|
||||||
* Get the default metadata for this object
|
* Get the default metadata for this object
|
||||||
*/
|
*/
|
||||||
UAVObject::Metadata GpsObject::getDefaultMetadata()
|
UAVObject::Metadata PositionActual::getDefaultMetadata()
|
||||||
{
|
{
|
||||||
UAVObject::Metadata metadata;
|
UAVObject::Metadata metadata;
|
||||||
metadata.flightAccess = ACCESS_READWRITE;
|
metadata.flightAccess = ACCESS_READWRITE;
|
||||||
@ -104,7 +106,7 @@ UAVObject::Metadata GpsObject::getDefaultMetadata()
|
|||||||
* If a default value is not specified the object fields
|
* If a default value is not specified the object fields
|
||||||
* will be initialized to zero.
|
* will be initialized to zero.
|
||||||
*/
|
*/
|
||||||
void GpsObject::setDefaultFieldValues()
|
void PositionActual::setDefaultFieldValues()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -112,7 +114,7 @@ void GpsObject::setDefaultFieldValues()
|
|||||||
/**
|
/**
|
||||||
* Get the object data fields
|
* Get the object data fields
|
||||||
*/
|
*/
|
||||||
GpsObject::DataFields GpsObject::getData()
|
PositionActual::DataFields PositionActual::getData()
|
||||||
{
|
{
|
||||||
QMutexLocker locker(mutex);
|
QMutexLocker locker(mutex);
|
||||||
return data;
|
return data;
|
||||||
@ -121,7 +123,7 @@ GpsObject::DataFields GpsObject::getData()
|
|||||||
/**
|
/**
|
||||||
* Set the object data fields
|
* Set the object data fields
|
||||||
*/
|
*/
|
||||||
void GpsObject::setData(const DataFields& data)
|
void PositionActual::setData(const DataFields& data)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(mutex);
|
QMutexLocker locker(mutex);
|
||||||
// Get metadata
|
// Get metadata
|
||||||
@ -140,9 +142,9 @@ void GpsObject::setData(const DataFields& data)
|
|||||||
* Do not use this function directly to create new instances, the
|
* Do not use this function directly to create new instances, the
|
||||||
* UAVObjectManager should be used instead.
|
* UAVObjectManager should be used instead.
|
||||||
*/
|
*/
|
||||||
UAVDataObject* GpsObject::clone(quint32 instID)
|
UAVDataObject* PositionActual::clone(quint32 instID)
|
||||||
{
|
{
|
||||||
GpsObject* obj = new GpsObject();
|
PositionActual* obj = new PositionActual();
|
||||||
obj->initialize(instID, this->getMetaObject());
|
obj->initialize(instID, this->getMetaObject());
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
@ -150,7 +152,7 @@ UAVDataObject* GpsObject::clone(quint32 instID)
|
|||||||
/**
|
/**
|
||||||
* Static function to retrieve an instance of the object.
|
* Static function to retrieve an instance of the object.
|
||||||
*/
|
*/
|
||||||
GpsObject* GpsObject::GetInstance(UAVObjectManager* objMngr, quint32 instID)
|
PositionActual* PositionActual::GetInstance(UAVObjectManager* objMngr, quint32 instID)
|
||||||
{
|
{
|
||||||
return dynamic_cast<GpsObject*>(objMngr->getObject(GpsObject::OBJID, instID));
|
return dynamic_cast<PositionActual*>(objMngr->getObject(PositionActual::OBJID, instID));
|
||||||
}
|
}
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* @file gpsobject.h
|
* @file positionactual.h
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
* @brief Implementation of the GpsObject object. This file has been
|
* @brief Implementation of the PositionActual object. This file has been
|
||||||
* automatically generated by the UAVObjectGenerator.
|
* automatically generated by the UAVObjectGenerator.
|
||||||
*
|
*
|
||||||
* @note Object definition file: gpsobject.xml.
|
* @note Object definition file: positionactual.xml.
|
||||||
* This is an automatically generated file.
|
* This is an automatically generated file.
|
||||||
* DO NOT modify manually.
|
* DO NOT modify manually.
|
||||||
*
|
*
|
||||||
@ -28,27 +28,26 @@
|
|||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#ifndef GPSOBJECT_H
|
#ifndef POSITIONACTUAL_H
|
||||||
#define GPSOBJECT_H
|
#define POSITIONACTUAL_H
|
||||||
|
|
||||||
#include "uavdataobject.h"
|
#include "uavdataobject.h"
|
||||||
#include "uavobjectmanager.h"
|
#include "uavobjectmanager.h"
|
||||||
|
|
||||||
class UAVOBJECTS_EXPORT GpsObject: public UAVDataObject
|
class UAVOBJECTS_EXPORT PositionActual: public UAVDataObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Field structure
|
// Field structure
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
quint8 Status;
|
||||||
float Latitude;
|
float Latitude;
|
||||||
float Longitude;
|
float Longitude;
|
||||||
float Altitude;
|
float Altitude;
|
||||||
float Heading;
|
float Heading;
|
||||||
float GroundSpeed;
|
float Groundspeed;
|
||||||
qint8 Satellites;
|
qint8 Satellites;
|
||||||
quint16 Updates;
|
|
||||||
quint16 Failures;
|
|
||||||
float PDOP;
|
float PDOP;
|
||||||
float HDOP;
|
float HDOP;
|
||||||
float VDOP;
|
float VDOP;
|
||||||
@ -56,35 +55,36 @@ public:
|
|||||||
} __attribute__((packed)) DataFields;
|
} __attribute__((packed)) DataFields;
|
||||||
|
|
||||||
// Field information
|
// Field information
|
||||||
|
// Field Status information
|
||||||
|
/* Enumeration options for field Status */
|
||||||
|
typedef enum { STATUS_NOGPS=0, STATUS_NOFIX=1, STATUS_FIX2D=2, STATUS_FIX3D=3, } StatusOptions;
|
||||||
// Field Latitude information
|
// Field Latitude information
|
||||||
// Field Longitude information
|
// Field Longitude information
|
||||||
// Field Altitude information
|
// Field Altitude information
|
||||||
// Field Heading information
|
// Field Heading information
|
||||||
// Field GroundSpeed information
|
// Field Groundspeed information
|
||||||
// Field Satellites information
|
// Field Satellites information
|
||||||
// Field Updates information
|
|
||||||
// Field Failures information
|
|
||||||
// Field PDOP information
|
// Field PDOP information
|
||||||
// Field HDOP information
|
// Field HDOP information
|
||||||
// Field VDOP information
|
// Field VDOP information
|
||||||
|
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
static const quint32 OBJID = 3887395742U;
|
static const quint32 OBJID = 981132812U;
|
||||||
static const QString NAME;
|
static const QString NAME;
|
||||||
static const bool ISSINGLEINST = 1;
|
static const bool ISSINGLEINST = 1;
|
||||||
static const bool ISSETTINGS = 0;
|
static const bool ISSETTINGS = 0;
|
||||||
static const quint32 NUMBYTES = sizeof(DataFields);
|
static const quint32 NUMBYTES = sizeof(DataFields);
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
GpsObject();
|
PositionActual();
|
||||||
|
|
||||||
DataFields getData();
|
DataFields getData();
|
||||||
void setData(const DataFields& data);
|
void setData(const DataFields& data);
|
||||||
Metadata getDefaultMetadata();
|
Metadata getDefaultMetadata();
|
||||||
UAVDataObject* clone(quint32 instID);
|
UAVDataObject* clone(quint32 instID);
|
||||||
|
|
||||||
static GpsObject* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
|
static PositionActual* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DataFields data;
|
DataFields data;
|
||||||
@ -93,4 +93,4 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GPSOBJECT_H
|
#endif // POSITIONACTUAL_H
|
@ -1,12 +1,12 @@
|
|||||||
##
|
##
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# @file gpsobject.py
|
# @file positionactual.py
|
||||||
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||||
# @brief Implementation of the GpsObject object. This file has been
|
# @brief Implementation of the PositionActual object. This file has been
|
||||||
# automatically generated by the UAVObjectGenerator.
|
# automatically generated by the UAVObjectGenerator.
|
||||||
#
|
#
|
||||||
# @note Object definition file: gpsobject.xml.
|
# @note Object definition file: positionactual.xml.
|
||||||
# This is an automatically generated file.
|
# This is an automatically generated file.
|
||||||
# DO NOT modify manually.
|
# DO NOT modify manually.
|
||||||
#
|
#
|
||||||
@ -37,6 +37,20 @@ from collections import namedtuple
|
|||||||
|
|
||||||
# This is a list of instances of the data fields contained in this object
|
# This is a list of instances of the data fields contained in this object
|
||||||
_fields = [ \
|
_fields = [ \
|
||||||
|
uavobject.UAVObjectField(
|
||||||
|
'Status',
|
||||||
|
'b',
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
'0',
|
||||||
|
],
|
||||||
|
{
|
||||||
|
'0' : 'NoGPS',
|
||||||
|
'1' : 'NoFix',
|
||||||
|
'2' : 'Fix2D',
|
||||||
|
'3' : 'Fix3D',
|
||||||
|
}
|
||||||
|
),
|
||||||
uavobject.UAVObjectField(
|
uavobject.UAVObjectField(
|
||||||
'Latitude',
|
'Latitude',
|
||||||
'f',
|
'f',
|
||||||
@ -78,7 +92,7 @@ _fields = [ \
|
|||||||
}
|
}
|
||||||
),
|
),
|
||||||
uavobject.UAVObjectField(
|
uavobject.UAVObjectField(
|
||||||
'GroundSpeed',
|
'Groundspeed',
|
||||||
'f',
|
'f',
|
||||||
1,
|
1,
|
||||||
[
|
[
|
||||||
@ -97,26 +111,6 @@ _fields = [ \
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
uavobject.UAVObjectField(
|
|
||||||
'Updates',
|
|
||||||
'H',
|
|
||||||
1,
|
|
||||||
[
|
|
||||||
'0',
|
|
||||||
],
|
|
||||||
{
|
|
||||||
}
|
|
||||||
),
|
|
||||||
uavobject.UAVObjectField(
|
|
||||||
'Failures',
|
|
||||||
'H',
|
|
||||||
1,
|
|
||||||
[
|
|
||||||
'0',
|
|
||||||
],
|
|
||||||
{
|
|
||||||
}
|
|
||||||
),
|
|
||||||
uavobject.UAVObjectField(
|
uavobject.UAVObjectField(
|
||||||
'PDOP',
|
'PDOP',
|
||||||
'f',
|
'f',
|
||||||
@ -150,11 +144,11 @@ _fields = [ \
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class GpsObject(uavobject.UAVObject):
|
class PositionActual(uavobject.UAVObject):
|
||||||
## Object constants
|
## Object constants
|
||||||
OBJID = 3887395742
|
OBJID = 981132812
|
||||||
NAME = "GpsObject"
|
NAME = "PositionActual"
|
||||||
METANAME = "GpsObjectMeta"
|
METANAME = "PositionActualMeta"
|
||||||
ISSINGLEINST = 1
|
ISSINGLEINST = 1
|
||||||
ISSETTINGS = 0
|
ISSETTINGS = 0
|
||||||
|
|
||||||
@ -178,7 +172,7 @@ class GpsObject(uavobject.UAVObject):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Instantiate the object and dump out some interesting info
|
# Instantiate the object and dump out some interesting info
|
||||||
x = GpsObject()
|
x = PositionActual()
|
||||||
print (x)
|
print (x)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
@ -16,7 +16,6 @@ HEADERS += uavobjects_global.h \
|
|||||||
attitudesettings.h \
|
attitudesettings.h \
|
||||||
exampleobject2.h \
|
exampleobject2.h \
|
||||||
exampleobject1.h \
|
exampleobject1.h \
|
||||||
gpsobject.h \
|
|
||||||
gcstelemetrystats.h \
|
gcstelemetrystats.h \
|
||||||
flighttelemetrystats.h \
|
flighttelemetrystats.h \
|
||||||
systemstats.h \
|
systemstats.h \
|
||||||
@ -30,7 +29,8 @@ HEADERS += uavobjects_global.h \
|
|||||||
attitudedesired.h \
|
attitudedesired.h \
|
||||||
actuatorsettings.h \
|
actuatorsettings.h \
|
||||||
actuatordesired.h \
|
actuatordesired.h \
|
||||||
actuatorcommand.h
|
actuatorcommand.h \
|
||||||
|
positionactual.h
|
||||||
SOURCES += uavobject.cpp \
|
SOURCES += uavobject.cpp \
|
||||||
uavmetaobject.cpp \
|
uavmetaobject.cpp \
|
||||||
uavobjectmanager.cpp \
|
uavobjectmanager.cpp \
|
||||||
@ -44,7 +44,6 @@ SOURCES += uavobject.cpp \
|
|||||||
examplesettings.cpp \
|
examplesettings.cpp \
|
||||||
exampleobject2.cpp \
|
exampleobject2.cpp \
|
||||||
exampleobject1.cpp \
|
exampleobject1.cpp \
|
||||||
gpsobject.cpp \
|
|
||||||
gcstelemetrystats.cpp \
|
gcstelemetrystats.cpp \
|
||||||
flighttelemetrystats.cpp \
|
flighttelemetrystats.cpp \
|
||||||
systemstats.cpp \
|
systemstats.cpp \
|
||||||
@ -58,6 +57,7 @@ SOURCES += uavobject.cpp \
|
|||||||
attitudedesired.cpp \
|
attitudedesired.cpp \
|
||||||
actuatorsettings.cpp \
|
actuatorsettings.cpp \
|
||||||
actuatordesired.cpp \
|
actuatordesired.cpp \
|
||||||
actuatorcommand.cpp
|
actuatorcommand.cpp \
|
||||||
|
positionactual.cpp
|
||||||
DEFINES += UAVOBJECTS_LIBRARY
|
DEFINES += UAVOBJECTS_LIBRARY
|
||||||
OTHER_FILES += UAVObjects.pluginspec
|
OTHER_FILES += UAVObjects.pluginspec
|
||||||
|
@ -42,10 +42,10 @@
|
|||||||
#include "examplesettings.h"
|
#include "examplesettings.h"
|
||||||
#include "flighttelemetrystats.h"
|
#include "flighttelemetrystats.h"
|
||||||
#include "gcstelemetrystats.h"
|
#include "gcstelemetrystats.h"
|
||||||
#include "gpsobject.h"
|
|
||||||
#include "manualcontrolcommand.h"
|
#include "manualcontrolcommand.h"
|
||||||
#include "manualcontrolsettings.h"
|
#include "manualcontrolsettings.h"
|
||||||
#include "objectpersistence.h"
|
#include "objectpersistence.h"
|
||||||
|
#include "positionactual.h"
|
||||||
#include "stabilizationsettings.h"
|
#include "stabilizationsettings.h"
|
||||||
#include "systemalarms.h"
|
#include "systemalarms.h"
|
||||||
#include "systemsettings.h"
|
#include "systemsettings.h"
|
||||||
@ -71,10 +71,10 @@ void UAVObjectsInitialize(UAVObjectManager* objMngr)
|
|||||||
objMngr->registerObject( new ExampleSettings() );
|
objMngr->registerObject( new ExampleSettings() );
|
||||||
objMngr->registerObject( new FlightTelemetryStats() );
|
objMngr->registerObject( new FlightTelemetryStats() );
|
||||||
objMngr->registerObject( new GCSTelemetryStats() );
|
objMngr->registerObject( new GCSTelemetryStats() );
|
||||||
objMngr->registerObject( new GpsObject() );
|
|
||||||
objMngr->registerObject( new ManualControlCommand() );
|
objMngr->registerObject( new ManualControlCommand() );
|
||||||
objMngr->registerObject( new ManualControlSettings() );
|
objMngr->registerObject( new ManualControlSettings() );
|
||||||
objMngr->registerObject( new ObjectPersistence() );
|
objMngr->registerObject( new ObjectPersistence() );
|
||||||
|
objMngr->registerObject( new PositionActual() );
|
||||||
objMngr->registerObject( new StabilizationSettings() );
|
objMngr->registerObject( new StabilizationSettings() );
|
||||||
objMngr->registerObject( new SystemAlarms() );
|
objMngr->registerObject( new SystemAlarms() );
|
||||||
objMngr->registerObject( new SystemSettings() );
|
objMngr->registerObject( new SystemSettings() );
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
<xml>
|
<xml>
|
||||||
<object name="GpsObject" singleinstance="true" settings="false">
|
<object name="PositionActual" singleinstance="true" settings="false">
|
||||||
|
<field name="Status" units="" type="enum" elements="1" options="NoGPS,NoFix,Fix2D,Fix3D"/>
|
||||||
<field name="Latitude" units="degrees" type="float" elements="1"/>
|
<field name="Latitude" units="degrees" type="float" elements="1"/>
|
||||||
<field name="Longitude" units="degrees" type="float" elements="1"/>
|
<field name="Longitude" units="degrees" type="float" elements="1"/>
|
||||||
<field name="Altitude" units="meters" type="float" elements="1"/>
|
<field name="Altitude" units="meters" type="float" elements="1"/>
|
||||||
<field name="Heading" units="degrees" type="float" elements="1"/>
|
<field name="Heading" units="degrees" type="float" elements="1"/>
|
||||||
<field name="GroundSpeed" units="m/s" type="float" elements="1"/>
|
<field name="Groundspeed" units="m/s" type="float" elements="1"/>
|
||||||
<field name="Satellites" units="" type="int8" elements="1"/>
|
<field name="Satellites" units="" type="int8" elements="1"/>
|
||||||
<field name="Updates" units="" type="uint16" elements="1"/>
|
|
||||||
<field name="Failures" units="" type="uint16" elements="1"/>
|
|
||||||
<field name="PDOP" units="" type="float" elements="1"/>
|
<field name="PDOP" units="" type="float" elements="1"/>
|
||||||
<field name="HDOP" units="" type="float" elements="1"/>
|
<field name="HDOP" units="" type="float" elements="1"/>
|
||||||
<field name="VDOP" units="" type="float" elements="1"/>
|
<field name="VDOP" units="" type="float" elements="1"/>
|
Loading…
x
Reference in New Issue
Block a user