diff options
author | Helmut Schmidt <Helmut.3.Schmidt@continental-corporation.com> | 2014-10-15 17:12:23 +0200 |
---|---|---|
committer | Helmut Schmidt <Helmut.3.Schmidt@continental-corporation.com> | 2014-10-15 17:12:23 +0200 |
commit | fdabf69280577fa5000ac4a0bcf09581a163a327 (patch) | |
tree | 1a36257472d19e0963ca786c652b1021bf1da4b8 | |
parent | c301ac11e7472063de2d54d78fa2b2b33057fd8d (diff) | |
download | positioning-fdabf69280577fa5000ac4a0bcf09581a163a327.tar.gz |
GT-3032, step 2: as proposed by Marco Residori: Rename GetData() into GetPositionInfo() and delete, GetPosition(), GetGNSSAccuracy(), GetRotationRate(), GetStatus()
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 @@ </arg> </method> - <method name="GetData"> + <method name="GetPositionInfo"> <doc> - <line>GetData = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... )</line> + <line>GetPositionInfo = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... )</line> </doc> <arg name="valuesToReturn" type="aq" direction="in"> @@ -74,29 +74,7 @@ <line>key = SIGMA_ALTITUDE, value = value of type 'd', that represents the standard error estimate of the altitude in m</line> <line>key = SIGMA_HEADING, value = value of type 'd', that represents the standard error estimate of the heading in degrees</line> <line>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), ... )</line> - <line>key = DR_STATUS, value = value of type 'b', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position</line> - </doc> - </arg> - </method> - - <method name="GetPosition"> - <doc> - <line>GetPosition = This method returns the current position</line> - </doc> - - <arg name="position" type="a{qv}" direction="out"> - <doc> - <line>position = dictionary[key,value]</line> - <line>dictionary = array of tuples (key,value)</line> - <line>Invalid data is not be returned to the client application</line> - <line>key = enum(INVALID,TIMESTAMP,LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,...)</line> - <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line> - <line>key = LATITUDE, value = value of type 'd', that expresses the WGS84 latitude of the current position in degrees. Range [-90:+90]. Example: 48.053250</line> - <line>key = LONGITUDE, value = value of type 'd', that expresses the WGS84 longitude of the current position in degrees. Range [-180:+180]. Example: 8.324500</line> - <line>key = ALTITUDE, value = value of type 'd', that expresses the altitude above the sea level of the current position in meters</line> - <line>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</line> - <line>key = SPEED, value = value of type 'd', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards</line> - <line>key = CLIMB, value = value of type 'd', that expresses the road gradient in degrees. Range [-180:+180]. A positive value means upwards. </line> + <line>key = DR_STATUS, value = value of type 'b', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position</line> </doc> </arg> </method> @@ -113,25 +91,6 @@ </arg> </signal> - <method name="GetRotationRate"> - <doc> - <line>GetRotationRate = This method returns the rotation rate</line> - </doc> - <arg name="rotationRate" type="a{qv}" direction="out"> - <doc> - <line>rotationRate = dictionary[key,value]</line> - <line>dictionary = array of tuples (key,value)</line> - <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line> - <line>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</line> - <line>key = enum(INVALID,TIMESTAMP,ROLL_RATE,PITCH_RATE,YAW_RATE, ... )</line> - <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line> - <line>key = ROLL_RATE, value = value of type 'd', rotation rate around the X-axis in degrees/s. Range [-100:+100]</line> - <line>key = PITCH_RATE, value = value of type 'd', rotation rate around the Y-axis in degrees/s. Range [-100:+100]</line> - <line>key = YAW_RATE, value = value of type 'd', rotation rate around the Z-axis in degrees/s. Range [-100:+100]</line> - </doc> - </arg> - </method> - <signal name="RotationRateUpdate"> <doc> <line>RotationRateUpdated = This signal is emitted when the rotation rate changes</line> @@ -144,35 +103,26 @@ </arg> </signal> - <method name="GetGNSSAccuracy"> + <signal name="GNSSAccuracyUpdate"> <doc> - <line>GetAccuracy = This method returns GNSS accuracy indicators</line> + <line>GNSSAccuracyUpdate = This signal is emitted when the GNSS accuracy changes</line> </doc> - <arg name="accuracy" type="a{qv}" direction="out"> + <arg name="changedValues" type="aq"> <doc> - <line>accuracy = dictionary[key,value]</line> - <line>dictionary = array of tuples (key,value)</line> - <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line> - <line>key = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,USED_SATELLITES,SIGMA_LONGITUDE,TRACKED_SATELLITES,VISIBLE_SATELLITES,... )</line> - <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line> - <line>key = PDOP, value = value of type 'd', that represents the positional (3D) dilution of precision</line> - <line>key = HDOP, value = value of type 'd', that represents the horizontal (2D) dilution of precision</line> - <line>key = VDOP, value = value of type 'd', that represents vertical (altitude) dilution of precision</line> - <line>key = USED_SATELLITES, value = value of type 'y', that represents the number of used satellites</line> - <line>key = TRACKED_SATELLITES, value = value of type 'y', that represents the number of tracked satellites</line> - <line>key = VISIBLE_SATELLITES, value = value of type 'y', that represents the number of visible satellites</line> + <line>changedValues = array[value]</line> + <line>value = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES, ... )</line> </doc> </arg> - </method> + </signal> - <signal name="GNSSAccuracyUpdate"> + <signal name="StatusUpdate"> <doc> - <line>GNSSAccuracyUpdate = This signal is emitted when the GNSS accuracy changes</line> + <line>StatusUpdate = This signal is emitted when the status of this service changes</line> </doc> <arg name="changedValues" type="aq"> <doc> <line>changedValues = array[value]</line> - <line>value = enum(INVALID,TIMESTAMP,PDOP,HDOP,VDOP,USED_SATELLITES,TRACKED_SATELLITES,VISIBLE_SATELLITES, ... )</line> + <line>key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... )</line> </doc> </arg> </signal> @@ -196,35 +146,6 @@ </arg> </method> - <method name="GetStatus"> - <doc> - <line>GetStatus = This method returns the status of this service</line> - </doc> - <arg name="status" type="a{qv}" direction="out"> - <doc> - <line>status = dictionary[key,value]</line> - <line>dictionary = array of tuples (key,value)</line> - <line>If you request for a specific value which is invalid, it's not returned in the dictionary.</line> - <line>key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... )</line> - <line>key = TIMESTAMP, value = value of type 't', that represents a timestamp in ms</line> - <line>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), ... )</line> - <line>key = DR_STATUS, value = value of type 'b', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position</line> - </doc> - </arg> - </method> - - <signal name="StatusUpdate"> - <doc> - <line>StatusUpdate = This signal is emitted when the status of this service changes</line> - </doc> - <arg name="changedValues" type="aq"> - <doc> - <line>changedValues = array[value]</line> - <line>key = enum(INVALID,TIMESTAMP,GNSS_FIX_STATUS,DR_STATUS, ... )</line> - </doc> - </arg> - </signal> - <method name="GetTime"> <doc> <line>GetTime = This method returns UTC time and date</line> 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++) { |