Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Software gets stuck if run before the scanner is ready #32

Closed
Kaju-Bubanja opened this issue Oct 20, 2021 · 6 comments
Closed

Software gets stuck if run before the scanner is ready #32

Kaju-Bubanja opened this issue Oct 20, 2021 · 6 comments

Comments

@Kaju-Bubanja
Copy link

I have an LMS511 connected to a pc which at boot automatically starts the drivers for the LMS. Now when drivers are started and the LMS is not available the program will crash and I can automatically relaunch it with a small wait time. I decided to make the wait conditional if I can ping the LMS, but the problem is the ping is available before the LMS software has started and can react to the requests of the Host pc drivers requests. The Driver then just gets stuck with following line:
Starting scan data ....

Here the complete log:

[sick_generic_caller-1] [INFO] [1634735866.008778732] [sick_scan2]: sick_generic_caller V. 001.009.000
[sick_generic_caller-1] [INFO] [1634735866.008885733] [sick_scan2]: Program arguments: /home/username/ros2_rolling/install/sick_scan2/lib/sick_scan2/sick_generic_caller
[sick_generic_caller-1] [INFO] [1634735866.008904234] [sick_scan2]: Program arguments: --ros-args
[sick_generic_caller-1] [INFO] [1634735866.008914425] [sick_scan2]: Program arguments: --params-file
[sick_generic_caller-1] [INFO] [1634735866.008923213] [sick_scan2]: Program arguments: /home/username/ros2_rolling/install/project/share/project/config/sensor/lms.yaml
[sick_generic_caller-1] [INFO] [1634735866.008931746] [sick_scan2]: sick_generic_caller: scanner_name: sick_lms_5xx, hostname: 192.168.254.26, port: 2112
[sick_generic_caller-1] [INFO] [1634735866.009088580] [sick_scan2]: Start initialising scanner ...
[sick_generic_caller-1] [INFO] [1634735866.009110512] [sick_scan2]: hostname: 192.168.254.26
[sick_generic_caller-1] [INFO] [1634735866.009120125] [sick_scan2]: Port    : 2112
[sick_generic_caller-1] [INFO] [1634735866.011899163] [sick_scan2]: Parameter setting for <active_echo: 0>
[sick_generic_caller-1] [INFO] [1634735866.011965556] [sick_scan2]: Command: <STX>sMN SetAccessMode 3 F4724744<ETX>
[sick_generic_caller-1] [INFO] [1634735866.012116664] [sick_scan2]: Sending  : sMN SetAccessMode \x03\xf4\x72\x47\x44
[sick_generic_caller-1] [INFO] [1634735866.022266965] [sick_scan2]: Receiving: <STX>sAN SetAccessMode \x01<ETX>
[sick_generic_caller-1] [INFO] [1634735866.022330002] [sick_scan2]: Command: <STX>sWN EIHstCola 1<ETX>
[sick_generic_caller-1] [INFO] [1634735866.022375754] [sick_scan2]: Sending  : sWN EIHstCola \x01
[sick_generic_caller-1] [INFO] [1634735866.032480084] [sick_scan2]: Receiving: <STX>sWA EIHstCola <ETX>
[sick_generic_caller-1] [INFO] [1634735866.032526548] [sick_scan2]: Command: <STX>sRN FirmwareVersion<ETX>
[sick_generic_caller-1] [INFO] [1634735866.032564412] [sick_scan2]: Sending  : sRN FirmwareVersion
[sick_generic_caller-1] [INFO] [1634735866.042629718] [sick_scan2]: Receiving: <STX>sRA FirmwareVersion \x00\x09\x53\x20\x31\x2e\x36\x30\x20\x20\x20<ETX>
[sick_generic_caller-1] [INFO] [1634735866.042678223] [sick_scan2]: Command: <STX>sRN SCdevicestate<ETX>
[sick_generic_caller-1] [INFO] [1634735866.042714334] [sick_scan2]: Sending  : sRN SCdevicestate
[sick_generic_caller-1] [INFO] [1634735866.052779890] [sick_scan2]: Receiving: <STX>sRA SCdevicestate \x00<ETX>
[sick_generic_caller-1] [INFO] [1634735866.052832321] [sick_scan2]: Laser is busy
[sick_generic_caller-1] [INFO] [1634735866.052850464] [sick_scan2]: Command: <STX>sRN ODoprh<ETX>
[sick_generic_caller-1] [INFO] [1634735866.052881343] [sick_scan2]: Sending  : sRN ODoprh
[sick_generic_caller-1] [INFO] [1634735866.062932892] [sick_scan2]: Receiving: <STX>sRA ODoprh \x00\x01\x80\x23<ETX>
[sick_generic_caller-1] [INFO] [1634735866.062979743] [sick_scan2]: Command: <STX>sRN ODpwrc<ETX>
[sick_generic_caller-1] [INFO] [1634735866.063015875] [sick_scan2]: Sending  : sRN ODpwrc
[sick_generic_caller-1] [INFO] [1634735866.073115359] [sick_scan2]: Receiving: <STX>sRA ODpwrc \x00\x00\x00\xb4<ETX>
[sick_generic_caller-1] [INFO] [1634735866.073172069] [sick_scan2]: Command: <STX>sRN LocationName<ETX>
[sick_generic_caller-1] [INFO] [1634735866.073212667] [sick_scan2]: Sending  : sRN LocationName
[sick_generic_caller-1] [INFO] [1634735866.083316595] [sick_scan2]: Receiving: <STX>sRA LocationName \x00\x0b\x6e\x6f\x74\x20\x64\x65\x66\x69\x6e\x65\x64<ETX>
[sick_generic_caller-1] [INFO] [1634735866.083397161] [sick_scan2]: Sending  : sRN LMPoutputRange
[sick_generic_caller-1] [INFO] [1634735866.093501477] [sick_scan2]: Receiving: <STX>sRA LMPoutputRange \x00\x01\x00\x00\x13\x88\x00\x00\x00\x00\x00\x1b\x77\x40<ETX>
[sick_generic_caller-1] [INFO] [1634735866.093546414] [sick_scan2]: Angle resolution of scanner is 0.50000 [deg]  (in 1/10000th deg: 0x1388)
[sick_generic_caller-1] [INFO] [1634735866.093564815] [sick_scan2]: MIN_ANG:   -1.658 [rad]  -95.000 [deg]
[sick_generic_caller-1] [INFO] [1634735866.093577960] [sick_scan2]: MAX_ANG:    1.658 [rad]   95.000 [deg]
[sick_generic_caller-1] [INFO] [1634735866.093628276] [sick_scan2]: Sending  : sWN LMPoutputRange \x00\x01\x00\x00\x13\x88\xff\xf1\x81\x11\x00\x0e\x7e\xf0
[sick_generic_caller-1] [INFO] [1634735866.103727849] [sick_scan2]: Receiving: <STX>sFA\x00\x04<ETX>
[sick_generic_caller-1] [INFO] [1634735866.103770502] [sick_scan2]: Error Sopas answer mismatch Error unexpected Sopas Answer for request <STX><STX><STX><STX>!sWN LMPoutputRange ~Answer= >>>sFA\x00\x04<<<
[sick_generic_caller-1] 
[sick_generic_caller-1] [INFO] [1634735866.103808226] [sick_scan2]: Sending  : sRN LMPoutputRange
[sick_generic_caller-1] [INFO] [1634735866.113909582] [sick_scan2]: Receiving: <STX>sRA LMPoutputRange \x00\x01\x00\x00\x13\x88\x00\x00\x00\x00\x00\x1b\x77\x40<ETX>
[sick_generic_caller-1] [INFO] [1634735866.113954275] [sick_scan2]: Angle resolution of scanner is 0.50000 [deg]  (in 1/10000th deg: 0x1388)
[sick_generic_caller-1] [INFO] [1634735866.113971923] [sick_scan2]: MIN_ANG (after command verification in device reference frame):    0.000 [rad]    0.000 [deg]
[sick_generic_caller-1] [INFO] [1634735866.114003303] [sick_scan2]: MAX_ANG (after command verification in device reference frame):    3.142 [rad]  180.000 [deg]
[sick_generic_caller-1] [INFO] [1634735866.114024522] [sick_scan2]: LMS 5xx detected overwriting output channel flag ID
[sick_generic_caller-1] [INFO] [1634735866.114034373] [sick_scan2]: LMS 5xx detected overwriting resolution flag (only 8 bit supported)
[sick_generic_caller-1] [INFO] [1634735866.114077855] [sick_scan2]: Sending  : sWN LMDscandatacfg \x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01
[sick_generic_caller-1] [INFO] [1634735866.124176559] [sick_scan2]: Receiving: <STX>sWA LMDscandatacfg <ETX>
[sick_generic_caller-1] [INFO] [1634735866.124236482] [sick_scan2]: Sending  : sRN LMDscandatacfg
[sick_generic_caller-1] [INFO] [1634735866.134338170] [sick_scan2]: Receiving: <STX>sRA LMDscandatacfg \x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01<ETX>
[sick_generic_caller-1] [INFO] [1634735866.134398635] [sick_scan2]: Command: <STX>sMN LMCstartmeas<ETX>
[sick_generic_caller-1] [INFO] [1634735866.134434521] [sick_scan2]: Sending  : sMN LMCstartmeas
[sick_generic_caller-1] [INFO] [1634735866.144536092] [sick_scan2]: Receiving: <STX>sAN LMCstartmeas \x00<ETX>
[sick_generic_caller-1] [INFO] [1634735866.144584526] [sick_scan2]: Command: <STX>sMN Run<ETX>
[sick_generic_caller-1] [INFO] [1634735866.144622750] [sick_scan2]: Sending  : sMN Run
[sick_generic_caller-1] [INFO] [1634735866.154719084] [sick_scan2]: Receiving: <STX>sAN Run \x01<ETX>
[sick_generic_caller-1] [INFO] [1634735866.154767174] [sick_scan2]: Command: <STX>sEN LMDscandata 1<ETX>
[sick_generic_caller-1] [INFO] [1634735866.154802417] [sick_scan2]: Sending  : sEN LMDscandata \x01
[sick_generic_caller-1] [INFO] [1634735866.164896397] [sick_scan2]: Receiving: <STX>sEA LMDscandata \x01<ETX>
[sick_generic_caller-1] [INFO] [1634735866.164934567] [sick_scan2]: Starting scan data ....
[sick_generic_caller-1] 

