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)
|
// get altitude (in meters mm.m)
|
||||||
tokens = strsep(&packet, delimiter);
|
tokens = strsep(&packet, delimiter);
|
||||||
//reuse variables for alt
|
//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);
|
desim=strtol (pEnd+1,NULL,10);
|
||||||
if(1) // OPGPS 3 desimal
|
if(1) // OPGPS 3 decimal
|
||||||
GpsData.Altitude=deg+desim/1000.0;
|
GpsData.Altitude=deg+desim/1000.0;
|
||||||
else
|
else
|
||||||
GpsData.Altitude=deg+desim/10.0;
|
GpsData.Altitude=deg+desim/10.0;
|
||||||
|
|
||||||
// next field: altitude units, always 'M'
|
// next field: altitude units, always 'M'
|
||||||
// next field: geoid seperation
|
tokens = strsep(&packet, delimiter);
|
||||||
// next field: seperation units
|
// 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 age
|
||||||
// next field: DGPS station ID
|
// next field: DGPS station ID
|
||||||
// next field: checksum
|
// next field: checksum
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#define POSITIONACTUAL_H
|
#define POSITIONACTUAL_H
|
||||||
|
|
||||||
// Object constants
|
// Object constants
|
||||||
#define POSITIONACTUAL_OBJID 981132812U
|
#define POSITIONACTUAL_OBJID 1265479538U
|
||||||
#define POSITIONACTUAL_NAME "PositionActual"
|
#define POSITIONACTUAL_NAME "PositionActual"
|
||||||
#define POSITIONACTUAL_METANAME "PositionActualMeta"
|
#define POSITIONACTUAL_METANAME "PositionActualMeta"
|
||||||
#define POSITIONACTUAL_ISSINGLEINST 1
|
#define POSITIONACTUAL_ISSINGLEINST 1
|
||||||
@ -61,6 +61,7 @@ typedef struct {
|
|||||||
float Latitude;
|
float Latitude;
|
||||||
float Longitude;
|
float Longitude;
|
||||||
float Altitude;
|
float Altitude;
|
||||||
|
float GeoidSeparation;
|
||||||
float Heading;
|
float Heading;
|
||||||
float Groundspeed;
|
float Groundspeed;
|
||||||
int8_t Satellites;
|
int8_t Satellites;
|
||||||
@ -77,6 +78,7 @@ typedef enum { POSITIONACTUAL_STATUS_NOGPS=0, POSITIONACTUAL_STATUS_NOFIX=1, POS
|
|||||||
// Field Latitude information
|
// Field Latitude information
|
||||||
// Field Longitude information
|
// Field Longitude information
|
||||||
// Field Altitude information
|
// Field Altitude information
|
||||||
|
// Field GeoidSeparation information
|
||||||
// Field Heading information
|
// Field Heading information
|
||||||
// Field Groundspeed information
|
// Field Groundspeed information
|
||||||
// Field Satellites information
|
// Field Satellites information
|
||||||
|
@ -57,6 +57,9 @@ PositionActual::PositionActual(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS,
|
|||||||
QStringList AltitudeElemNames;
|
QStringList AltitudeElemNames;
|
||||||
AltitudeElemNames.append("0");
|
AltitudeElemNames.append("0");
|
||||||
fields.append( new UAVObjectField(QString("Altitude"), QString("meters"), UAVObjectField::FLOAT32, AltitudeElemNames, QStringList()) );
|
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;
|
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()) );
|
||||||
|
@ -45,6 +45,7 @@ public:
|
|||||||
float Latitude;
|
float Latitude;
|
||||||
float Longitude;
|
float Longitude;
|
||||||
float Altitude;
|
float Altitude;
|
||||||
|
float GeoidSeparation;
|
||||||
float Heading;
|
float Heading;
|
||||||
float Groundspeed;
|
float Groundspeed;
|
||||||
qint8 Satellites;
|
qint8 Satellites;
|
||||||
@ -61,6 +62,7 @@ public:
|
|||||||
// Field Latitude information
|
// Field Latitude information
|
||||||
// Field Longitude information
|
// Field Longitude information
|
||||||
// Field Altitude information
|
// Field Altitude information
|
||||||
|
// Field GeoidSeparation information
|
||||||
// Field Heading information
|
// Field Heading information
|
||||||
// Field Groundspeed information
|
// Field Groundspeed information
|
||||||
// Field Satellites information
|
// Field Satellites information
|
||||||
@ -70,7 +72,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
static const quint32 OBJID = 981132812U;
|
static const quint32 OBJID = 1265479538U;
|
||||||
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;
|
||||||
|
@ -81,6 +81,16 @@ _fields = [ \
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
uavobject.UAVObjectField(
|
||||||
|
'GeoidSeparation',
|
||||||
|
'f',
|
||||||
|
1,
|
||||||
|
[
|
||||||
|
'0',
|
||||||
|
],
|
||||||
|
{
|
||||||
|
}
|
||||||
|
),
|
||||||
uavobject.UAVObjectField(
|
uavobject.UAVObjectField(
|
||||||
'Heading',
|
'Heading',
|
||||||
'f',
|
'f',
|
||||||
@ -146,7 +156,7 @@ _fields = [ \
|
|||||||
|
|
||||||
class PositionActual(uavobject.UAVObject):
|
class PositionActual(uavobject.UAVObject):
|
||||||
## Object constants
|
## Object constants
|
||||||
OBJID = 981132812
|
OBJID = 1265479538
|
||||||
NAME = "PositionActual"
|
NAME = "PositionActual"
|
||||||
METANAME = "PositionActualMeta"
|
METANAME = "PositionActualMeta"
|
||||||
ISSINGLEINST = 1
|
ISSINGLEINST = 1
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
<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="GeoidSeparation" 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"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user