mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
OP-25 Flight/GPS: More object fields for GPS module
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@664 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
06c9bef7aa
commit
f7f1b37c62
@ -33,7 +33,7 @@
|
||||
#define GPSOBJECT_H
|
||||
|
||||
// Object constants
|
||||
#define GPSOBJECT_OBJID 4217926642U
|
||||
#define GPSOBJECT_OBJID 2363300180U
|
||||
#define GPSOBJECT_NAME "GpsObject"
|
||||
#define GPSOBJECT_METANAME "GpsObjectMeta"
|
||||
#define GPSOBJECT_ISSINGLEINST 1
|
||||
@ -62,6 +62,10 @@ typedef struct {
|
||||
float Altitude;
|
||||
int8_t Satellites;
|
||||
uint16_t Updates;
|
||||
uint16_t Failures;
|
||||
float PDOP;
|
||||
float HDOP;
|
||||
float VDOP;
|
||||
|
||||
} __attribute__((packed)) GpsObjectData;
|
||||
|
||||
@ -71,6 +75,10 @@ typedef struct {
|
||||
// Field Altitude information
|
||||
// Field Satellites information
|
||||
// Field Updates information
|
||||
// Field Failures information
|
||||
// Field PDOP information
|
||||
// Field HDOP information
|
||||
// Field VDOP information
|
||||
|
||||
|
||||
// Generic interface functions
|
||||
|
@ -55,6 +55,18 @@ GpsObject::GpsObject(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
||||
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;
|
||||
PDOPElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("PDOP"), QString(""), UAVObjectField::FLOAT32, PDOPElemNames, QStringList()) );
|
||||
QStringList HDOPElemNames;
|
||||
HDOPElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("HDOP"), QString(""), UAVObjectField::FLOAT32, HDOPElemNames, QStringList()) );
|
||||
QStringList VDOPElemNames;
|
||||
VDOPElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("VDOP"), QString(""), UAVObjectField::FLOAT32, VDOPElemNames, QStringList()) );
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, (quint8*)&data, NUMBYTES);
|
||||
|
@ -46,6 +46,10 @@ public:
|
||||
float Altitude;
|
||||
qint8 Satellites;
|
||||
quint16 Updates;
|
||||
quint16 Failures;
|
||||
float PDOP;
|
||||
float HDOP;
|
||||
float VDOP;
|
||||
|
||||
} __attribute__((packed)) DataFields;
|
||||
|
||||
@ -55,10 +59,14 @@ public:
|
||||
// Field Altitude information
|
||||
// Field Satellites information
|
||||
// Field Updates information
|
||||
// Field Failures information
|
||||
// Field PDOP information
|
||||
// Field HDOP information
|
||||
// Field VDOP information
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 4217926642U;
|
||||
static const quint32 OBJID = 2363300180U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 0;
|
||||
|
@ -87,12 +87,52 @@ _fields = [ \
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Failures',
|
||||
'H',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'PDOP',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'HDOP',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'VDOP',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class GpsObject(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 4217926642
|
||||
OBJID = 2363300180
|
||||
NAME = "GpsObject"
|
||||
METANAME = "GpsObjectMeta"
|
||||
ISSINGLEINST = 1
|
||||
|
@ -5,6 +5,10 @@
|
||||
<field name="Altitude" units="meters" type="float" 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="HDOP" units="" type="float" elements="1"/>
|
||||
<field name="VDOP" units="" type="float" elements="1"/>
|
||||
<access gcs="readwrite" flight="readwrite"/>
|
||||
<telemetrygcs acked="true" updatemode="manual" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="periodic" period="1000"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user