@lightnotes we’re doing this pretty much the same way but since I’ve been writing the lidar code ground up I’m not experiencing the noise issue,but I think I know what went wrong where the lidar scan passes the zero point(0 degree)and the calculations done were not right.
You should review your Arduino code and adding something like this should resolve this problem:
if (CHECKSUM == ( PAC_DATA + (PAC_DATA << 8)))//this calculates the checksum
PT_ANGLE_S = (PAC_DATA + ((PAC_DATA >> 1) << 8)) / 64;//getting current packet start angle
PT_ANGLE_E = (PAC_DATA + ((PAC_DATA >> 1) << 8)) / 64;//getting end angle
if (PT_ANGLE_E < PT_ANGLE_S)//note this:with packet near zero a 360 shall be used to get the right data
if ((PT_ANGLE_S > 270) && (PT_ANGLE_E < 90))
ANGLE_INTERVAL = (360 + PT_ANGLE_E - PT_ANGLE_S) / (PT_REAL_SIZE - 1);
ANGLE_INTERVAL = (PT_ANGLE_E - PT_ANGLE_S) / (PT_REAL_SIZE - 1);
this should resolve the >360 issue
if (PT_ANGLE > 360)
PT_ANGLE = PT_ANGLE - 360;
the above code is based on my lidar so you may have to alter it a little bit to your lidar’s protocol but I hope you got the idea.
and for interfacing with TD I’m still working in progress but instead of using nodes I used python and a OpenCV function that directly translates polar coordinates to the regular xy ones,and feed into a DAT to SOP to get point cloud.this toe is still having some performance issue with large number of points but it do work.hope that inspires you.
the data i feed TD from arduino:
the point cloud result like this:
and the TD project:
lidar-td.toe (23.3 KB)