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

min_ang and max_ang params - Not respected by the package! #18

Closed Bmoradi93 closed 3 years ago

Bmoradi93 commented 3 years ago

Hi team, We are using sick_tim_571 2D laser scanner under ROS foxy for our robots. In our application, we need to change the min_ang and max_ang parameters to cover s specific angle for our scanning. We change the parameters in sick_tim_5xx.yaml. No matter what we enter for max and min angle, these parameters are not respected and laser scanner angle coverage is not changed. After each modification, we build the package. Please let us know if you have any solution to this issue.

This is our param file: sick_scan2: # configuration for sick_scan2_tim_5xx: For compatibility with ros versions previous to foxy, node and parameter name changed to sick_scan2 for all supported scanner. The type of scanner is configured by scanner_name only. ros__parameters: hostname : "" frame_id : "cloud" scanner_name : "sick_tim_5xx" port : 2112 min_ang : -1.0 max_ang : 1.0

michael1309 commented 3 years ago

Hello @Bmoradi93

We were able to reproduce the behavior you described. You probably get something like this output when starting the driver.

[sick_generic_caller-1] [INFO] [1616064205.660359122] [sick_scan2]: MIN_ANG:   -1.000 [rad]  -57.296 [deg]
[sick_generic_caller-1] [INFO] [1616064205.660416963] [sick_scan2]: MAX_ANG:    1.000 [rad]   57.296 [deg]
[sick_generic_caller-1] [INFO] [1616064205.660602918] [sick_scan2]: Sending  : sWN LMPoutputRange \x00\x01\x00\x00\x0d\x05\xff\xf7\x41\xe3\x00\x08\xbe\x1e
[sick_generic_caller-1] [INFO] [1616064205.670928968] [sick_scan2]: Receiving: <STX>sFA\x00\x04<ETX>
[sick_generic_caller-1] [INFO] [1616064205.671168257] [sick_scan2]: Error Sopas answer mismatch Error unexpected Sopas Answer for request <STX><STX><STX><STX>!sWN LMPoutputRange ApAnswer= >>>sFA\x00\x04<<<
[sick_generic_caller-1] 

The answer <STX>sFA\x00\x04<ETX> which the Lidar returns means "value range of the command exceeded". This is because the start and stop angles must be specified in the Lidar coordinate system. This is rotated against the ROS coordinate system depending on the lidar type. As shown in this figure. coordinate Systems You should take this into account when setting the angles. For example if you have an TIM 571 and want -90 to 90 ° in ros coordinate system yo need to enter

min_ang = 0.0
max_ang = 3.141 

I hope this information helps you to solve the problem.

best regards