8#ifndef META_OCEAN_DEVICES_GPS_TRACKER_H
9#define META_OCEAN_DEVICES_GPS_TRACKER_H
96 inline float speed()
const;
231 static bool parseGPSLocation(
const std::string& gpsString,
double& latitude,
double& longitude,
double* altitude =
nullptr);
243 static bool decodePolyline(
const std::string& polyline,
const unsigned int precision, std::vector<Location>& locations,
const bool unescapeBackslash =
false);
277 static bool decodePolylineValue(
const std::string& polyline,
size_t& position, int32_t& integerValue,
const bool unescapeBackslash);
Definition of a class holding the major and minor device type.
Definition devices/Device.h:62
@ DEVICE_TRACKER
Tracker device.
Definition devices/Device.h:46
const std::string & name() const
Returns the name of this device.
Definition devices/Device.h:340
GPSTrackerSample(const Timestamp ×tamp, const ReferenceSystem referenceSystem, const ObjectIds &objectIds, const Locations &locations, const Metadata &metadata=Metadata())
Creates a new GPS sample.
Locations locations_
The GPS locations, one for each object id.
Definition GPSTracker.h:199
GPSTrackerSample(const Timestamp ×tamp, const ReferenceSystem referenceSystem, ObjectIds &&objectIds, Locations &&locations, Metadata &&metadata=Metadata())
Creates a new GPS sample.
const Locations & locations() const
Returns the GPS locations.
Definition GPSTracker.h:357
This class implements a container for a GPS location.
Definition GPSTracker.h:46
float accuracy() const
Returns the accuracy of latitude and longitude.
Definition GPSTracker.h:329
double latitude_
The latitude of the GPS position, in degree, always valid, with range [-90, 90], NumericD::minValue()...
Definition GPSTracker.h:131
Location()
Creates an invalid location.
Definition GPSTracker.h:280
float altitudeAccuracy() const
Returns the accuracy of the altitude.
Definition GPSTracker.h:334
float speed_
The speed of the device, in meter per second, with range [0, infinity), -1 if unknown.
Definition GPSTracker.h:143
float speedAccuracy() const
Returns the accuracy of the speed value.
Definition GPSTracker.h:344
bool isValid() const
Returns whether this location holds valid data.
Definition GPSTracker.h:349
float direction() const
Returns the device's travel direction not the orientation of the device.
Definition GPSTracker.h:319
float direction_
The device's travel direction not the orientation of the device, relative to north,...
Definition GPSTracker.h:140
float directionAccuracy() const
Returns the accuracy of the direction.
Definition GPSTracker.h:339
float speedAccuracy_
The accuracy of the speed value, in meter per second, with range [0, infinity), -1 if unknown.
Definition GPSTracker.h:155
float altitude() const
Returns the altitude of the GPS position.
Definition GPSTracker.h:314
double longitude() const
Returns the longitude of the GPS position.
Definition GPSTracker.h:309
float altitudeAccuracy_
The altitude accuracy, in meter, with range [0, infinity), -1 if unknown.
Definition GPSTracker.h:149
double longitude_
The longitude of the GPS position, in degree, always valid, with range [-180, 180],...
Definition GPSTracker.h:134
double latitude() const
Returns the latitude of the GPS position.
Definition GPSTracker.h:304
float altitude_
The altitude/height of the GPS position, in meter, NumericF::minValue() if unknown.
Definition GPSTracker.h:137
float directionAccuracy_
The direction accuracy, in degree, with range [0, 180], -1 if unknown.
Definition GPSTracker.h:152
float accuracy_
The horizontal position accuracy as radius, in meter, with range [0, infinity), -1 if unknown.
Definition GPSTracker.h:146
float speed() const
Returns the speed of the device.
Definition GPSTracker.h:324
This class is the base class for all gps tracker objects.
Definition GPSTracker.h:39
~GPSTracker() override
Destructs a GPS tracker object.
static bool parseGPSLocation(const std::string &gpsString, double &latitude, double &longitude, double *altitude=nullptr)
Parses a string with a GPS location.
GPSTracker(const std::string &name)
Creates a new GPS tracker object.
static bool decodePolyline(const std::string &polyline, const unsigned int precision, std::vector< Location > &locations, const bool unescapeBackslash=false)
Decodes all GPS locations from a polyline.
static bool decodePolylineValue(const std::string &polyline, size_t &position, int32_t &integerValue, const bool unescapeBackslash)
Decodes one value from a polyline.
SmartObjectRef< GPSTrackerSample, Sample > GPSTrackerSampleRef
Definition of a smart object reference for GPS tracker samples.
Definition GPSTracker.h:205
static double approximatedDistanceBetweenLocations(const Location &locationA, const Location &locationB, const double earthRadius=6378135.0)
Calculates the distance between two GPS locations in meters, the location's latitude is not considere...
StackHeapVector< Location, 1 > Locations
Definition of a vector holding GPS data values.
Definition GPSTracker.h:161
static DeviceType deviceTypeGPSTracker()
Returns the device type of this tracker.
Definition GPSTracker.h:362
const ObjectIds & objectIds() const
Returns the sample object ids specifying possible different measurement units.
Definition Measurement.h:519
const Metadata & metadata() const
Returns the metadata of this sample.
Definition Measurement.h:524
const Timestamp & timestamp() const
Returns the sample timestamp.
Definition Measurement.h:509
std::unordered_map< std::string, Value > Metadata
Definition of an unordered map mapping keys to values.
Definition Measurement.h:62
StackHeapVector< ObjectId, 1 > ObjectIds
Definition of a vector holding object ids.
Definition Measurement.h:52
This class implements a smart device reference.
Definition DeviceRef.h:36
Definition of a sample holding one measurement values of a tracker.
Definition devices/Tracker.h:90
ReferenceSystem referenceSystem() const
Returns the reference system of the tracker.
Definition devices/Tracker.h:330
@ TRACKER_GPS
GPS tracker.
Definition devices/Tracker.h:60
Tracker(const std::string &name, const DeviceType type)
Creates a new tracker object.
ReferenceSystem
Definition of different tracking reference system.
Definition devices/Tracker.h:74
static constexpr float minValue()
static constexpr bool isInsideRange(const double lower, const double value, const double upper, const double epsilon=NumericT< double >::eps())
This template class implements a smart object reference which is a specialization of an ObjectRef obj...
Definition SmartObjectRef.h:90
Vector like data structure combining stack and heap memory.
Definition StackHeapVector.h:27
This class implements a timestamp.
Definition Timestamp.h:64
SmartDeviceRef< GPSTracker > GPSTrackerRef
Definition of a smart object reference for a GPS tracker.
Definition GPSTracker.h:32
Namespace of the Devices library.
Definition AccelerationSensor3DOF.h:24
The namespace covering the entire Ocean framework.
Definition Accessor.h:15