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
105 stars 86 forks source link

Change min_ang and max_ang failed (sick lms1xx) #35

Closed NekoSaiKou closed 2 years ago

NekoSaiKou commented 2 years ago

Hi, I have two LMS100 and I want to change the min_ang and max_ang using the provided launch file

However, I got this output

[ INFO] [1649388783.031327939]: Sending  : <STX><STX><STX><STX><Len=0018>sRN LMPoutputRange CRC:<0x5e>
[ INFO] [1649388783.032709519]: Receiving: <STX>sRA LMPoutputRange \x00\x01\x00\x00\x13\x88\xff\xf9\x22\x30...
[ INFO] [1649388783.032934463]: Angle resolution of scanner is 0.5 [deg]  (in 1/10000th deg: 5000)
[ INFO] [1649388783.033030455]: [From:To] -45 [deg] to 225f [deg] (in 1/10000th deg: from -450000 to 2250000)
[ INFO] [1649388783.033108844]: MIN_ANG: -2.35619 [rad] -135 [deg]
[ INFO] [1649388783.033201720]: MAX_ANG: 2.35619 [rad] 135 [deg]
[ INFO] [1649388783.033326676]: Sending  : <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 0x00 0x13 0x88 0xff 0xf9 0x22 0x33 0x00 0x22 0x55 0x0d CRC:<0x8c>
[ INFO] [1649388783.034770660]: Receiving: <STX>sFA\x00\x0a<ETX>
[ WARN] [1649388783.034928104]: Error Sopas answer mismatch: Error unexpected Sopas answer for request <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 ..., received answer: "sFA\x00\x0a", expected patterns: "sWA LMPoutputRange","sAN LMPoutputRange"
[ WARN] [1649388788.035193019]: Timeout during waiting for new datagram
[ WARN] [1649388788.035376670]: Error Sopas answer mismatch: Error unexpected Sopas answer for request <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 ..., received answer: "", expected patterns: "sWA LMPoutputRange","sAN LMPoutputRange"
[ERROR] [1649388788.035469570]: Error unexpected Sopas answer for request <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 ..., giving up after 1 unexpected answers.
[ INFO] [1649388788.035572149]: Failed to init scanner Error Code: 1
Waiting for timeout...

After that, it times out. AFAIK, sFA\x00\x0a means Sopas_Error_VARIABLE_WRITE_ACCESSDENIED, and the document says that It is not allowed to write values to this variable. Probably the variable is defined as read-only. That is pretty weird.

I have read similar issue here, but it seems that the password is correct. Here is the full log

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.12
 * /sick_lms_1xx/activate_lferec: True
 * /sick_lms_1xx/activate_lidinputstate: True
 * /sick_lms_1xx/activate_lidoutputstate: True
 * /sick_lms_1xx/ang_res: 0.5
 * /sick_lms_1xx/client_authorization_pw: F4724744
 * /sick_lms_1xx/frame_id: cloud
 * /sick_lms_1xx/hostname: 192.168.51.3
 * /sick_lms_1xx/intensity: False
 * /sick_lms_1xx/intensity_resolution_16bit: False
 * /sick_lms_1xx/max_ang: 2.35619
 * /sick_lms_1xx/message_monitoring_enabled: True
 * /sick_lms_1xx/min_ang: -2.35619
 * /sick_lms_1xx/min_intensity: 0.0
 * /sick_lms_1xx/port: 2112
 * /sick_lms_1xx/range_max: 25.0
 * /sick_lms_1xx/read_timeout_millisec_default: 5000
 * /sick_lms_1xx/read_timeout_millisec_kill_node: 150000
 * /sick_lms_1xx/read_timeout_millisec_startup: 120000
 * /sick_lms_1xx/scan_freq: 50.0
 * /sick_lms_1xx/scanner_type: sick_lms_1xx
 * /sick_lms_1xx/start_services: True
 * /sick_lms_1xx/sw_pll_only_publish: True
 * /sick_lms_1xx/timelimit: 5
 * /sick_lms_1xx/use_binary_protocol: True

NODES
  /
    sick_lms_1xx (sick_scan/sick_generic_caller)

ROS_MASTER_URI=http://localhost:11311

process[sick_lms_1xx-1]: started with pid [571531]
[ INFO] [1649388781.560193350]: sick_generic_caller V. 2.6.1

[ INFO] [1649388781.561245937]: Program argument 1: /home/aiRobots/aiRobots/aiRobots_AMMR/Software/devel/lib/sick_scan/sick_generic_caller

