lightware i2c lidar - voxl m500 with flight core v2
-
Hi,
Looking at the datasheet, it appears the external i2c connector on the flight core v2 is j14 (the 12 pin connector) with pins 6 and 7 being SDA and SCL respectively. Assuming I have that correct, I wired up a lightware LW20/C lidar and connected it to the m500, but nothing appears to have changed in the mavros topics the drone outputs. Of course there's some possibility of a loose / faulty connection / bad soldering, but I checked and there is properly 3.3V across the J14 power pins, so I can assume the SDA and SCL pins are also properly connected. Is there any additional setup I need to do to get the lidar working? From reading other posts about i2c setup on the voxl, it seemed like on startup the lidar should be recognized and drivers should be started.
Thanks!
-
Hi,
Looking at the datasheet, it appears the external i2c connector on the flight core v2 is j14 (the 12 pin connector) with pins 6 and 7 being SDA and SCL respectively. Assuming I have that correct, I wired up a lightware LW20/C lidar and connected it to the m500, but nothing appears to have changed in the mavros topics the drone outputs. Of course there's some possibility of a loose / faulty connection / bad soldering, but I checked and there is properly 3.3V across the J14 power pins, so I can assume the SDA and SCL pins are also properly connected. Is there any additional setup I need to do to get the lidar working? From reading other posts about i2c setup on the voxl, it seemed like on startup the lidar should be recognized and drivers should be started.
Thanks!
@jonathankampia Looking through the PX4 code it seems there is a parameter called SENS_EN_SF1XX that is by default set to 0. If it is set to 1 then it should autostart the lightware_laser_i2c on next boot. To debug you can open up the nuttx (mavlink) console on QGC and enter
lightware_laser_i2c statusto see if the driver is running or not. If it appears to be running you can trylistener distance_sensorto see if the driver is actually publishing distance measurements. -
@jonathankampia Looking through the PX4 code it seems there is a parameter called SENS_EN_SF1XX that is by default set to 0. If it is set to 1 then it should autostart the lightware_laser_i2c on next boot. To debug you can open up the nuttx (mavlink) console on QGC and enter
lightware_laser_i2c statusto see if the driver is running or not. If it appears to be running you can trylistener distance_sensorto see if the driver is actually publishing distance measurements.@Eric-Katzfey So the parameter you mentioned contains the models of the lidar in QGC, and after selecting the correct model and looking at the i2c buses we figured out that for some reason you have to unplug and plug back in the lidar after you start up the drone. Then, it will appear as a device, and we can start it manually with lightware_laser_i2c start -X -b 2. Not sure why it's necessary to do this manually and it's pretty annoying, though.
-
@Eric-Katzfey So the parameter you mentioned contains the models of the lidar in QGC, and after selecting the correct model and looking at the i2c buses we figured out that for some reason you have to unplug and plug back in the lidar after you start up the drone. Then, it will appear as a device, and we can start it manually with lightware_laser_i2c start -X -b 2. Not sure why it's necessary to do this manually and it's pretty annoying, though.
@jonathankampia I would also like to mention this is hooked up to a flight core v2 on firmware version 1.13.2. One of my mentors said this might be the problem, as the previous firmware version we used with the original flight cores did not have this issue
-
@jonathankampia I would also like to mention this is hooked up to a flight core v2 on firmware version 1.13.2. One of my mentors said this might be the problem, as the previous firmware version we used with the original flight cores did not have this issue
@jonathankampia Yes, that does sound annoying! I'm trying to understand how unplugging the unit and plugging it back in would make any difference. If you don't do this unplugging and replugging and try to run
lightware_laser_i2c start -X -b 2manually it will fail? Even with repeated tries? PX4 doesn't know anything about what is on any particular i2c bus. When you start the driver you just tell it which bus to try. It will then try to send commands addressed to the unit on that bus and see if the unit responds. However, the unplugging / replugging is power cycling the lidar unit. So it's possible that there is a race condition in that the unit powers up but is not yet ready when px4 attempts to communicate with it. -
@jonathankampia I would also like to mention this is hooked up to a flight core v2 on firmware version 1.13.2. One of my mentors said this might be the problem, as the previous firmware version we used with the original flight cores did not have this issue
@jonathankampia You could also try to ask on the PX4 discord channel to see if any other PX4 users have experienced this issue.
-
@jonathankampia You could also try to ask on the PX4 discord channel to see if any other PX4 users have experienced this issue.
I am running into this issue as well. I found there is an active issue on PX4 related to this sensor not starting automatically on startup here:
Lightware Laser does not start on external bus on Pixhawk4 Fmuv5 in boot sequence · Issue #17308 · PX4/PX4-Autopilot
Lightware Laser (Sf10a) does not start with boot sequence on Pixhawk4 (FmuV5). Starting it later via console works without issues: Tested releases:1.11.x, 1.12-beta1 and 1.12-beta2 No issues with external RM3100 magnetometer.
GitHub (github.com)
-
I am running into this issue as well. I found there is an active issue on PX4 related to this sensor not starting automatically on startup here:
Lightware Laser does not start on external bus on Pixhawk4 Fmuv5 in boot sequence · Issue #17308 · PX4/PX4-Autopilot
Lightware Laser (Sf10a) does not start with boot sequence on Pixhawk4 (FmuV5). Starting it later via console works without issues: Tested releases:1.11.x, 1.12-beta1 and 1.12-beta2 No issues with external RM3100 magnetometer.
GitHub (github.com)
Also running into problem where device is not detected unless plugged in after FCV2 is already powered when running
lightware_laser_i2c start -XThis is on PX4 1.13.2 as well
-
@jonathankampia Yes, that does sound annoying! I'm trying to understand how unplugging the unit and plugging it back in would make any difference. If you don't do this unplugging and replugging and try to run
lightware_laser_i2c start -X -b 2manually it will fail? Even with repeated tries? PX4 doesn't know anything about what is on any particular i2c bus. When you start the driver you just tell it which bus to try. It will then try to send commands addressed to the unit on that bus and see if the unit responds. However, the unplugging / replugging is power cycling the lidar unit. So it's possible that there is a race condition in that the unit powers up but is not yet ready when px4 attempts to communicate with it.So it's possible that there is a race condition in that the unit powers up but is not yet ready when px4 attempts to communicate with it.
I tried powering the lightware lidar via microusb and keeping all else the same to see if there was that race condition.
I found that even if the lightware lidar is already on and continually getting power from the microusb, the flightcore v2 still will not detect it unless it gets plugged in after the flightcore v2 turns on
-
So it's possible that there is a race condition in that the unit powers up but is not yet ready when px4 attempts to communicate with it.
I tried powering the lightware lidar via microusb and keeping all else the same to see if there was that race condition.
I found that even if the lightware lidar is already on and continually getting power from the microusb, the flightcore v2 still will not detect it unless it gets plugged in after the flightcore v2 turns on
Tested on 1.12.2, seeing same issue
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login