SICKAG / sick_scan_xd

A versatile driver for a wide range of SICK LiDAR and RADAR devices, providing support for both Linux (native, ROS 1, ROS 2) and Windows (native, ROS 2) platforms.
Apache License 2.0
111 stars 85 forks source link

Question: how to change fieldset #394

Open akashjinandra opened 1 month ago

akashjinandra commented 1 month ago

Hello, I am using ROS 1 Noetic, Ubuntu 20 and SIck Tim 781, I am wondering how to change the fieldset. It looks like in RVIZ it defaults to 1 image However when i didn't see explicit instructions on what to send in order to change the fieldset. After digging around it seems like maybe with the ColaMsg service request it may be possible. But looking calling the service with this: rosservice call /sick_tim_7xx/ColaMsg "{request: 'sRA LIDinputstate 2'}" However I get an error saying there is a mismatch: image

rostest commented 1 month ago

Thank you for your feedback. Use SOPAS ET to configure the fields and fieldset. We will take a closer look at the LIDinputstate telegrams.

akashjinandra commented 1 month ago

Hello and thank you for your response. In the SOPAS ET, it shows an option to change the fieldset either through a digital input or via a SOPAS telegram. See this image: image

Therefore I think through the ColaMsg I think it should be possible, I just don't know enough about the syntax of the telegram to send the fieldset change.

akashjinandra commented 1 month ago

when looking at the manual, it shows this: image All the sRN commands seem to work, but none of the sWN commands work, we get an error: image And then the service call hangs. and the program will not accept anymore service calls.

rostest commented 1 month ago

Thanks for more information. The sick_scan_xd driver currently supports only the default fieldset selection mode, i.e. setting the active fieldset via digital inputs (FieldSetSelectionMethod=0). LIDinputstate telegrams are received by sick_scan_xd to monitor and update the active fieldset, but they are currently not published.

The next release will improve the field evaluation for TiM7xx and TiM7xxS lidars:

The next release is scheduled for publication within this month.

akashjinandra commented 1 month ago

Thanks for more information. The sick_scan_xd driver currently supports only the default fieldset selection mode, i.e. setting the active fieldset via digital inputs (FieldSetSelectionMethod=0). LIDinputstate telegrams are received by sick_scan_xd to monitor and update the active fieldset, but they are currently not published.

The next release will improve the field evaluation for TiM7xx and TiM7xxS lidars:

  • LIDinputstate telegrams will be published as ROS messages in topic /sick_tim_7xx/lidinputstate.
  • FieldSetSelectionMethod and ActiveFieldSet options can be set in the launch file. By default the active field set can be set by digital inputs (FieldSetSelectionMethod=0). With the new option (FieldSetSelectionMethod=1) the active fieldset can be configured directly in the launchfile. Refer to the TiM 781 user manual and the telegram listing for full details of the fieldset options. Make sure that the latest firmware is installed on your lidar to use these options.

The next release is scheduled for publication within this month.

Hello, thank you for your reply. As you can see from my screenshot, the FieldSetSelection Method is already set to 1, I configured this through the SOPAS ET. image I also already posted a screenshot of the TiM 781 User Manual in my posting, showing the commands, however in my screenshot, it did not work, when I literally copy and pasted the command. image

rostest commented 1 month ago

Thanks for your reply. The upcoming release 3.6 will add two ros services to read and write the FieldSetSelectionMethod and ActiveFieldSet options. Please use the new services to read or change the fieldset configuration.

Example call for ROS1:

rosservice call /sick_tim_7xx/FieldSetRead "{}" # returns field_set_selection_method and active_field_set
rosservice call /sick_tim_7xx/FieldSetWrite "{field_set_selection_method_in: -1, active_field_set_in: 1}" # write active_field_set

Example call for ROS2:

ros2 service call /FieldSetRead sick_scan_xd/srv/FieldSetReadSrv "{}" # returns field_set_selection_method and active_field_set
ros2 service call /FieldSetWrite sick_scan_xd/srv/FieldSetWriteSrv "{field_set_selection_method_in: -1, active_field_set_in: 1}" # write active_field_set

Parameter summary:

Initial values for field_set_selection_method and active_field_set can be configured in the launch file, e.g.:

<param name="active_field_set" type="int" value="-1"/> <!-- set ActiveFieldSet at startup: -1 = do not set (default), index of active field otherwise -->
<param name="field_set_selection_method" type="int" value="-1"/> <!-- set FieldSetSelectionMethod at startup: -1 = do not set (default), 0 = active field selection by digital inputs, 1 = active field selection by telegram -->

These options will be supported in the next sick_scan_xd release 3.6.

akashjinandra commented 1 month ago

Hello and thank you for your reply. This should solve my problem, I would be willing to beta test the feature for you as well if you need any help.

akashjinandra commented 1 month ago

Thanks for your reply. The upcoming release 3.6 will add two ros services to read and write the FieldSetSelectionMethod and ActiveFieldSet options. Please use the new services to read or change the fieldset configuration.

Example call for ROS1:

rosservice call /sick_tim_7xx/FieldSetRead "{}" # returns field_set_selection_method and active_field_set
rosservice call /sick_tim_7xx/FieldSetWrite "{field_set_selection_method_in: -1, active_field_set_in: 1}" # write active_field_set

Example call for ROS2:

ros2 service call /FieldSetRead sick_scan_xd/srv/FieldSetReadSrv "{}" # returns field_set_selection_method and active_field_set
ros2 service call /FieldSetWrite sick_scan_xd/srv/FieldSetWriteSrv "{field_set_selection_method_in: -1, active_field_set_in: 1}" # write active_field_set

Parameter summary:

  • Parameter active_field_set < 0: do not overwrite, active_field_set > 0: index of active field otherwise (see operation manual for details about ActiveFieldSet telegram)
  • Parameter field_set_selection_method < 0: do not overwrite, field_set_selection_method = 0: active field selection by digital inputs, field_set_selection_method = 1: active field selection by telegram

Initial values for field_set_selection_method and active_field_set can be configured in the launch file, e.g.:

<param name="active_field_set" type="int" value="-1"/> <!-- set ActiveFieldSet at startup: -1 = do not set (default), index of active field otherwise -->
<param name="field_set_selection_method" type="int" value="-1"/> <!-- set FieldSetSelectionMethod at startup: -1 = do not set (default), 0 = active field selection by digital inputs, 1 = active field selection by telegram -->

These options will be supported in the next sick_scan_xd release 3.6.

In version 3.6.0, this seems to be working for me correctly. However it only works if I put the "-1" for the fieldset selection method. If I put "1" in the fieldset selection method it throws the same error as before "14 byte message ignored"

rostest commented 1 month ago

Thanks for your feedback. Configuring the FieldSetSelectionMethod requires leaving and restarting the operation mode. We have added the corresponding SOPAS telegrams in the ros service. Please use the update in branch feature/issue_update_2412xx and rebuild.

akashjinandra commented 3 weeks ago

This feature is working for me on that branch you specified, but I will keep the issue open until it is merged into the next version, perhaps 3.6.1?