Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to open TCP connection #348

Closed
BarryLoveBerry opened this issue Jun 17, 2024 · 10 comments
Closed

Fail to open TCP connection #348

BarryLoveBerry opened this issue Jun 17, 2024 · 10 comments

Comments

@BarryLoveBerry
Copy link

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
Copy link
Author

Here is the error screenshot.
image

@rostest
Copy link
Collaborator

rostest commented Jun 17, 2024

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
Copy link
Author

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
Copy link
Collaborator

rostest commented Jun 18, 2024

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
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Collaborator

rostest commented Jun 24, 2024

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
Copy link
Author

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
Copy link
Collaborator

rostest commented Jun 26, 2024

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

@rostest rostest closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants