Skip to content

Commit

Permalink
fix(robosense): use correct field to check time sync status (#106)
Browse files Browse the repository at this point in the history
* fix(robosense): use correct field to check time sync status

* chore(.cspell.json): add new word for robosense
  • Loading branch information
mebasoglu committed Dec 14, 2023
1 parent 810849e commit 73a1e1b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"Difop",
"gptp",
"Idat",
"Vdat"
"Vdat",
"manc"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 73a1e1b

Please sign in to comment.