Reading Values from Lidar

Hi, we want/are going to use a LIDAR-Lite v3HP for our robot to read 1d distance and we are doing PWM connections for it. We hooked up the lidar to the Rio’s PWM port and tried to read values from the Shuffleboard using Visual Studio Code by trying to use .getRawBounds() but it can’t seem to be able get human readable values. So we are wondering if anyone has any solution/example for the lidar. Anything would be useful.

Please and thank you

The PWM ports are output-only. You may be able to connect to a DIO port and treat it as a DigitalSource, but we have not tried that. Team 3504 has a nice writeup about it though:
https://github.com/GirlsOfSteelRobotics/Docs/wiki/LIDAR-Lite-Distance-Sensor.

It’s now possible to read a PWM signal through the DutyCycleEncoder class in WPILib, which should work for your use case. You would need to hook it up to the DIO ports, though.

Good point. My comment and 3504’s sample code were based on last year’s wpilib. We’
re using DutyCycleEncoder to read the LaserShark via DIO this year, so the same concept should work for LidarLite.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.