Is there a way to a) either prevent the driver from getting stuck there or b) only start the driver when the LMS is ready? I thought waiting for the ping would achieve b) but that seems to not be the case, is there another programmatic way to check when the LMS is ready?

@michael1309
Copy link
Collaborator

@Kaju-Bubanja

Does the driver really get stuck?
It is normal for the initiation process to finish with the output:

[sick_scan2]: Starting scan data ....

The driver then runs normally and only error or warning messages are displayed on the console.

Have you checked with RVIZ whether Pointcloud messages are visible?

otherwise you can use check on which topics data is sent by using

ros topic list

the topics used by this driver are/cloud or /laser

ros topic echo /cloud

shows the messages on the console.

@Kaju-Bubanja
Copy link
Author

ros2 topic list shows no topics being published also usually when everything starts correctly it finishes with something like 1/6 something, 2/6 something until 6/6 something and then Software is now ready.... I'm not at work right now and I will send you the log of a correct boot up on Monday. Thank you for the quick reply.

@Kaju-Bubanja
Copy link
Author

Kaju-Bubanja commented Oct 25, 2021

@michael1309 Including the name, in case you don't get a notification for closed issues
So I just reran the script and even after the sensor fully started the driver stays stuck at the last line from above output script. And ros2 topic list outputs:

