| Ocean
    | 
This class is the base class for all gps tracker objects. More...
#include <GPSTracker.h>
| Data Structures | |
| class | GPSTrackerSample | 
| Definition of a sample holding GPS measurements.  More... | |
| class | Location | 
| This class implements a container for a GPS location.  More... | |
| Public Types | |
| typedef std::vector< Location > | Locations | 
| Definition of a vector holding GPS data values. | |
| typedef SmartObjectRef< GPSTrackerSample, Sample > | GPSTrackerSampleRef | 
| Definition of a smart object reference for GPS tracker samples. | |
|  Public Types inherited from Ocean::Devices::Tracker | |
| enum | TrackerType : uint32_t { TRACKER_INVALID = MINOR_INVALID , TRACKER_ORIENTATION_3DOF = (1u << 0u) , TRACKER_POSITION_3DOF = (1u << 1u) , TRACKER_6DOF = TRACKER_ORIENTATION_3DOF | TRACKER_POSITION_3DOF , SCENE_TRACKER_6DOF = (1u << 2u) | TRACKER_6DOF , TRACKER_GPS = (1u << 3u) , TRACKER_MAGNETIC = (1u << 4u) , TRACKER_VISUAL = (1u << 5u) , TRACKER_OBJECT = (1u << 6u) } | 
| Definition of different minor device types.  More... | |
| enum | ReferenceSystem { RS_OBJECT_IN_DEVICE , RS_DEVICE_IN_OBJECT } | 
| Definition of different tracking reference system.  More... | |
| typedef float | Frequency | 
| Definition of a tracker frequency in Hz. | |
| typedef SmartObjectRef< TrackerSample, Sample > | TrackerSampleRef | 
| Definition of a smart object reference for tracker samples. | |
| typedef Callback< void, const Tracker *, const bool, const ObjectIdSet &, const Timestamp & > | TrackerObjectCallback | 
| Definition of a callback function to subscribe for lost and found tracker events. | |
|  Public Types inherited from Ocean::Devices::Measurement | |
| enum | InterpolationStrategy { IS_INVALID , IS_TIMESTAMP_NEAREST , IS_TIMESTAMP_INTERPOLATE } | 
| Definition of individual interpolation strategies for samples.  More... | |
| using | ObjectId = unsigned int | 
| Definition of an object id. | |
| using | ObjectIds = std::vector< ObjectId > | 
| Definition of a vector holding object ids. | |
| using | ObjectIdSet = std::unordered_set< ObjectId > | 
| Definition of an unordered set holding object ids. | |
| using | Metadata = std::unordered_map< std::string, Value > | 
| Definition of an unordered map mapping keys to values. | |
| using | SampleRef = ObjectRef< Sample > | 
| Definition of an object reference for samples. | |
| using | SampleCallback = Callback< void, const Measurement *, const SampleRef & > | 
| Definition of a callback function to subscribe for new measurement sample events. | |
|  Public Types inherited from Ocean::Devices::Device | |
| enum | MajorType : uint32_t { DEVICE_INVALID = 0u , DEVICE_MEASUREMENT = (1u << 0u) , DEVICE_SENSOR = (1u << 1u) | DEVICE_MEASUREMENT , DEVICE_TRACKER = (1u << 2u) | DEVICE_MEASUREMENT } | 
| Definition of all major device types.  More... | |
| enum | MinorType : uint32_t { MINOR_INVALID = 0u } | 
| Base definition of a minor type.  More... | |
| Static Public Member Functions | |
| static DeviceType | deviceTypeGPSTracker () | 
| Returns the device type of this tracker. | |
| static bool | parseGPSLocation (const std::string &gpsString, double &latitude, double &longitude, double *altitude=nullptr) | 
| Parses a string with a GPS location. | |
| static bool | decodePolyline (const std::string &polyline, const unsigned int precision, Locations &locations, const bool unescapeBackslash=false) | 
| Decodes all GPS locations from a polyline. | |
| 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 considered. | |
|  Static Public Member Functions inherited from Ocean::Devices::Tracker | |
| static std::string | translateTrackerType (const TrackerType trackerType) | 
| Translates the tracker type to a readable string. | |
| static TrackerType | translateTrackerType (const std::string &trackerType) | 
| Translates the tracker type from a readable string to a value. | |
| static constexpr Frequency | unknownFrequency () | 
| Definition of a constant as unknown frequency. | |
|  Static Public Member Functions inherited from Ocean::Devices::Measurement | |
| static constexpr ObjectId | invalidObjectId () | 
| Returns an invalid object id. | |
|  Static Public Member Functions inherited from Ocean::Devices::Device | |
| static std::string | translateMajorType (const MajorType majorType) | 
| Translates the major devices type to a readable string. | |
| static MajorType | translateMajorType (const std::string &majorType) | 
| Translates the major devices type from a readable string to a value. | |
| Protected Member Functions | |
| GPSTracker (const std::string &name) | |
| Creates a new GPS tracker object. | |
| ~GPSTracker () override | |
| Destructs a GPS tracker object. | |
|  Protected Member Functions inherited from Ocean::Devices::Tracker | |
| Tracker (const std::string &name, const DeviceType type) | |
| Creates a new tracker object. | |
| ~Tracker () override | |
| Destructs a tracker object. | |
| void | postFoundTrackerObjects (const ObjectIdSet &objectIds, const Timestamp ×tamp) | 
| Posts a new found tracker objects event. | |
| void | postLostTrackerObjects (const ObjectIdSet &objectIds, const Timestamp ×tamp) | 
| Posts a new lost tracker objects event. | |
| void | unsubscribeTrackerObjectEvent (const SubscriptionId subscriptionId) | 
| Unsubscribes a tracker object event callback function. | |
|  Protected Member Functions inherited from Ocean::Devices::Measurement | |
| Measurement (const std::string &name, const DeviceType type) | |
| Creates a new measurement object. | |
| ~Measurement () override | |
| Destructs a measurement object. | |
| void | postNewSample (const SampleRef &newSample) | 
| Posts a new measurement sample. | |
| ObjectId | addUniqueObjectId (const std::string &description) | 
| Creates a unique object id for a new object (e.g., a tracking object like an image, a marker, or a location). | |
| void | unsubscribeSampleEvent (const SubscriptionId subscriptionId) | 
| Unsubscribes a sample event callback function. | |
|  Protected Member Functions inherited from Ocean::Devices::Device | |
| Device (const Device &device)=delete | |
| Disabled copy constructor. | |
| Device (const std::string &name, const DeviceType type) | |
| Creates a new device by is name. | |
| virtual | ~Device () | 
| Destructs a device. | |
| Device & | operator= (const Device &device)=delete | 
| Disabled copy operator. | |
| Static Protected Member Functions | |
| static bool | decodePolylineValue (const std::string &polyline, size_t &position, int32_t &integerValue, const bool unescapeBackslash) | 
| Decodes one value from a polyline. | |
|  Static Protected Member Functions inherited from Ocean::Devices::Tracker | |
| static ObjectIdSet | determineFoundObjects (const ObjectIdSet &previousObjects, const ObjectIdSet ¤tObjects) | 
| Determines the ids which were not tracked in the previous iteration but tracked in the current iteration. | |
| static ObjectIdSet | determineLostObjects (const ObjectIdSet &previousObjects, const ObjectIdSet ¤tObjects) | 
| Determines the ids which were tracked in the previous iteration but not tracked in the current iteration. | |
|  Static Protected Member Functions inherited from Ocean::Devices::Device | |
| static constexpr SubscriptionId | invalidSubscriptionId () | 
| Returns an invalid subscription id. | |
| Additional Inherited Members | |
|  Public Member Functions inherited from Ocean::Devices::Tracker | |
| virtual Frequency | frequency () const | 
| Returns the frequency of this tracker. | |
| virtual bool | isObjectTracked (const ObjectId &objectId) const | 
| Returns whether a specific object is currently actively tracked by this tracker. | |
| TrackerObjectEventSubscription | subscribeTrackerObjectEvent (TrackerObjectCallback &&callback) | 
| Subscribes a callback event function for tracker object (found or lost) events. | |
| virtual HomogenousMatrixD4 | reference () const | 
| Returns the reference coordinate system of this tracker. | |
|  Public Member Functions inherited from Ocean::Devices::Measurement | |
| size_t | sampleCapacity () const | 
| Returns the capacity of the internal sample container. | |
| bool | setSampleCapacity (const size_t capacity) | 
| Sets the capacity of the internal sample container. | |
| virtual SampleRef | sample () const | 
| Returns the most recent sample. | |
| virtual SampleRef | sample (const Timestamp timestamp) const | 
| Returns the sample with a specific timestamp. | |
| virtual SampleRef | sample (const Timestamp ×tamp, const InterpolationStrategy interpolationStrategy) const | 
| Returns the sample best matching with a specified timestamp. | |
| SampleEventSubscription | subscribeSampleEvent (SampleCallback &&callback) | 
| Subscribes a callback event function for new measurement sample events. | |
| ObjectId | objectId (const std::string &description) const | 
| Returns the object id for an object description. | |
| Strings | objectDescriptions () const | 
| Returns descriptions of all objects currently available. | |
| std::string | objectDescription (const ObjectId objectId) const | 
| Returns the description of one object of this measurement. | |
|  Public Member Functions inherited from Ocean::Devices::Device | |
| const std::string & | name () const | 
| Returns the name of this device. | |
| virtual const std::string & | library () const =0 | 
| Returns the name of the owner library. | |
| virtual bool | isStarted () const | 
| Returns whether this device is active. | |
| bool | isValid () const | 
| Returns whether this device is valid. | |
| bool | isExclusive () const | 
| Returns whether this device can be use exclusively. | |
| virtual bool | start () | 
| Starts the device. | |
| virtual bool | pause () | 
| Pauses the device. | |
| virtual bool | stop () | 
| Stops the device. | |
| virtual bool | setParameter (const std::string ¶meter, const Value &value) | 
| Sets an abstract parameter of this device. | |
| virtual bool | parameter (const std::string ¶meter, Value &value) | 
| Returns an abstract parameter of this device. | |
| DeviceType | type () const | 
| Returns the major and minor type of this device. | |
|  Protected Types inherited from Ocean::Devices::Tracker | |
| typedef std::unordered_map< SubscriptionId, TrackerObjectCallback > | TrackerObjectSubscriptionMap | 
| Definition of a map mapping subscription ids to tracker object event callback functions. | |
|  Protected Types inherited from Ocean::Devices::Measurement | |
| using | SampleMap = std::map< Timestamp, SampleRef > | 
| Definition of a map holding the most recent samples. | |
| using | ObjectDescriptionToIdMap = std::unordered_map< std::string, ObjectId > | 
| Definition of an unordered map mapping descriptions to unique object ids. | |
| using | ObjectIdToDescriptionMap = std::unordered_map< ObjectId, std::string > | 
| Definition of an unordered map mapping unique object ids to descriptions. | |
| using | SampleSubscriptionMap = std::unordered_map< SubscriptionId, SampleCallback > | 
| Definition of a map mapping subscription ids to event sample callback functions. | |
|  Protected Types inherited from Ocean::Devices::Device | |
| typedef unsigned int | SubscriptionId | 
| Definition of a subscription id for event callbacks. | |
|  Protected Attributes inherited from Ocean::Devices::Tracker | |
| TrackerObjectSubscriptionMap | trackerObjectSubscriptionMap_ | 
| Map holding all tracker object event subscriptions. | |
| SubscriptionId | nextTrackerObjectSubscriptionId_ = SubscriptionId(invalidSubscriptionId() + 1u) | 
| The subscription id of the next event subscription. | |
|  Protected Attributes inherited from Ocean::Devices::Measurement | |
| Lock | samplesLock_ | 
| Sample lock. | |
| Lock | subscriptionLock_ | 
| Subscription lock. | |
|  Protected Attributes inherited from Ocean::Devices::Device | |
| std::string | deviceName | 
| Name of this device. | |
| DeviceType | deviceType | 
| Major and minor type of this device. | |
| bool | deviceIsValid | 
| Flag determining whether this device is valid. | |
| Lock | deviceLock | 
| Device lock. | |
This class is the base class for all gps tracker objects.
Definition of a smart object reference for GPS tracker samples.
| typedef std::vector<Location> Ocean::Devices::GPSTracker::Locations | 
Definition of a vector holding GPS data values.
| 
 | explicitprotected | 
Creates a new GPS tracker object.
| name | The name of the gps tracker | 
| 
 | overrideprotected | 
Destructs a GPS tracker object.
| 
 | static | 
Calculates the distance between two GPS locations in meters, the location's latitude is not considered.
The resulting distance is an approximation based on a perfect sphere.
| locationA | The first GPS location, must be valid | 
| locationB | The second GPS location, must be valid | 
| earthRadius | The radius of the earth in meter, with range (0, infinity) | 
| 
 | static | 
Decodes all GPS locations from a polyline.
Polyline encoding is a lossy compression algorithm that allows you to store a series of coordinates as a single string.
 More details: https://developers.google.com/maps/documentation/utilities/polylinealgorithm 
| polyline | The polyline to decode, must be valid | 
| precision | The precision of decimal places the given polyline has, with range [1, 8] | 
| locations | The resulting individual locations | 
| unescapeBackslash | True, to unescape two consecutive backslash in the polyline to one backslash; False, to use the polyline as it is | 
| 
 | staticprotected | 
Decodes one value from a polyline.
| polyline | The polyline from which the value will be decoded, must be valid | 
| position | The current position within the polyline, will be moved to the next value position, with range [0, polyline.length() - 1] | 
| integerValue | The resulting value with integer precision (not yet normalized) | 
| unescapeBackslash | True, to unescape two consecutive backslash in the polyline to one backslash; False, to use the polyline as it is | 
| 
 | inlinestatic | 
Returns the device type of this tracker.
| 
 | static | 
Parses a string with a GPS location.
The given string must have one of the following patterns:
GPS Location {latitude}, {longitude} GPS Location {latitude}, {longitude}, {altitude} e.g., GPS Location 37.48507, -122.14829 GPS Location 37.48507, -122.14829, 10.0
| gpsString | The string to be parsed | 
| latitude | The resulting latitude value | 
| longitude | The resulting longitude value | 
| altitude | Optional resulting altitude; nullptr to not allow an altitude value in a valid input string |