[ INFO] [1649388781.561287128]: Program argument 2: __log:=/home/aiRobots/.ros/log/3a2f8816-b66c-11ec-987a-ace2d35a34c7/sick_lms_1xx-1.log

[ INFO] [1649388781.561305534]: Program argument 3: __name:=sick_lms_1xx

[ INFO] [1649388781.566080178]: Found sopas_protocol_type param overwriting default protocol:
[ INFO] [1649388781.566111343]: Binary protocol activated
[ INFO] [1649388781.567513377]: Start initialising scanner [Ip: 192.168.51.3] [Port:2112]
[ INFO] [1649388781.600177339]: Publishing on topic "/sick_lms_1xx/lferec"
[ INFO] [1649388781.600759335]: Publishing on topic "/sick_lms_1xx/lidoutputstate"
[ INFO] [1649388781.601425618]: Publishing on topic "/sick_lms_1xx/marker"
[ INFO] [1649388781.602114828]: Publishing laserscan-pointcloud2 to cloud
[ INFO] [1649388781.602151793]: Publishing on topic "/cloud"
[ INFO] [1649388781.602803559]: Publishing on topic "/sick_lms_1xx/imu"
[ INFO] [1649388781.603352968]: Publishing on topic "/sick_lms_1xx/encoder"
[ INFO] [1649388781.603859166]: Publishing on topic "/sick_lms_1xx/scan"
[ INFO] [1649388781.604372355]: sick_scan_xd: Tcp::open: connecting to 192.168.51.3:2112 ...
[ INFO] [1649388781.604807098]: sick_scan_xd Tcp::open: connected to 192.168.51.3:2112
[ INFO] [1649388781.604834865]: SickThread TcpRecvThread started.
[ INFO] [1649388781.606690336]: Parameter setting for <active_echo: 0d>

[ INFO] [1649388781.608072951]: Sending  : <STX><STX><STX><STX><Len=0017>sRN SCdevicestate CRC:<0x30>
[ INFO] [1649388781.609306742]: Receiving: <STX>sRA SCdevicestate \x01<ETX>
[ INFO] [1649388781.609369918]: checkColaDialect: lidar response in configured Cola-dialect Cola-B
[ INFO] [1649388781.809623884]: Sending  : <STX><STX><STX><STX><Len=0023>sMN SetAccessMode 0x03 0xf4 0x72 0x47 0x44 CRC:<0xb3>
[ INFO] [1649388781.812514732]: Receiving: <STX>sAN SetAccessMode \x01<ETX>
[ INFO] [1649388782.012835447]: Sending  : <STX><STX><STX><STX><Len=0015>sWN EIHstCola 0x01 CRC:<0x09>
[ INFO] [1649388782.014211502]: Receiving: <STX>sWA EIHstCola <ETX>
[ INFO] [1649388782.214606212]: Sending  : <STX><STX><STX><STX><Len=0019>sRN FirmwareVersion CRC:<0x24>
[ INFO] [1649388782.218069927]: Receiving: <STX>sRA FirmwareVersion \x00\x0a\x56\x31\x2e\x32\x33\x20\x20\x2...
[ INFO] [1649388782.418492188]: Sending  : <STX><STX><STX><STX><Len=0017>sRN SCdevicestate CRC:<0x30>
[ INFO] [1649388782.420099315]: Receiving: <STX>sRA SCdevicestate \x00<ETX>
[ INFO] [1649388782.620491186]: Sending  : <STX><STX><STX><STX><Len=0010>sRN ODoprh CRC:<0x41>
[ INFO] [1649388782.621733611]: Receiving: <STX>sRA ODoprh \x00\x00\x37\xaa<ETX>
[ INFO] [1649388782.824357338]: Sending  : <STX><STX><STX><STX><Len=0010>sRN ODpwrc CRC:<0x52>
[ INFO] [1649388782.825671105]: Receiving: <STX>sRA ODpwrc \x00\x00\x06\x08<ETX>
[ INFO] [1649388783.027782363]: Sending  : <STX><STX><STX><STX><Len=0016>sRN LocationName CRC:<0x55>
[ INFO] [1649388783.029221587]: Receiving: <STX>sRA LocationName \x00\x05\x66\x72\x6f\x6e\x74<ETX>
[ INFO] [1649388783.031327939]: Sending  : <STX><STX><STX><STX><Len=0018>sRN LMPoutputRange CRC:<0x5e>
[ INFO] [1649388783.032709519]: Receiving: <STX>sRA LMPoutputRange \x00\x01\x00\x00\x13\x88\xff\xf9\x22\x30...
[ INFO] [1649388783.032934463]: Angle resolution of scanner is 0.5 [deg]  (in 1/10000th deg: 5000)
[ INFO] [1649388783.033030455]: [From:To] -45 [deg] to 225f [deg] (in 1/10000th deg: from -450000 to 2250000)
[ INFO] [1649388783.033108844]: MIN_ANG: -2.35619 [rad] -135 [deg]
[ INFO] [1649388783.033201720]: MAX_ANG: 2.35619 [rad] 135 [deg]
[ INFO] [1649388783.033326676]: Sending  : <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 0x00 0x13 0x88 0xff 0xf9 0x22 0x33 0x00 0x22 0x55 0x0d CRC:<0x8c>
[ INFO] [1649388783.034770660]: Receiving: <STX>sFA\x00\x0a<ETX>
[ WARN] [1649388783.034928104]: Error Sopas answer mismatch: Error unexpected Sopas answer for request <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 ..., received answer: "sFA\x00\x0a", expected patterns: "sWA LMPoutputRange","sAN LMPoutputRange"
[ WARN] [1649388788.035193019]: Timeout during waiting for new datagram
[ WARN] [1649388788.035376670]: Error Sopas answer mismatch: Error unexpected Sopas answer for request <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 ..., received answer: "", expected patterns: "sWA LMPoutputRange","sAN LMPoutputRange"
[ERROR] [1649388788.035469570]: Error unexpected Sopas answer for request <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 ..., giving up after 1 unexpected answers.
[ INFO] [1649388788.035572149]: Failed to init scanner Error Code: 1
Waiting for timeout...
If the communication mode set in the scanner memory is different from that used by the driver, the scanner's communication mode is changed.
This requires a restart of the TCP-IP connection, which can extend the start time by up to 30 seconds. There are two ways to prevent this:
1. [Recommended] Set the communication mode with the SOPAS ET software to binary and save this setting in the scanner's EEPROM.
2. Use the parameter "use_binary_protocol" to overwrite the default settings of the driver.
[ERROR] [1649388788.035701075]: ## ERROR in mainGenericLaser: init failed, retrying...
[ INFO] [1649388788.035799690]: Start initialising scanner [Ip: 192.168.51.3] [Port:2112]
[ WARN] [1649388788.035877767]: Disconnecting TCP-Connection.
[ERROR] [1649388788.036057350]: Tcp::readInputData: Read 0 bytes, connection is lost!
[ INFO] [1649388788.036166489]: SickThread TcpRecvThread finished (flags: threadShouldRun=0, endThread=0).
sick_scan driver closed.
[ INFO] [1649388788.108270027]: Publishing on topic "/sick_lms_1xx/lferec"
[ INFO] [1649388788.108832895]: Publishing on topic "/sick_lms_1xx/lidoutputstate"
[ INFO] [1649388788.109471992]: Publishing on topic "/sick_lms_1xx/marker"
[ INFO] [1649388788.110049152]: Publishing laserscan-pointcloud2 to cloud
[ INFO] [1649388788.110085841]: Publishing on topic "/cloud"
[ INFO] [1649388788.111173284]: Publishing on topic "/sick_lms_1xx/imu"
[ INFO] [1649388788.112252923]: Publishing on topic "/sick_lms_1xx/encoder"
[ INFO] [1649388788.113079779]: Publishing on topic "/sick_lms_1xx/scan"
[ INFO] [1649388788.114045491]: sick_scan_xd: Tcp::open: connecting to 192.168.51.3:2112 ...
[ INFO] [1649388788.114472429]: SickThread TcpRecvThread started.
[ INFO] [1649388788.114518587]: sick_scan_xd Tcp::open: connected to 192.168.51.3:2112
[ INFO] [1649388788.116659004]: Parameter setting for <active_echo: 0d>

[ INFO] [1649388788.117592834]: Sending  : <STX><STX><STX><STX><Len=0017>sRN SCdevicestate CRC:<0x30>
[ INFO] [1649388788.120003133]: Receiving: <STX>sRA SCdevicestate \x01<ETX>
[ INFO] [1649388788.120046102]: checkColaDialect: lidar response in configured Cola-dialect Cola-B
[ INFO] [1649388788.320207848]: Sending  : <STX><STX><STX><STX><Len=0023>sMN SetAccessMode 0x03 0xf4 0x72 0x47 0x44 CRC:<0xb3>
[ INFO] [1649388788.323377159]: Receiving: <STX>sAN SetAccessMode \x01<ETX>
[ INFO] [1649388788.523929682]: Sending  : <STX><STX><STX><STX><Len=0015>sWN EIHstCola 0x01 CRC:<0x09>
[ INFO] [1649388788.525316755]: Receiving: <STX>sWA EIHstCola <ETX>
^C[sick_lms_1xx-1] killing on exit
[ INFO] [1649388788.673082770]: Caught signal 2

[ INFO] [1649388788.673166721]: good bye

[ INFO] [1649388788.673221175]: You are leaving the following version of this node:

[ INFO] [1649388788.673290320]: sick_generic_caller V. 2.6.1

[ INFO] [1649388788.725570603]: Sending  : <STX><STX><STX><STX><Len=0019>sRN FirmwareVersion CRC:<0x24>
[ INFO] [1649388788.726742211]: Receiving: <STX>sRA FirmwareVersion \x00\x0a\x56\x31\x2e\x32\x33\x20\x20\x2...
[ INFO] [1649388788.926931192]: Sending  : <STX><STX><STX><STX><Len=0017>sRN SCdevicestate CRC:<0x30>
[ INFO] [1649388788.928320591]: Receiving: <STX>sRA SCdevicestate \x00<ETX>
[ INFO] [1649388789.128692855]: Sending  : <STX><STX><STX><STX><Len=0010>sRN ODoprh CRC:<0x41>
[ INFO] [1649388789.130037289]: Receiving: <STX>sRA ODoprh \x00\x00\x37\xaa<ETX>
[ INFO] [1649388789.332256138]: Sending  : <STX><STX><STX><STX><Len=0010>sRN ODpwrc CRC:<0x52>
[ INFO] [1649388789.333578941]: Receiving: <STX>sRA ODpwrc \x00\x00\x06\x08<ETX>
[ INFO] [1649388789.535604166]: Sending  : <STX><STX><STX><STX><Len=0016>sRN LocationName CRC:<0x55>
[ INFO] [1649388789.536762437]: Receiving: <STX>sRA LocationName \x00\x05\x66\x72\x6f\x6e\x74<ETX>
[ INFO] [1649388789.537550615]: Sending  : <STX><STX><STX><STX><Len=0018>sRN LMPoutputRange CRC:<0x5e>
[ INFO] [1649388789.538667472]: Receiving: <STX>sRA LMPoutputRange \x00\x01\x00\x00\x13\x88\xff\xf9\x22\x30...
[ INFO] [1649388789.538736747]: Angle resolution of scanner is 0.5 [deg]  (in 1/10000th deg: 5000)
[ INFO] [1649388789.538759644]: [From:To] -45 [deg] to 225f [deg] (in 1/10000th deg: from -450000 to 2250000)
[ INFO] [1649388789.538772916]: MIN_ANG: -2.35619 [rad] -135 [deg]
[ INFO] [1649388789.538784222]: MAX_ANG: 2.35619 [rad] 135 [deg]
[ INFO] [1649388789.538805645]: Sending  : <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 0x00 0x13 0x88 0xff 0xf9 0x22 0x33 0x00 0x22 0x55 0x0d CRC:<0x8c>
[ INFO] [1649388789.540109536]: Receiving: <STX>sFA\x00\x0a<ETX>
[ WARN] [1649388789.540168796]: Error Sopas answer mismatch: Error unexpected Sopas answer for request <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 ..., received answer: "sFA\x00\x0a", expected patterns: "sWA LMPoutputRange","sAN LMPoutputRange"
[ WARN] [1649388794.540475245]: Timeout during waiting for new datagram
[ WARN] [1649388794.540610473]: Error Sopas answer mismatch: Error unexpected Sopas answer for request <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 ..., received answer: "", expected patterns: "sWA LMPoutputRange","sAN LMPoutputRange"
[ERROR] [1649388794.540690340]: Error unexpected Sopas answer for request <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 ..., giving up after 1 unexpected answers.
[ INFO] [1649388794.540794032]: Failed to init scanner Error Code: 1
Waiting for timeout...

I finally kill the process because the software tries to initialize the scanner again.

BTW, I have tried your old repository sick_scan. I still cannot change the min_ang and max_ang. Parameter I used:

<param name="min_ang" type="double" value="0.0"/> 
<param name="max_ang" type="double" value="3.141"/> 

I got same SFA 00 0A error. The scanner is initialized successfully, but the output angle range unchanged.

Here is the log from old repository

[ INFO] [1649390309.923662225]: Sending  : <STX><STX><STX><STX><Len=0018>sRN LMPoutputRange CRC:<0x5e>
[ INFO] [1649390309.924823547]: Receiving: <STX>sRA LMPoutputRange \x00\x01\x00\x00\x13\x88\xff\xf9\x22\x30\x00\x22\x55\x10<ETX>
[ INFO] [1649390309.924919518]: Angle resolution of scanner is 0.50000 [deg]  (in 1/10000th deg: 0x1388)
[ INFO] [1649390309.924959997]: [From:To] -45.00000 [deg] to 225.00000 [deg] (in 1/10000th deg: from 0xFFF92230 to 0x225510)
[ INFO] [1649390309.924980914]: MIN_ANG:    0.000 [rad]    0.000 [deg]
[ INFO] [1649390309.925002415]: MAX_ANG:    3.141 [rad]  179.966 [deg]
[ INFO] [1649390309.925072690]: Sending  : <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 0x00 0x13 0x88 0x00 0x0d 0xbb 0xa0 0x00 0x29 0x31 0x8c CRC:<0x63>
[ INFO] [1649390309.927279732]: Receiving: <STX>sFA\x00\x0a<ETX>
[ERROR] [1649390309.927356897]: Error Sopas answer mismatch Error unexpected Sopas Answer for request <STX><STX><STX><STX><Len=0033>sWN LMPoutputRange 0x00 0x01 0x00 0x00 0x13 0x88 0x00 0x0d 0xbb 0xa0 0x00 0x29 0x31 0x8c CRC:<0x63>Answer= >>>sFA\x00\x0a<<<

[ INFO] [1649390309.927450118]: Sending  : <STX><STX><STX><STX><Len=0018>sRN LMPoutputRange CRC:<0x5e>
[ INFO] [1649390309.929700704]: Receiving: <STX>sRA LMPoutputRange \x00\x01\x00\x00\x13\x88\xff\xf9\x22\x30\x00\x22\x55\x10<ETX>
[ INFO] [1649390309.929795785]: Angle resolution of scanner is 0.50000 [deg]  (in 1/10000th deg: 0x1388)
[ INFO] [1649390309.931434007]: MIN_ANG (after command verification):    0.000 [rad]    0.000 [deg]
[ INFO] [1649390309.931477863]: MAX_ANG (after command verification):    3.141 [rad]  179.966 [deg]
rostest commented 2 years ago

Thanks for reporting. At a first glance, I can't see any reason why the LMPoutputRange request fails.

You're right, error code 0x0a means Sopas_Error_VARIABLE_WRITE_ACCESSDENIED. The authorization (i.e. switch to client level) is successful and confirmed by response sAN SetAccessMode 1:

[ INFO] [1649388781.809623884]: Sending  : <STX><STX><STX><STX><Len=0023>sMN SetAccessMode 0x03 0xf4 0x72 0x47 0x44 CRC:<0xb3>
[ INFO] [1649388781.812514732]: Receiving: <STX>sAN SetAccessMode \x01<ETX>

Therefor, the sWN LMPoutputRange request should not cause an "access denied" error.

The request sWN LMPoutputRange 0x00 0x01 0x00 0x00 0x13 0x88 0xff 0xf9 0x22 0x33 0x00 0x22 0x55 0x0d looks good, too. The parameters are 0.5 deg angular resolution, -45 deg start angle and +225 deg stop angle in lidar coordinates. These values are correct. In particular:

Angular resolution:

Start angle:

Stop angle:

The responded error code "access denied" to the LMPoutputRange request is unexpected.

Is it right, that the lidar LED and 7-segment display did not indicate an error? In this case, can you please check whether the min/max angle configuration works with SOPAS ET? If min/max angle configuration also fails in SOPAS ET, the issue would be beyond this driver. Otherwise, we have to dig deeper. Thanks in advance.

NekoSaiKou commented 2 years ago

Hi,

Thanks for your reply. After factory reset, the LED indicates that everything is OK. But both of the scanner still cannot be set with SOPAS ET.

Since these scanners had not been used for years, I wonder if the device version is too old The device version:

Should I update the firmware?

277115319_1307594513109119_1427444520811847070_n

rostest commented 2 years ago

Thanks for your reply. Please use the most recent firmware and sick_scan_xd release and retry.

NekoSaiKou commented 2 years ago

Sorry for my late reply.

I have trouble downloading firmware. "Download Firmware" button is disabled in the SOPAS ET window. I'll contact SICK company in my country for help. Also, I would greatly appreciate it if anyone can tell me whether there is any official firmware update instruction or not. If I have any progress on this issue, I will leave a comment ASAP.

michael1309 commented 2 years ago

We recommend, as you suggest yourself, to ask the official SICK support. You will get professional help updating your firmware there.

NekoSaiKou commented 2 years ago