/parameter_events
/rosout

Restarting the driver then additionally outputs this to the log:

[sick_generic_caller-1] 
[sick_generic_caller-1] [INFO] [1635151768.576498645] [sick_scan2]: 1 / 6 Packet dropped Software PLL not yet locked.
[sick_generic_caller-1] [INFO] [1635151768.590367272] [sick_scan2]: 2 / 6 Packet dropped Software PLL not yet locked.
[sick_generic_caller-1] [INFO] [1635151768.602938920] [sick_scan2]: 3 / 6 Packet dropped Software PLL not yet locked.
[sick_generic_caller-1] [INFO] [1635151768.616360408] [sick_scan2]: 4 / 6 Packet dropped Software PLL not yet locked.
[sick_generic_caller-1] [INFO] [1635151768.630392536] [sick_scan2]: 5 / 6 Packet dropped Software PLL not yet locked.
[sick_generic_caller-1] [INFO] [1635151768.642977645] [sick_scan2]: 6 / 6 Packet dropped Software PLL not yet locked.
[sick_generic_caller-1] [INFO] [1635151768.643035572] [sick_scan2]: Software PLL is expected to be ready now!

with ros2 topic list outputting \cloud the topic name I chose.

@mayankpathak10
Copy link

What was the resolution of this issue? I am in a similar situation with MRS1000. I was able to run it a few days ago, so I know what output to expect when it is successfully connected and started. Currently, there is no output after Starting scan data .... even after waiting for a few minutes.

@Loctangba
Copy link

how to do fix this

@rostest
Copy link
Collaborator

rostest commented Jun 27, 2022

@Loctangba We recommend to use https://github.com/SICKAG/sick_scan_xd for all lidars supported (see https://github.com/SICKAG/sick_scan_xd#supported-hardware). Please don't hesitate to report issues there in case of problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants