Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow sensors to return no angle (or bad angle) #334

Open
runger1101001 opened this issue Nov 5, 2023 · 1 comment
Open

Allow sensors to return no angle (or bad angle) #334

runger1101001 opened this issue Nov 5, 2023 · 1 comment
Assignees
Labels
APIv2.5 Features/Changes for near term API change enhancement New feature or request

Comments

@runger1101001
Copy link
Member

At the moment there is no way for a sensor to fail gracefully. But in the presence of noisy lines it would be useful to check the CRC data returned by many sensors, and return no angle value if it was not received correctly.

A possible solution:

  • sensors can return NaN when they can't receive the angle
  • the sensor base class checks for NaN and doesn't update its internal state in this case

As a bonus, it would be good to track the number of CRC errors so user code can check on the performance of the sensor.

@runger1101001 runger1101001 added enhancement New feature or request APIv2.5 Features/Changes for near term API change labels Nov 5, 2023
@runger1101001 runger1101001 self-assigned this Nov 7, 2023
@runger1101001
Copy link
Member Author

The part with returning no angle is implemented already, for release in 2.3.2. It is not an API changing change.

Instead of NaN, sensors can just return a negative number to have it ignored by the sensor base class. Handling NaN explicitly is not appreciated at all by the compilers...

Leaving ticket open to also implement the error counting part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIv2.5 Features/Changes for near term API change enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant