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
99 stars 84 forks source link

API for 2 scanners #194

Closed bazzou-mohammed closed 1 year ago

bazzou-mohammed commented 1 year ago

Hi, I am currently working on a LIDAR detection project and using a Sick LMS511-10100. By following a tutorial on Windows without ROS, I successfully retrieved data from my scanner. Now, I would like to incorporate another Sick LMS511-10100 and integrate them both into a single API. Is it possible to achieve this? If so, could you please share any tips or tricks you have used to accomplish this? Thank you for your help.

rostest commented 1 year ago

Thank you for your feedback. Currently the API does not support concurrent processing of multiple lidars. You may run each lidar in a separate process using the sick_scan_xd API and interprocess communication. We recommend using ROS-1 or ROS-2 to run multiple lidars. See https://github.com/SICKAG/sick_scan_xd/issues/169 for further information.

bazzou-mohammed commented 1 year ago

Hi, Thank you for the feedback, the problem we're having today is that we can't use the ROS-1 and ROS-2 processes because they don't suit our environment. do you have another issue. Thank you for your help.

bazzou-mohammed commented 1 year ago

Hi, I'd like your advice on using a single API for 2 scanners. I remind you that I work with two Sick LMS511-10100 scanner, on Windows and without ROS. If I follow these steps, do you think I will be able to process two scanners simultaneously :

rostest commented 1 year ago

Thank you for your feedback. Processing 2 or more lidars concurrently with multiple calls of SickScanApiInit-functions requires threadsafe libraries. The sick_scan_xd library is currently not guaranteed to be fully thread-safe. Processing 2 lidars this way can cause unexpected results incl. core dumps.

Currently you can run 2 lidars in 2 different processes, where each process runs one lidar using the SickScan-API functions. In this case, the integration of both processes in a single application requires interprocess communication and data exchange.

gigades commented 1 year ago

@rostest Just curious. I saw that SickScanApiInit() return a handle that have to be passed to other functions. It seems like you have designed it to support multiple scanners in the first place. What made you change your mind? I have the same requirements and using inter-process communication to communicate with multiple scanners make the development unnecessarily complicate.