SICKAG / sick_safetyscanners

ROS driver for SICK safety laser scanners
https://www.sick.com/de/en/opto-electronic-protective-devices/safety-laser-scanners/c/g187225
Apache License 2.0
61 stars 59 forks source link

How to view protective fields #14

Closed Aradan2 closed 5 years ago

Aradan2 commented 5 years ago

Hello,

I am currently using a microscan3 pro. I am able to get data from the scanner and display it using rviz. It looks like this: new I am now wondering, if it's possible, to also get protective fields, that are previously defined in the scanner via sick-safetydesigner, and show them together with the measurement-data i already get, in one rviz display.

Thanks in advance for any suggestion.

Best regards

lenpuc commented 5 years ago

Hi, this is not directly possible in rviz. Since the protective fields are returned by a service call (~/field_data) since they are not continuously streamed. You will get the field dimensions and the monitoring cases they belong to. Together with the extended laserscan message you can deduct the currently active fields and if they are breached. You would need to write your own visualization at the moment. The driver will give you all the necessary information. You would get the field data once at the beginning and then subscribe to the extended laser scan.

Aradan2 commented 5 years ago

Thank you for your advice! Is there also a way to get the refercence contour fields? In the FieldData.h i only can find protective fields and warning fields. And the FieldData.srv uses FieldMsg, which only contains a bool whether it is a protective field or not... So what would i have to call, to get information about the reference contour fields? Sorry if this is a stupid question, but I'm an absolutly newbie to ROS.

lenpuc commented 5 years ago

Hi Aradan2, the contour fields are not yet properly implemented. The index 0 of the returned fields is reserved for the contour data. You can find the parsing part in src/SickSafetyScanners.cpp -> SickSafetyscanners::requestFieldDataInColaSession(std::vector& fields). If contour data is present it will be passed to the ros message as is, but it will not be explicitly labelled that it is contour data. Feel free to have a look into it and if you have implemented something you are welcome to make a merge request.