SICKAG / sick_scan2

sick_scan2 is an open-source project to support the laser scanner of the company SICK using the ROS2 framework
Apache License 2.0
55 stars 42 forks source link

Scanner Connection #39

Open ghanim-mukhtar opened 2 years ago

ghanim-mukhtar commented 2 years ago

The ROS 2 Driver connection

My issue is very similar to this one #28. So now I can connect by using the modified code with the (for loop) and actually the total time of connection could be systematically around 26 seconds, so it is not a problem of readiness for the scanner. Furthermore the configuration file (config/sick_mrs_1xxx.yaml) is edited as per adviced.

The only thing we can think of is that in the loop SickScanCommon::init_scanner() there is some initialization that doesn't take effect unless we pass it twice at least.

We are running the launch command in a docker image, we can provide the image and the logs if necessary to debug this, but we really would like that the nodes worked directly for us without any modifications.

Thanks in advance for your feedback

michael1309 commented 2 years ago

Can you please send the log output as a text file (or alternatively as a screenshot)? Also, please check if you have set the lidar to COLA-B? You can change this permanently with SOPAS-ET and then store it in the EEPROM. We also recommend you to use the sick_scan_xd project, as we actively support it.

ghanim-mukhtar commented 2 years ago

You can find the requested log output below, furthermore I have used SOPAS-ET to permenantly configure the LiDAR and for the Host port parameterization I have indeed set it to COLA-B. Actually it was set to COLA-ASCII and I had problems on first start-up after power-on so I made sure to set it to COLA-B.

I will try to test the sick_scan_xd project and I will let you know if I advance with that, but for now I really need to find a solution with this version of the driver.

log_test.txt

rostest commented 2 years ago

Thanks for your feedback and logfile. According to the log, it takes 60 seconds for the lidar to become ready (i.e. request "sRN SCdevicestate" is answered by "sRA SCdevicestate \x01"). After 45 seconds, init_scanner() returns with timeout. After calling init_scanner() again, the lidar reports "ready" after 16 seconds.

The startup time depends on operational conditions. Increasing the timeout should solve the issue, e.g. to 90 seconds. Please set the timeout in sick_scan_common.cpp line 1972: int maxWaitForDeviceStateReady = 45; // max. 45 sec. (see manual) to e.g. 90 sec: int maxWaitForDeviceStateReady = 90; // wait for max. 90 sec. and retry.