From fdabf69280577fa5000ac4a0bcf09581a163a327 Mon Sep 17 00:00:00 2001 From: Helmut Schmidt Date: Wed, 15 Oct 2014 17:12:23 +0200 Subject: GT-3032, step 2: as proposed by Marco Residori: Rename GetData() into GetPositionInfo() and delete, GetPosition(), GetGNSSAccuracy(), GetRotationRate(), GetStatus() --- .../api/genivi-positioning-enhancedposition.xml | 103 +++------------------ .../src/enhanced-position.cpp | 91 ++---------------- enhanced-position-service/src/enhanced-position.h | 10 +- .../test/enhanced-position-client.cpp | 2 +- 4 files changed, 20 insertions(+), 186 deletions(-) diff --git a/enhanced-position-service/api/genivi-positioning-enhancedposition.xml b/enhanced-position-service/api/genivi-positioning-enhancedposition.xml index 853cb11..1e99d5e 100644 --- a/enhanced-position-service/api/genivi-positioning-enhancedposition.xml +++ b/enhanced-position-service/api/genivi-positioning-enhancedposition.xml @@ -35,9 +35,9 @@ - + - GetData = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... ) + GetPositionInfo = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... ) @@ -74,29 +74,7 @@ key = SIGMA_ALTITUDE, value = value of type 'd', that represents the standard error estimate of the altitude in m key = SIGMA_HEADING, value = value of type 'd', that represents the standard error estimate of the heading in degrees key = GNSS_FIX_STATUS, value = value of type 'q', that represents an enum(NO_FIX(0x01),TIME_FIX(0x01),2D_FIX(0x02),3D_FIX(0x03), ... ) - key = DR_STATUS, value = value of type 'b', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position - - - - - - - GetPosition = This method returns the current position - - - - - position = dictionary[key,value] - dictionary = array of tuples (key,value) - Invalid data is not be returned to the client application - key = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,...) - key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms - key = LATITUDE, value = value of type 'd', that expresses the WGS84 latitude of the current position in degrees. Range [-90:+90]. Example: 48.053250 - key = LONGITUDE, value = value of type 'd', that expresses the WGS84 longitude of the current position in degrees. Range [-180:+180]. Example: 8.324500 - key = ALTITUDE, value = value of type 'd', that expresses the altitude above the sea level of the current position in meters - key = HEADING, value = value of type 'd', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west - key = SPEED, value = value of type 'd', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards - key = CLIMB, value = value of type 'd', that expresses the road gradient in degrees. Range [-180:+180]. A positive value means upwards. + key = DR_STATUS, value = value of type 'b', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position @@ -113,25 +91,6 @@ - - - GetRotationRate = This method returns the rotation rate - - - - rotationRate = dictionary[key,value] - dictionary = array of tuples (key,value) - If you request for a specific value which is invalid, it's not returned in the dictionary. - The vehicle axis system is defined by ISO 8855: In short, the X-axis pointing is forwards, the Y-axis is pointing left, the Z-axis is pointing upwards - key = enum(INVALID,TIMESTAMP,ROLL_RATE,PITCH_RATE,YAW_RATE, ... ) - key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms - key = ROLL_RATE, value = value of type 'd', rotation rate around the X-axis in degrees/s. Range [-100:+100] - key = PITCH_RATE, value = value of type 'd', rotation rate around the Y-axis in degrees/s. Range [-100:+100] - key = YAW_RATE, value = value of type 'd', rotation rate around the Z-axis in degrees/s. Range [-100:+100] - - - - RotationRateUpdated = This signal is emitted when the rotation rate changes @@ -144,35 +103,26 @@ - + - GetAccuracy = This method returns GNSS accuracy indicators + GNSSAccuracyUpdate = This signal is emitted when the GNSS accuracy changes - + - accuracy = dictionary[key,value] - dictionary = array of tuples (key,value) - If you request for a specific value which is invalid, it's not returned in the dictionary. - key = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,USED_SATELLITES,SIGMA_LONGITUDE,TRACKED_SATELLITES,VISIBLE_SATELLITES,... ) - key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms - key = PDOP, value = value of type 'd', that represents the positional (3D) dilution of precision - key = HDOP, value = value of type 'd', that represents the horizontal (2D) dilution of precision - key = VDOP, value = value of type 'd', that represents vertical (altitude) dilution of precision - key = USED_SATELLITES, value = value of type 'y', that represents the number of used satellites - key = TRACKED_SATELLITES, value = value of type 'y', that represents the number of tracked satellites - key = VISIBLE_SATELLITES, value = value of type 'y', that represents the number of visible satellites + changedValues = array[value] + value = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES, ... ) - + - + - GNSSAccuracyUpdate = This signal is emitted when the GNSS accuracy changes + StatusUpdate = This signal is emitted when the status of this service changes changedValues = array[value] - value = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES, ... ) + key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... ) @@ -196,35 +146,6 @@ - - - GetStatus = This method returns the status of this service - - - - status = dictionary[key,value] - dictionary = array of tuples (key,value) - If you request for a specific value which is invalid, it's not returned in the dictionary. - key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... ) - key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms - key = GNSS_FIX_STATUS, value = value of type 'q', that represents an enum(NO_FIX(0x01),TIME_FIX(0x01),2D_FIX(0x02),3D_FIX(0x03), ... ) - key = DR_STATUS, value = value of type 'b', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position - - - - - - - StatusUpdate = This signal is emitted when the status of this service changes - - - - changedValues = array[value] - key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... ) - - - - GetTime = This method returns UTC time and date diff --git a/enhanced-position-service/src/enhanced-position.cpp b/enhanced-position-service/src/enhanced-position.cpp index 03c1585..9043ec7 100644 --- a/enhanced-position-service/src/enhanced-position.cpp +++ b/enhanced-position-service/src/enhanced-position.cpp @@ -81,7 +81,7 @@ EnhancedPosition::~EnhancedPosition() return Version; } -std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetData(const std::vector< uint16_t >& valuesToReturn) +std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetPositionInfo(const std::vector< uint16_t >& valuesToReturn) { std::map< uint16_t, ::DBus::Variant > Data; @@ -152,65 +152,6 @@ std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetData(const std::vecto return Data; } -std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetPosition() -{ - std::map< uint16_t, ::DBus::Variant > Position; - TGNSSPosition position; - - if(gnssGetPosition(&position)) - { - if (position.validityBits & GNSS_POSITION_LATITUDE_VALID) - { - Position[POS_LATITUDE] = variant_double(position.latitude); - } - - if (position.validityBits & GNSS_POSITION_LONGITUDE_VALID) - { - Position[POS_LONGITUDE] = variant_double(position.longitude); - } - - if (position.validityBits & GNSS_POSITION_ALTITUDEMSL_VALID) - { - Position[POS_ALTITUDE] = variant_double(position.altitudeMSL); - } - - if (position.validityBits & GNSS_POSITION_HEADING_VALID) - { - Position[POS_HEADING] = variant_double(position.heading); - } - - if (position.validityBits & GNSS_POSITION_HSPEED_VALID) - { - Position[POS_SPEED] = variant_double(position.hSpeed); - } - - if (position.validityBits & GNSS_POSITION_VSPEED_VALID) - { - Position[POS_CLIMB] = variant_double(position.vSpeed); - } - } - - return Position; -} - -std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetRotationRate() -{ - std::map< uint16_t, ::DBus::Variant > RotationRate; - - throw DBus::ErrorNotSupported("Method not supported yet"); - - return RotationRate; -} - -std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetGNSSAccuracy() -{ - std::map< uint16_t, ::DBus::Variant > GNSSAccuracy; - - throw DBus::ErrorNotSupported("Method not supported yet"); - - return GNSSAccuracy; -} - std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetSatelliteInfo() { std::map< uint16_t, ::DBus::Variant > SatelliteInfo; @@ -220,15 +161,6 @@ std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetSatelliteInfo() return SatelliteInfo; } -std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetStatus() -{ - std::map< uint16_t, ::DBus::Variant > Status; - - throw DBus::ErrorNotSupported("Method not supported yet"); - - return Status; -} - std::map< uint16_t, ::DBus::Variant > EnhancedPosition::GetTime() { std::map< uint16_t, ::DBus::Variant > Time; @@ -349,8 +281,7 @@ void EnhancedPosition::sigGNSSAccuracyUpdate(const TGNSSPosition position[], uin bool pdopChanged = false; bool hdopChanged = false; bool vdopChanged = false; - bool sigmaHPosChanged = false; - bool sigmaAltitudeChanged = false; + bool usatChanged = false; //used satellites if (position == NULL || numElements < 1) { @@ -385,14 +316,9 @@ void EnhancedPosition::sigGNSSAccuracyUpdate(const TGNSSPosition position[], uin vdopChanged = (position[i].validityBits & GNSS_POSITION_VDOP_VALID); } - if (sigmaHPosChanged == false) + if (usatChanged == false) { - sigmaHPosChanged = (position[i].validityBits & GNSS_POSITION_SHPOS_VALID); - } - - if (sigmaAltitudeChanged == false) - { - sigmaAltitudeChanged = (position[i].validityBits & GNSS_POSITION_SALT_VALID); + usatChanged = (position[i].validityBits & GNSS_POSITION_USAT_VALID); } } @@ -419,14 +345,9 @@ void EnhancedPosition::sigGNSSAccuracyUpdate(const TGNSSPosition position[], uin it = changedAccuracyValues.insert(it,POS_VDOP); } - if (sigmaHPosChanged) - { - it = changedAccuracyValues.insert(it,POS_SIGMA_HPOSITION); - } - - if (sigmaAltitudeChanged) + if (usatChanged) { - it = changedAccuracyValues.insert(it,POS_VISIBLE_SATELLITES); + it = changedAccuracyValues.insert(it,POS_USED_SATELLITES); } //todo: handle other field-changes here (accuracy and status) diff --git a/enhanced-position-service/src/enhanced-position.h b/enhanced-position-service/src/enhanced-position.h index a056e11..3558c64 100644 --- a/enhanced-position-service/src/enhanced-position.h +++ b/enhanced-position-service/src/enhanced-position.h @@ -37,18 +37,10 @@ public: ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > GetVersion(); - std::map< uint16_t, ::DBus::Variant > GetData(const std::vector< uint16_t >& valuesToReturn); - - std::map< uint16_t, ::DBus::Variant > GetPosition(); - - std::map< uint16_t, ::DBus::Variant > GetRotationRate(); - - std::map< uint16_t, ::DBus::Variant > GetGNSSAccuracy(); + std::map< uint16_t, ::DBus::Variant > GetPositionInfo(const std::vector< uint16_t >& valuesToReturn); std::map< uint16_t, ::DBus::Variant > GetSatelliteInfo(); - std::map< uint16_t, ::DBus::Variant > GetStatus(); - std::map< uint16_t, ::DBus::Variant > GetTime(); void run(); diff --git a/enhanced-position-service/test/enhanced-position-client.cpp b/enhanced-position-service/test/enhanced-position-client.cpp index 5a93e2c..cb6cdff 100644 --- a/enhanced-position-service/test/enhanced-position-client.cpp +++ b/enhanced-position-service/test/enhanced-position-client.cpp @@ -39,7 +39,7 @@ void EnhancedPositionClient::PositionUpdate(const std::vector< uint16_t >& chang LOG_INFO_MSG(gCtx,"Position Update"); // retrieve the data - std::map< uint16_t, ::DBus::Variant > posData = GetData(changedValues); + std::map< uint16_t, ::DBus::Variant > posData = GetPositionInfo(changedValues); for (int i = 0; i < changedValues.size(); i++) { -- cgit v1.2.1