From 73a1e1b9daacab4dc16774f63420e0e9be630bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Emin=20BA=C5=9EO=C4=9ELU?= Date: Thu, 14 Dec 2023 18:16:44 +0300 Subject: [PATCH] fix(robosense): use correct field to check time sync status (#106) * fix(robosense): use correct field to check time sync status * chore(.cspell.json): add new word for robosense --- .cspell.json | 3 ++- .../nebula_decoders_robosense/decoders/bpearl_v3.hpp | 12 +++++------- .../nebula_decoders_robosense/decoders/bpearl_v4.hpp | 12 +++++------- .../nebula_decoders_robosense/decoders/helios.hpp | 12 +++++------- 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.cspell.json b/.cspell.json index e2b0768d9..3574bbfd3 100644 --- a/.cspell.json +++ b/.cspell.json @@ -38,6 +38,7 @@ "Difop", "gptp", "Idat", - "Vdat" + "Vdat", + "manc" ] } diff --git a/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/bpearl_v3.hpp b/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/bpearl_v3.hpp index a54c52bd6..92e58e304 100644 --- a/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/bpearl_v3.hpp +++ b/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/bpearl_v3.hpp @@ -269,14 +269,12 @@ class BpearlV3 : public RobosenseSensor< bool getSyncStatus(const robosense_packet::bpearl_v3::InfoPacket & info_packet) { - switch (info_packet.time_sync_mode.value()) { - case SYNC_MODE_GPS_FLAG: - return true; - case SYNC_MODE_E2E_FLAG: - return true; - case SYNC_MODE_P2P_FLAG: + switch (info_packet.sync_status.value()) { + case SYNC_STATUS_INVALID_FLAG: + return false; + case SYNC_STATUS_GPS_SUCCESS_FLAG: return true; - case SYNC_MODE_GPTP_FLAG: + case SYNC_STATUS_PTP_SUCCESS_FLAG: return true; default: return false; diff --git a/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/bpearl_v4.hpp b/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/bpearl_v4.hpp index 80b0c35ec..681ad2ba2 100644 --- a/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/bpearl_v4.hpp +++ b/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/bpearl_v4.hpp @@ -241,14 +241,12 @@ class BpearlV4 : public RobosenseSensor< bool getSyncStatus(const robosense_packet::bpearl_v4::InfoPacket & info_packet) { - switch (info_packet.time_sync_mode.value()) { - case SYNC_MODE_GPS_FLAG: - return true; - case SYNC_MODE_E2E_FLAG: - return true; - case SYNC_MODE_P2P_FLAG: + switch (info_packet.time_sync_state.value()) { + case SYNC_STATUS_INVALID_FLAG: + return false; + case SYNC_STATUS_GPS_SUCCESS_FLAG: return true; - case SYNC_MODE_GPTP_FLAG: + case SYNC_STATUS_PTP_SUCCESS_FLAG: return true; default: return false; diff --git a/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/helios.hpp b/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/helios.hpp index 8ade0f893..0780e3c24 100644 --- a/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/helios.hpp +++ b/nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/helios.hpp @@ -280,14 +280,12 @@ class Helios bool getSyncStatus(const robosense_packet::helios::InfoPacket & info_packet) { - switch (info_packet.time_sync_mode.value()) { - case SYNC_MODE_GPS_FLAG: - return true; - case SYNC_MODE_E2E_FLAG: - return true; - case SYNC_MODE_P2P_FLAG: + switch (info_packet.sync_status.value()) { + case SYNC_STATUS_INVALID_FLAG: + return false; + case SYNC_STATUS_GPS_SUCCESS_FLAG: return true; - case SYNC_MODE_GPTP_FLAG: + case SYNC_STATUS_PTP_SUCCESS_FLAG: return true; default: return false;