From cf35230518f1d31274e208882779fc381fc30c7b Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Tue, 4 Apr 2023 01:01:28 -0600 Subject: [PATCH 1/4] Fix unitialized values in NavSatFix and add missing UNKNOWN * Fixes #196 Signed-off-by: Ryan Friedman --- sensor_msgs/msg/NavSatFix.msg | 2 +- sensor_msgs/msg/NavSatStatus.msg | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sensor_msgs/msg/NavSatFix.msg b/sensor_msgs/msg/NavSatFix.msg index 3c4e9770..c38ac1b3 100644 --- a/sensor_msgs/msg/NavSatFix.msg +++ b/sensor_msgs/msg/NavSatFix.msg @@ -42,4 +42,4 @@ uint8 COVARIANCE_TYPE_APPROXIMATED = 1 uint8 COVARIANCE_TYPE_DIAGONAL_KNOWN = 2 uint8 COVARIANCE_TYPE_KNOWN = 3 -uint8 position_covariance_type +uint8 position_covariance_type = COVARIANCE_TYPE_UNKNOWN diff --git a/sensor_msgs/msg/NavSatStatus.msg b/sensor_msgs/msg/NavSatStatus.msg index 7d2edc1b..01829b05 100644 --- a/sensor_msgs/msg/NavSatStatus.msg +++ b/sensor_msgs/msg/NavSatStatus.msg @@ -4,12 +4,13 @@ # type and the last time differential corrections were received. A # fix is valid when status >= STATUS_FIX. +int8 STATUS_UNKNOWN = -2 # status is not yet set int8 STATUS_NO_FIX = -1 # unable to fix position int8 STATUS_FIX = 0 # unaugmented fix int8 STATUS_SBAS_FIX = 1 # with satellite-based augmentation int8 STATUS_GBAS_FIX = 2 # with ground-based augmentation -int8 status +int8 status = STATUS_UNKNOWN # Bits defining which Global Navigation Satellite System signals were # used by the receiver. From e8b50ab480461ec4fb9e92d38dc43eb566fd345f Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Tue, 4 Apr 2023 16:41:15 -0600 Subject: [PATCH 2/4] Fix default initialization instead of constants * Don't over declare ones that are already unknown-initialized Signed-off-by: Ryan Friedman --- sensor_msgs/msg/NavSatFix.msg | 2 +- sensor_msgs/msg/NavSatStatus.msg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sensor_msgs/msg/NavSatFix.msg b/sensor_msgs/msg/NavSatFix.msg index c38ac1b3..3c4e9770 100644 --- a/sensor_msgs/msg/NavSatFix.msg +++ b/sensor_msgs/msg/NavSatFix.msg @@ -42,4 +42,4 @@ uint8 COVARIANCE_TYPE_APPROXIMATED = 1 uint8 COVARIANCE_TYPE_DIAGONAL_KNOWN = 2 uint8 COVARIANCE_TYPE_KNOWN = 3 -uint8 position_covariance_type = COVARIANCE_TYPE_UNKNOWN +uint8 position_covariance_type diff --git a/sensor_msgs/msg/NavSatStatus.msg b/sensor_msgs/msg/NavSatStatus.msg index 01829b05..dc9958a7 100644 --- a/sensor_msgs/msg/NavSatStatus.msg +++ b/sensor_msgs/msg/NavSatStatus.msg @@ -10,7 +10,7 @@ int8 STATUS_FIX = 0 # unaugmented fix int8 STATUS_SBAS_FIX = 1 # with satellite-based augmentation int8 STATUS_GBAS_FIX = 2 # with ground-based augmentation -int8 status = STATUS_UNKNOWN +int8 status -2 # STATUS_UNKNOWN # Bits defining which Global Navigation Satellite System signals were # used by the receiver. From af947458d6a9a75624474c74aa078000dd8557fe Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Tue, 4 Apr 2023 16:45:01 -0600 Subject: [PATCH 3/4] Define SERVICE_UNKNOWN Signed-off-by: Ryan Friedman --- sensor_msgs/msg/NavSatStatus.msg | 1 + 1 file changed, 1 insertion(+) diff --git a/sensor_msgs/msg/NavSatStatus.msg b/sensor_msgs/msg/NavSatStatus.msg index dc9958a7..3e203e70 100644 --- a/sensor_msgs/msg/NavSatStatus.msg +++ b/sensor_msgs/msg/NavSatStatus.msg @@ -15,6 +15,7 @@ int8 status -2 # STATUS_UNKNOWN # Bits defining which Global Navigation Satellite System signals were # used by the receiver. +uint16 SERVICE_UNKNOWN = 0 uint16 SERVICE_GPS = 1 uint16 SERVICE_GLONASS = 2 uint16 SERVICE_COMPASS = 4 # includes BeiDou. From 48b0080fecae9a02133a5e93b237b8b706160cd4 Mon Sep 17 00:00:00 2001 From: Tully Foote Date: Mon, 25 Mar 2024 02:15:49 -0700 Subject: [PATCH 4/4] Update sensor_msgs/msg/NavSatStatus.msg Co-authored-by: Martin Pecka Signed-off-by: Tully Foote --- sensor_msgs/msg/NavSatStatus.msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensor_msgs/msg/NavSatStatus.msg b/sensor_msgs/msg/NavSatStatus.msg index 3e203e70..ae03056d 100644 --- a/sensor_msgs/msg/NavSatStatus.msg +++ b/sensor_msgs/msg/NavSatStatus.msg @@ -15,7 +15,7 @@ int8 status -2 # STATUS_UNKNOWN # Bits defining which Global Navigation Satellite System signals were # used by the receiver. -uint16 SERVICE_UNKNOWN = 0 +uint16 SERVICE_UNKNOWN = 0 # Remember service is a bitfield, so checking (service & SERVICE_UNKNOWN) will not work. Use == instead. uint16 SERVICE_GPS = 1 uint16 SERVICE_GLONASS = 2 uint16 SERVICE_COMPASS = 4 # includes BeiDou.