SICKAG / sick_scan_xd

Based on the sick_scan drivers for ROS1, sick_scan_xd merges sick_scan, sick_scan2 and sick_scan_base repositories. The driver supports both Linux (native, ROS1, ROS2) and Windows (native and ROS2).
Apache License 2.0
89 stars 81 forks source link

Fail to open TCP connection #348

Open BarryLoveBerry opened 2 weeks ago

BarryLoveBerry commented 2 weeks ago

Hi all, I met a issue with TCP connection failed to open. Here is my PC IP,Lidar IP and lanunch file hostname IP. image image image

I used the command as below to test. cd ./sick_scan_ws export LD_LIBRARY_PATH=.:pwd/build:$LD_LIBRARY_PATH # append absolute path to the build folder ./build/sick_scan_xd_api_test ./sick_scan_xd/launch/sick_lms_4xxx.launch hostname:=192.168.8.35

BarryLoveBerry commented 2 weeks ago

Here is the error screenshot. image

rostest commented 2 weeks ago

Thanks for your feedback. The error message means that sick_scan_xd cannot establish a TCP connection to the lidar using the IP address 192.168.8.35 on port 2112. Please ensure that the lidar IP address and TCP port are correct and accessible from your PC. Use SOPAS ET to check or modify the lidar network settings. Can SOPAS ET connect to the lidar and display a point cloud?

BarryLoveBerry commented 2 weeks ago

Thanks for your feedback. The error message means that sick_scan_xd cannot establish a TCP connection to the lidar using the IP address 192.168.8.35 on port 2112. Please ensure that the lidar IP address and TCP port are correct and accessible from your PC. Use SOPAS ET to check or modify the lidar network settings. Can SOPAS ET connect to the lidar and display a point cloud?

Thanks for replying. I resolved this issue. In addition, I want to transform the lidar data into PCL type. Is there has any instruction files? If you have, could you share it with me? Thanks in advance.

rostest commented 2 weeks ago

Thanks for your reply. Sick_scan_xd does not provide a conversion to PCL types. You can use the point cloud handling in https://github.com/SICKAG/sick_scan_xd/blob/develop/test/src/sick_scan_xd_api/sick_scan_xd_api_test.cpp as an example. The structure of the data type SickScanPointCloudMsg is quite similar to the ROS point cloud of type sensor_msgs::PointCloud2. Project http://wiki.ros.org/pcl_ros can be helpful.

UdayVerma20 commented 2 weeks ago

Thanks for your feedback. The error message means that sick_scan_xd cannot establish a TCP connection to the lidar using the IP address 192.168.8.35 on port 2112. Please ensure that the lidar IP address and TCP port are correct and accessible from your PC. Use SOPAS ET to check or modify the lidar network settings. Can SOPAS ET connect to the lidar and display a point cloud?

Thanks for replying. I resolved this issue. In addition, I want to transform the lidar data into PCL type. Is there has any instruction files? If you have, could you share it with me? Thanks in advance.

How did you fix the issue?

BarryLoveBerry commented 1 week ago

Thanks for your feedback. The error message means that sick_scan_xd cannot establish a TCP connection to the lidar using the IP address 192.168.8.35 on port 2112. Please ensure that the lidar IP address and TCP port are correct and accessible from your PC. Use SOPAS ET to check or modify the lidar network settings. Can SOPAS ET connect to the lidar and display a point cloud?

Thanks for replying. I resolved this issue. In addition, I want to transform the lidar data into PCL type. Is there has any instruction files? If you have, could you share it with me? Thanks in advance.

How did you fix the issue?

export env LD_LIBRARY_PATH

BarryLoveBerry commented 1 week ago

Now I created a tool to get the data from lidar LMS4000. and I already received the data from lidar. How to analyze the data and how to transform it into pointcloud(PCL)? Do you have any docs for this issue? I noticed the my data that I received is a bit different with the official doc. Can you help me to locate the where is not correct? thks baowen.txt

rostest commented 1 week ago

Thanks for further information. File baowen.txt shows the lidar LMDscandata telegram. You can use the telegram listing to analyze these data and convert them into the PCL format. We recommend to use the sick_scan_xd API and to convert the scan data received by a registered callback. See sick_scan_api.md and the C++ example in sick_scan_xd_api_test.cpp for details.

BarryLoveBerry commented 1 week ago

Thanks for further information. File baowen.txt shows the lidar LMDscandata telegram. You can use the telegram listing to analyze these data and convert them into the PCL format. We recommend to use the sick_scan_xd API and to convert the scan data received by a registered callback. See sick_scan_api.md and the C++ example in sick_scan_xd_api_test.cpp for details.

Now I got the telegram distance and angle data. How to transform this format to xyz format?

rostest commented 1 week ago

You can convert polar to cartesian coordinates using the following formulas:

x = distance * cos(elevation) * cos(azimuth)
y = distance * cos(elevation) * sin(azimuth)
z = distance * sin(elevation)

sick_scan_api_converter.py shows an example.

The elevation angle is 0.0 for 2D lidars like LMS4000. In this case the cartesian coordinates can be converted by

x = distance * cos(azimuth)
y = distance * sin(azimuth)
z = 0