PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

sf0x doesnt work anymore in master for LightWare SF02/F Laser Rangefinder

Open severinleuenberger opened this issue 11 years ago • 2 comments

As widely discussed here https://groups.google.com/forum/?hl=de#!topic/px4users/ZQ4d6HCDLSs the actual sf0x driver for the SF02/F Laser Rangerfinder doesnt work anymore in the actual master. Could you please look at this? Best wishes, Severin

severinleuenberger avatar Apr 09 '15 20:04 severinleuenberger

I think the problem could stem from a problem if you supply a custom port:

First, the custom port is opened here: https://github.com/PX4/Firmware/blob/master/src/drivers/sf0x/sf0x.cpp#L203

It is then probably later in the init() call closed. https://github.com/PX4/Firmware/blob/master/src/drivers/sf0x/sf0x.cpp#L280

And then opened again but this time the default port instead of the custom one: https://github.com/PX4/Firmware/blob/master/src/drivers/sf0x/sf0x.cpp#L636

bansiesta avatar Apr 12 '15 09:04 bansiesta

So @bansiesta was spot on. Before fixing this I tested on the default port (ttyS6 / Serial4 on the Pixhawk) and it worked fine. With the fix other ports (tested ttyS2) work too now. If it's still not working it will be a board specific or wiring issue.

Also make sure nothing else is trying to use the same port (ie: mavlink).

PR on its way shortly.

SimonWilks avatar Apr 13 '15 09:04 SimonWilks