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

SF45 fixes to restart the state machine if sensor does not init correctly #23565

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dirksavage88
Copy link
Contributor

Fixes #23308 when the SF45 is on specific UARTS, the sensor never reports distance data due to being stuck in init.

Also populates comms_errs if there are issues reading/writing data.

The serial uart data being read reports the start of packet invalid, payload length invalid, and CRC mismatch in the early sensor init state, so the SF_STREAM command never gets sent out. This PR restarts the state machine if there are too many consecutive errors in the beginning that are the result of UART data mismatch on what the driver expects and what the sensor sends. For unknown reasons the sensor seems to work much better on TELEM1 and TELEM2

Tested on holybro 6x where TELEM 1 and TELEM2 worked fine with the original driver, but TELEM3 did not and the start of packet invalids caused the sensor to never stream distance data. With this fix the driver actually reports distance data on telem 3.

errors
sf45

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-sync-q-a-sep-11-2024/40625/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Distance sensor LIDAR Lightware SF45 Serial not working on fmu-v6x
2 participants