Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::sense::MockPosition Class Reference

Mock position. More...

Inheritance diagram for gem::sense::MockPosition:
Collaboration diagram for gem::sense::MockPosition:

Public Types

enum class  EProvider {
  Unknown , GPS , Network , SensorFusion ,
  MapMatching , Simulation
}
 Values that represent the type of position provider. More...
enum class  EFixQuality { Invalid , Inertial , Low , High }
 Values that represent position data quality. More...

Public Member Functions

LargeInteger getAcquisitionTimestamp () const override
LargeInteger getSatelliteTime () const override
 Satellite timestamp, milliseconds since 1970.
EProvider getProvider () const override
 Provider type: GPS, Network, Unknown.
double getLatitude () const override
 Geographical latitude.
double getLongitude () const override
 Geographical longitude.
double getAltitude () const override
 Altitude above main sea level.
double getSpeed () const override
 Travel speed.
double getSpeedAccuracy () const override
 Travel speed accuracy.
double getCourse () const override
 The course of the movement.
double getCourseAccuracy () const override
 Course accuracy.
double getHorizontalAccuracy () const override
 Horizontal accuracy of position.
double getVerticalAccuracy () const override
 Vertical accuracy of position.
EFixQuality getFixQuality () const override
 Fix quality (whether this position is trustworthy); see the explanations at EFixQuality.
bool hasCoordinates () const override
 Query if this object has valid coordinates.
bool hasAltitude () const override
 Query if this object has altitude.
bool hasSpeed () const override
 Query if this object has speed.
bool hasSpeedAccuracy () const override
 Query if this object has speed accuracy.
bool hasCourse () const override
 Query if this object has course.
bool hasCourseAccuracy () const override
 Query if this object has course accuracy.
bool hasHorizontalAccuracy () const override
 Query if this object has horizontal accuracy.
bool hasVerticalAccuracy () const override
 Query if this object has vertical accuracy.
EDataType getType () const override
 Get data type.
LargeInteger getSatelliteTimestamp () const
 Satellite timestamp, milliseconds since 1970.
Coordinates getCoordinates () const
 Latitude and longitude.
bool isValid () const
Time getTime () const
template<typename TDerivedType>
StrongPointer< TDerivedType > cast ()
 Cast to a derived type.

Static Public Member Functions

static MockPositionPtr produce (const double &latitude=kUndefined, const double &longitude=kUndefined, const double &altitude=kUndefined, const double &speed=kUndefined, const double &course=kUndefined, int fix=kUndefinedFix)
 Create a mock position data object.
static bool isSameType (const IData *ptr)
 Check if a certain data element is of Position type.

Static Public Attributes

static constexpr const double kUndefined = std::numeric_limits<double>::max()
 When applying the mock, position data having this value will be ignored.
static constexpr const int kUndefinedFix = -1
 Undefined value for fix parameter.

Detailed Description

Mock position.

Member Enumeration Documentation

◆ EFixQuality

enum class gem::sense::IPosition::EFixQuality
stronginherited

Values that represent position data quality.

Invalid means the position can not or should not be processed (for instance, invalid coordinates)

Inertial means position has resulted from inertial extrapolation; there is a GPS outage (e.g. tunnel)

Low means the position is valid but cannot be trusted because of bad GPS accuracy (e.g. urban canyon)

High means the position is valid and can be trusted (is recent and has a good accuracy)

Enumerator
Invalid 

The position data is invalid and should not be processed.

Inertial 

The position data is inertial.

Low 

The position is valid but has low accuracy and cannot be fully trusted.

High 

The position is valid and can be trusted due to good accuracy and recency.

◆ EProvider

enum class gem::sense::IPosition::EProvider
stronginherited

Values that represent the type of position provider.

GPS means that the position comes from a GPS sensor.

Network means that the position comes from a network source, but not GPS.

Enumerator
Unknown 

The position provider is unknown.

GPS 

The position is obtained from a GPS sensor.

Network 

The position is obtained from a network-based source.

SensorFusion 

The position is improved using inertial sensors for better accuracy.

MapMatching 

The position is matched with a map for better accuracy.

Simulation 

The position data comes from a simulation environment.

Member Function Documentation

◆ cast()

template<typename TDerivedType>
StrongPointer< TDerivedType > gem::sense::IData::cast ( )
inlineinherited

Cast to a derived type.

Returns
The requested derived type as a shared pointer.

◆ getAcquisitionTimestamp()

LargeInteger gem::sense::MockPosition::getAcquisitionTimestamp ( ) const
inlineoverridevirtual
Returns
Acquisition timestamp in milliseconds since 1970 ( epoch )

Implements gem::sense::IData.

◆ getAltitude()

double gem::sense::MockPosition::getAltitude ( ) const
inlineoverridevirtual

Altitude above main sea level.

Returns
The altitude in meters.

Implements gem::sense::IPosition.

◆ getCoordinates()

Coordinates gem::sense::IPosition::getCoordinates ( ) const
inlineinherited

Latitude and longitude.

If both values are equal to 0, the position is considered invalid

Returns
Coordinate pair, both latitude and longitude in degrees

◆ getCourse()

double gem::sense::MockPosition::getCourse ( ) const
inlineoverridevirtual

The course of the movement.

Represents true heading, not magnetic heading.

0 means true north, 90 east, 180 south, 270 west.

A negative value (-1 by default) means the position has no course information.

Returns
The course in degrees.

Implements gem::sense::IPosition.

◆ getCourseAccuracy()

double gem::sense::MockPosition::getCourseAccuracy ( ) const
inlineoverridevirtual

Course accuracy.

Typical accuracy for consumer GPS is 25 degrees at high speeds.

Valid course accuracy should always be positive.

Returns
The course accuracy in degrees.

Implements gem::sense::IPosition.

◆ getFixQuality()

EFixQuality gem::sense::MockPosition::getFixQuality ( ) const
inlineoverridevirtual

Fix quality (whether this position is trustworthy); see the explanations at EFixQuality.

Returns
The fix quality.

Implements gem::sense::IPosition.

◆ getHorizontalAccuracy()

double gem::sense::MockPosition::getHorizontalAccuracy ( ) const
inlineoverridevirtual

Horizontal accuracy of position.

Typical accuracy for consumer GPS is 5-20 meters.

Valid position accuracy should always be positive.

Returns
The horizontal position accuracy in meters.

Implements gem::sense::IPosition.

◆ getLatitude()

double gem::sense::MockPosition::getLatitude ( ) const
inlineoverridevirtual

Geographical latitude.

From -90 to +90; positive on northern hemisphere

If value is out of the -90...90 range, the position is considered invalid.

Returns
The latitude in degrees

Implements gem::sense::IPosition.

◆ getLongitude()

double gem::sense::MockPosition::getLongitude ( ) const
inlineoverridevirtual

Geographical longitude.

From -180 to +180; positive on eastern hemisphere

If value is out of the -180...180 range, the position is considered invalid.

Returns
The longitude in degrees

Implements gem::sense::IPosition.

◆ getProvider()

EProvider gem::sense::MockPosition::getProvider ( ) const
inlineoverridevirtual

Provider type: GPS, Network, Unknown.

Returns
The provider type.

Implements gem::sense::IPosition.

◆ getSatelliteTime()

LargeInteger gem::sense::MockPosition::getSatelliteTime ( ) const
inlineoverridevirtual

Satellite timestamp, milliseconds since 1970.

Timestamps are expected to increase monotonously for subsequent positions; data with timestamp from the past will be discarded.

Returns
The satellite time in milliseconds

Implements gem::sense::IPosition.

◆ getSatelliteTimestamp()

LargeInteger gem::sense::IPosition::getSatelliteTimestamp ( ) const
inlineinherited

Satellite timestamp, milliseconds since 1970.

Timestamps are expected to increase monotonously for subsequent positions; data with timestamp from the past will be discarded.

Returns
The satellite time in milliseconds

◆ getSpeed()

double gem::sense::MockPosition::getSpeed ( ) const
inlineoverridevirtual

Travel speed.

Valid speed information should always be non-negative.

A negative value (-1 by default) means the position has no speed information.

If car is going backwards, the course should change by 180, but the speed should still be non-negative.

Returns
The speed, in m/s.

Implements gem::sense::IPosition.

◆ getSpeedAccuracy()

double gem::sense::MockPosition::getSpeedAccuracy ( ) const
inlineoverridevirtual

Travel speed accuracy.

Typical accuracy for consumer GPS is 2 m/s at steady speed and high position accuracy.

Valid speed accuracy should always be positive.

Returns
The speed accuracy in m/s.

Implements gem::sense::IPosition.

◆ getTime()

Time gem::sense::IData::getTime ( ) const
inlineinherited
Returns
System acquisition time

◆ getType()

EDataType gem::sense::IPosition::getType ( ) const
inlineoverridevirtualinherited

Get data type.

Returns
The type.

Implements gem::sense::IData.

◆ getVerticalAccuracy()

double gem::sense::MockPosition::getVerticalAccuracy ( ) const
inlineoverridevirtual

Vertical accuracy of position.

Valid position accuracy should always be positive.

Returns
The vertical position accuracy in meters.

Implements gem::sense::IPosition.

◆ hasAltitude()

bool gem::sense::MockPosition::hasAltitude ( ) const
inlineoverridevirtual

Query if this object has altitude.

Returns
True if altitude is available and valid, false if not.

Implements gem::sense::IPosition.

◆ hasCoordinates()

bool gem::sense::MockPosition::hasCoordinates ( ) const
inlineoverridevirtual

Query if this object has valid coordinates.

Returns
True if latitude and longitude are available and valid, false if not.

Implements gem::sense::IPosition.

◆ hasCourse()

bool gem::sense::MockPosition::hasCourse ( ) const
inlineoverridevirtual

Query if this object has course.

Returns
True if course is available and valid, false if not.

Implements gem::sense::IPosition.

◆ hasCourseAccuracy()

bool gem::sense::MockPosition::hasCourseAccuracy ( ) const
inlineoverridevirtual

Query if this object has course accuracy.

Returns
True if course accuracy is available and valid, false if not.

Implements gem::sense::IPosition.

◆ hasHorizontalAccuracy()

bool gem::sense::MockPosition::hasHorizontalAccuracy ( ) const
inlineoverridevirtual

Query if this object has horizontal accuracy.

Returns
True if horizontal accuracy is available and valid, false if not.

Implements gem::sense::IPosition.

◆ hasSpeed()

bool gem::sense::MockPosition::hasSpeed ( ) const
inlineoverridevirtual

Query if this object has speed.

Returns
True if speed is available and valid, false if not.

Implements gem::sense::IPosition.

◆ hasSpeedAccuracy()

bool gem::sense::MockPosition::hasSpeedAccuracy ( ) const
inlineoverridevirtual

Query if this object has speed accuracy.

Returns
True if speed accuracy is available and valid, false if not.

Implements gem::sense::IPosition.

◆ hasVerticalAccuracy()

bool gem::sense::MockPosition::hasVerticalAccuracy ( ) const
inlineoverridevirtual

Query if this object has vertical accuracy.

Returns
True if vertical accuracy is available and valid, false if not.

Implements gem::sense::IPosition.

◆ isSameType()

bool gem::sense::IPosition::isSameType ( const IData * ptr)
inlinestaticinherited

Check if a certain data element is of Position type.

Parameters
ptrThe other IData pointer to check against.
Returns
True if the examined data is of type Position or ImprovedPosition

◆ isValid()

bool gem::sense::IPosition::isValid ( ) const
inlineinherited
Returns
Whether this position is valid.

◆ produce()

MockPositionPtr gem::sense::MockPosition::produce ( const double & latitude = kUndefined,
const double & longitude = kUndefined,
const double & altitude = kUndefined,
const double & speed = kUndefined,
const double & course = kUndefined,
int fix = kUndefinedFix )
inlinestatic

Create a mock position data object.

Parameters
latitudeThe latitude of the position in degrees.
longitudeThe longitude of the position in degrees.
altitudeThe altitude in meters.
speedThe speed in meter/second.
courseThe course in degrees.
fixThe fix quality.
See also
sense::IPosition::EFixQuality.
Returns
The newly created object as a shared pointer.