ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    lightware i2c lidar - voxl m500 with flight core v2

    Ask your questions right here!
    3
    10
    666
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jonathankampia
      last edited by

      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!

      Eric KatzfeyE 1 Reply Last reply Reply Quote 0
      • Eric KatzfeyE
        Eric Katzfey ModalAI Team @jonathankampia
        last edited by

        @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 status to see if the driver is running or not. If it appears to be running you can try listener distance_sensor to see if the driver is actually publishing distance measurements.

        J 1 Reply Last reply Reply Quote 0
        • J
          jonathankampia @Eric Katzfey
          last edited by

          @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.

          J 1 Reply Last reply Reply Quote 0
          • J
            jonathankampia @jonathankampia
            last edited by

            @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

            Eric KatzfeyE 2 Replies Last reply Reply Quote 0
            • Eric KatzfeyE
              Eric Katzfey ModalAI Team @jonathankampia
              last edited by

              @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 2 manually 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.

              John Nomikos 0J 1 Reply Last reply Reply Quote 0
              • Eric KatzfeyE
                Eric Katzfey ModalAI Team @jonathankampia
                last edited by

                @jonathankampia You could also try to ask on the PX4 discord channel to see if any other PX4 users have experienced this issue.

                John Nomikos 0J 1 Reply Last reply Reply Quote 0
                • John Nomikos 0J
                  John Nomikos 0 @Eric Katzfey
                  last edited by

                  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:

                  https://github.com/PX4/PX4-Autopilot/issues/17308

                  John Nomikos 0J 1 Reply Last reply Reply Quote 0
                  • John Nomikos 0J
                    John Nomikos 0 @John Nomikos 0
                    last edited by

                    Also running into problem where device is not detected unless plugged in after FCV2 is already powered when running
                    lightware_laser_i2c start -X

                    This is on PX4 1.13.2 as well

                    1 Reply Last reply Reply Quote 0
                    • John Nomikos 0J
                      John Nomikos 0 @Eric Katzfey
                      last edited by

                      @Eric-Katzfey

                      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

                      John Nomikos 0J 1 Reply Last reply Reply Quote 0
                      • John Nomikos 0J
                        John Nomikos 0 @John Nomikos 0
                        last edited by

                        Tested on 1.12.2, seeing same issue

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Powered by NodeBB | Contributors