mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
OP-97 flight/GPS: GeoidSeparation added, need to think that precision problem
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1056 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
983588e134
commit
9003cd8eca
@ -425,16 +425,25 @@ void nmeaProcessGPGGA(char* packet)
|
||||
// get altitude (in meters mm.m)
|
||||
tokens = strsep(&packet, delimiter);
|
||||
//reuse variables for alt
|
||||
deg=strtol (tokens,&pEnd,10); // always 0.1m resolution?
|
||||
deg=strtol (tokens,&pEnd,10); // always 0.1m resolution? No
|
||||
desim=strtol (pEnd+1,NULL,10);
|
||||
if(1) // OPGPS 3 desimal
|
||||
if(1) // OPGPS 3 decimal
|
||||
GpsData.Altitude=deg+desim/1000.0;
|
||||
else
|
||||
GpsData.Altitude=deg+desim/10.0;
|
||||
|
||||
// next field: altitude units, always 'M'
|
||||
// next field: geoid seperation
|
||||
// next field: seperation units
|
||||
tokens = strsep(&packet, delimiter);
|
||||
// next field: geoid separation
|
||||
tokens = strsep(&packet, delimiter);
|
||||
//reuse variables for geoid separation
|
||||
deg=strtol (tokens,&pEnd,10); // always 0.1m resolution? No
|
||||
desim=strtol (pEnd+1,NULL,10);
|
||||
if(1) // OPGPS 3 decimal
|
||||
GpsData.GeoidSeparation=deg+desim/1000.0;
|
||||
else
|
||||
GpsData.GeoidSeparation=deg+desim/10.0;
|
||||
// next field: separation units
|
||||
// next field: DGPS age
|
||||
// next field: DGPS station ID
|
||||
// next field: checksum
|
||||
|
@ -33,7 +33,7 @@
|
||||
#define POSITIONACTUAL_H
|
||||
|
||||
// Object constants
|
||||
#define POSITIONACTUAL_OBJID 981132812U
|
||||
#define POSITIONACTUAL_OBJID 1265479538U
|
||||
#define POSITIONACTUAL_NAME "PositionActual"
|
||||
#define POSITIONACTUAL_METANAME "PositionActualMeta"
|
||||
#define POSITIONACTUAL_ISSINGLEINST 1
|
||||
@ -61,6 +61,7 @@ typedef struct {
|
||||
float Latitude;
|
||||
float Longitude;
|
||||
float Altitude;
|
||||
float GeoidSeparation;
|
||||
float Heading;
|
||||
float Groundspeed;
|
||||
int8_t Satellites;
|
||||
@ -77,6 +78,7 @@ typedef enum { POSITIONACTUAL_STATUS_NOGPS=0, POSITIONACTUAL_STATUS_NOFIX=1, POS
|
||||
// Field Latitude information
|
||||
// Field Longitude information
|
||||
// Field Altitude information
|
||||
// Field GeoidSeparation information
|
||||
// Field Heading information
|
||||
// Field Groundspeed information
|
||||
// Field Satellites information
|
||||
|
@ -57,6 +57,9 @@ PositionActual::PositionActual(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS,
|
||||
QStringList AltitudeElemNames;
|
||||
AltitudeElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Altitude"), QString("meters"), UAVObjectField::FLOAT32, AltitudeElemNames, QStringList()) );
|
||||
QStringList GeoidSeparationElemNames;
|
||||
GeoidSeparationElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("GeoidSeparation"), QString("meters"), UAVObjectField::FLOAT32, GeoidSeparationElemNames, QStringList()) );
|
||||
QStringList HeadingElemNames;
|
||||
HeadingElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Heading"), QString("degrees"), UAVObjectField::FLOAT32, HeadingElemNames, QStringList()) );
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
float Latitude;
|
||||
float Longitude;
|
||||
float Altitude;
|
||||
float GeoidSeparation;
|
||||
float Heading;
|
||||
float Groundspeed;
|
||||
qint8 Satellites;
|
||||
@ -61,6 +62,7 @@ public:
|
||||
// Field Latitude information
|
||||
// Field Longitude information
|
||||
// Field Altitude information
|
||||
// Field GeoidSeparation information
|
||||
// Field Heading information
|
||||
// Field Groundspeed information
|
||||
// Field Satellites information
|
||||
@ -70,7 +72,7 @@ public:
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 981132812U;
|
||||
static const quint32 OBJID = 1265479538U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 0;
|
||||
|
@ -81,6 +81,16 @@ _fields = [ \
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'GeoidSeparation',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Heading',
|
||||
'f',
|
||||
@ -146,7 +156,7 @@ _fields = [ \
|
||||
|
||||
class PositionActual(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 981132812
|
||||
OBJID = 1265479538
|
||||
NAME = "PositionActual"
|
||||
METANAME = "PositionActualMeta"
|
||||
ISSINGLEINST = 1
|
||||
|
@ -4,6 +4,7 @@
|
||||
<field name="Latitude" 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="GeoidSeparation" units="meters" 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="Satellites" units="" type="int8" elements="1"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user