Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Added logic for handling stale GPS CAN #151

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hhenry01
Copy link
Member

Description

  • Resolves Handle sensors breaking tasks#7
  • Add checks so that if the GPS AIS and GPS CAN data differs, and the GPS CAN data has not changed for 20 minutes, then we consider the GPS CAN data stale and publish GPS AIS latitude and longitude to the GPS CAN latitude longitude ROS topic.
  • Note, we only get latitude and longitude from the GPS AIS so the other fields will still be the stale GPS CAN fields

Verification

  • Not done
  • Need to inject purposefully stale CAN data with good AIS data.

@hhenry01 hhenry01 added the bug Something isn't working label Nov 27, 2022
@hhenry01 hhenry01 self-assigned this Nov 27, 2022
@hhenry01 hhenry01 linked an issue Nov 27, 2022 that may be closed by this pull request
Copy link
Member

@patrick-5546 patrick-5546 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

  • This issue was originally created to ensure that we are always receiving signal from the GPS CAN field. If we don't, the averaging that we do when filtering could break. But this case would never happen right, if GPS CAN stopped working we would just publish the last published data.

Couple questions

  • What happens when AIS data isn't changing as well? We could just be dead in the water with no wind
  • Should we check occassionally to see if GPS CAN is changing? Or should we just discard it for the future?
  • Should we check is CAN GPS is vastly different from AIS?

@hhenry01
Copy link
Member Author

hhenry01 commented Dec 3, 2022

Note

  • This issue was originally created to ensure that we are always receiving signal from the GPS CAN field. If we don't, the averaging that we do when filtering could break. But this case would never happen right, if GPS CAN stopped working we would just publish the last published data.

Couple questions

  • What happens when AIS data isn't changing as well? We could just be dead in the water with no wind
  • Should we check occassionally to see if GPS CAN is changing? Or should we just discard it for the future?
  • Should we check is CAN GPS is vastly different from AIS?
  1. I have a check such that if both the GPS and AIS data is the same, we do not consider it stale.
  2. We do check if the GPS CAN is changing. We consider it no longer stale again if it matches the GPS AIS at some point.
  3. The thing is, before this commit I'm trying to merge, the GPS AIS rostopic was just receiving GPS CAN data. I did not notice this before. Needs testing :/

@patrick-5546
Copy link
Member

We consider it no longer stale again if it matches the GPS AIS at some point.

I see in the code that for it to match the latlon has to be the same to at least 4 decimal points. How many decimal points to be get from the GPS's again?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Handle sensors breaking
2 participants