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

Commit

Permalink
Support field monitoring for LMS1xx and LMS5xx
Browse files Browse the repository at this point in the history
  • Loading branch information
rostest committed Mar 4, 2021
1 parent 65391a4 commit 7e48656
Show file tree
Hide file tree
Showing 37 changed files with 164,065 additions and 144 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ The use of the parameters can be looked up in the launch files. This is also rec

- Angle compensation: For highest angle accuracy the NAV-Lidar series supports an [angle compensation mechanism](./doc/angular_compensation.md).

- The **TiM7xx** and **TiM7xxS** families have [extended settings for field monitoring](./doc/tim7xxs_extensions.md).
- **Field monitoring**: The **LMS1xx**, **LMS5xx**, **TiM7xx** and **TiM7xxS** families have [extended settings for field monitoring](./doc/field_monitoring_extensions.md).

## Sopas Mode
This driver supports both COLA-B (binary) and COLA-A (ASCII) communication with the laser scanner. Binary mode is activated by default. Since this mode generates less network traffic.
Expand Down
65 changes: 50 additions & 15 deletions doc/tim7xxs_extensions.md → doc/field_monitoring_extensions.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Extensions for TiM7xxS
# Field monitoring for LMS1xx, LMS5xx, TiM7xx and TiM7xxS

The TiM7xx and TiM7xxS families have the following extended settings for field monitoring:
The LMS1xx, LMS5xx, TiM7xx and TiM7xxS families have the following extended settings for field monitoring:

## Field monitoring messages

TiM7xx and TiM7xxS scanner support field monitoring. Fields can be configured by Sopas ET. Once they are configured, sick_scan publishes ros messages containing the monitoring information from the lidar.
LMS1xx, LMS5xx, TiM7xx and TiM7xxS scanner support field monitoring. Fields can be configured by Sopas ET. Once they are configured, sick_scan publishes ros messages containing the monitoring information from the lidar.

By default, field monitoring is enabled in the launch file [sick_tim_7xx.launch](../launch/sick_tim_7xx.launch) resp. [sick_tim_7xxS.launch](../launch/sick_tim_7xxS.launch) by following settings:
By default, field monitoring is enabled in the launch files [sick_lms_1xx.launch](../launch/sick_lms_1xx.launch), [sick_lms_5xx.launch](../launch/sick_lms_5xx.launch),
[sick_tim_7xx.launch](../launch/sick_tim_7xx.launch) resp. [sick_tim_7xxS.launch](../launch/sick_tim_7xxS.launch) by following settings:
```
<param name="activate_lferec" type="bool" value="True"/> <!-- activate field monitoring by lferec messages -->
<param name="activate_lidoutputstate" type="bool" value="True"/> <!-- activate field monitoring by lidoutputstate messages -->
Expand All @@ -26,9 +27,23 @@ rosservice call /sick_tim_7xx/ColaMsg "{request: 'sEN LIDinputstate 0'}" # deac
rosservice call /sick_tim_7xx/ColaMsg "{request: 'sRN LIDinputstate'}" # query activation status of LIDinputstate messages
```

LFErec and LIDoutputstate messages are defined in [LFErecMsg.msg](../msg/LFErecMsg.msg) and [LFErecFieldMsg.msg](../msg/LFErecFieldMsg.msg) resp. [LIDoutputstateMsg.msg](../msg/LIDoutputstateMsg.msg) and published on topics `"/sick_tim_7xxS/lferec"` resp. `"/sick_tim_7xxS/lidoutputstate"`.
LFErec and LIDoutputstate messages are defined in [LFErecMsg.msg](../msg/LFErecMsg.msg) and [LFErecFieldMsg.msg](../msg/LFErecFieldMsg.msg) resp. [LIDoutputstateMsg.msg](../msg/LIDoutputstateMsg.msg) and published on the following topics: `"/sick_tim_7xxS/lferec"` resp. `"/sick_tim_7xxS/lidoutputstate"`.

| ** Scanner ** | ** lferec topic ** | ** lidoutputstate topic ** |
|---------------|--------------------|-----------------------------|
| lms_1xx | /sick_lms_1xx/lferec | /sick_lms_1xx/lidoutputstate |
| lms_5xx | /sick_lms_5xx/lferec | /sick_lms_5xx/lidoutputstate |
| lms_7xx | /sick_tim_7xx/lferec | /sick_tim_7xx/lidoutputstate |
| lms_7xxS | /sick_tim_7xxS/lferec | /sick_tim_7xxS/lidoutputstate |

To view the field monitoring messages, run
```
rostopic echo "/sick_lms_1xx/lferec"
rostopic echo "/sick_lms_1xx/lidoutputstate"
rostopic echo "/sick_lms_5xx/lferec"
rostopic echo "/sick_lms_5xx/lidoutputstate"
rostopic echo "/sick_tim_7xx/lferec"
rostopic echo "/sick_tim_7xx/lidoutputstate"
rostopic echo "/sick_tim_7xxS/lferec"
rostopic echo "/sick_tim_7xxS/lidoutputstate"
```
Expand All @@ -54,14 +69,18 @@ and run
rosrun rviz rviz -d ./src/sick_scan/test/emulator/config/rviz_emulator_cfg.rviz
```

Otherwise you can just add visualizations of type `/cloud/PointCloud2` and `/sick_tim_7xxS/marker`:
Otherwise you can just add visualizations of type `/cloud/PointCloud2` and `/sick_tim_7xxS/marker` (resp. `/sick_tim_1xx/marker` for lms_1xx, `/sick_tim_5xx/marker` for lms_5xx and `/sick_tim_7xx/marker` for tim_7xx):

![tim7xxs_screenshot01.png](tim7xxs_screenshot01.png)

The following screenshot shows an example with 2 fields (the 3. field is not configured), the first field with status "Clear", the second with status "Infringed":
The following screenshot shows a TiM781S example with 2 fields (the 3. field is not configured), the first field with status "Clear", the second with status "Infringed":

![tim7xxs_screenshot02.png](tim7xxs_screenshot02.png)

The following screenshot shows a LMS511 example with a segmented field, two rectangular fields and a dynamic fields:

![lms511_screenshot01.png](lms511_screenshot01.png)

Note: Some combinations of rviz, OpenGL 3, VMware and graphic card drivers may cause visualization issues. In case of missing markers, try rviz with Open GL 2 using the command
```
rosrun rviz rviz -d ./src/sick_scan/test/emulator/config/rviz_emulator_cfg.rviz --opengl 210
Expand All @@ -73,7 +92,7 @@ Cola commands can be sent for diagnosis and development using the ros service Co
```
<param name="start_services" type="bool" value="True"/>
```
in the launch file [sick_tim_7xxS.launch](../launch/sick_tim_7xxS.launch). The ros service sends the given cola command to the lidar and returns its response.
in the launch file [sick_tim_7xxS.launch](../launch/sick_tim_7xxS.launch) (resp. [sick_lms_1xx.launch](../launch/sick_lms_1xx.launch), [sick_lms_5xx.launch](../launch/sick_lms_5xx.launch), [sick_tim_7xx.launch](../launch/sick_tim_7xx.launch) ). The ros service sends the given cola command to the lidar and returns its response.

Example for cola command `"sRN SCdevicestate"` and response `"sRA SCdevicestate \\x00"` with error status 0 (no error):
```
Expand All @@ -89,11 +108,11 @@ Package sick_scan implements some tools to support unittests, development and em

- pcap_json_converter to convert pcapng-files to json.

### TiM781S emulation
### LMS and TiM emulation

sick_scan_emulator implements a simple test server for cola commands. It rececives Cola-commands, returns Tim781S-like responses and sends Scandata from a json-file. Run
```
roslaunch sick_scan emulator.launch
roslaunch sick_scan emulator_01_default.launch
```
to emulate a local Tim781S device. Then start and connect the sick_scan driver by
```
Expand All @@ -102,20 +121,36 @@ roslaunch sick_scan sick_tim_7xxS.launch hostname:=127.0.0.1

Note that sick_scan_emulator just implements a simple server for offline tests. It does not emulate a lidar device completely and should only be used for development and testing.

Scandata messages are parsed from json-file(s). These json-files are configured in the launch file [emulator.launch](../test/emulator/launch/emulator.launch) and converted form wireshark-records (pcapng-files) using pcap_json_converter.py (see section Pcapng converter tool](#pcapng-converter-tool)).
Scandata messages are parsed from json-file(s). These json-files are configured in the launch file [emulator.launch](../test/emulator/launch/emulator_01_default.launch) and converted form wireshark-records (pcapng-files) using pcap_json_converter.py (see section Pcapng converter tool](#pcapng-converter-tool)).

A LMS111 device can be emulated by running
```
roslaunch sick_scan emulator_lms1xx.launch &
rosrun rviz rviz -d ./src/sick_scan/test/emulator/config/rviz_lms1xx.rviz &
roslaunch sick_scan sick_lms_1xx.launch hostname:=127.0.0.1
```

A LMS511 device can be emulated by running
```
roslaunch sick_scan emulator_lms5xx.launch &
rosrun rviz rviz -d ./src/sick_scan/test/emulator/config/rviz_lms5xx.rviz &
roslaunch sick_scan sick_lms_5xx.launch hostname:=127.0.0.1
```

### Unittests

Folder `test/emulator/scandata` contains scandata examples for unittests. To run an offline unittest for TiM781S enter the following commands:
Folder `test/emulator/scandata` contains scandata examples for unittests. To run an offline unittest for LMS111, LMS511, TiM781, TiM781S enter the following commands:
```
cd test/scripts
./run_simu_tim781s.bash
./run_simu_lms1xx.bash
./run_simu_lms5xx.bash
./run_simu_tim7xx_tim7xxS.bash
```
or start emulator, driver and rviz by running
```
source ./install/setup.bash
# Start sick_scan emulator
roslaunch sick_scan emulator.launch &
roslaunch sick_scan emulator_01_default.launch &
sleep 1
# Start rviz
rosrun rviz rviz -d ./src/sick_scan/test/emulator/config/rviz_emulator_cfg.rviz --opengl 210 &
Expand All @@ -133,4 +168,4 @@ The pcapng converter tool [pcap_json_converter.py](../test/pcap_json_converter/p
3. Capture the network traffic for some time.
4. Stop capturing and save the network traffic in a pcapng-file.
5. Convert the pcapng-file to json by `python pcap_json_converter.py --pcap_filename=<filepath>.pcapng`. Result is a jsonfile `<filepath>.pcapng.json`
6. Set the resulting json-file in the emulator configuration [emulator.launch](../test/emulator/launch/emulator.launch) by `<arg name="scandatafiles" default="<filepath>.pcapng.json"/>`
6. Set the resulting json-file in the emulator configuration [emulator.launch](../test/emulator/launch/emulator_01_default.launch) by `<arg name="scandatafiles" default="<filepath>.pcapng.json"/>`
Binary file added doc/lms511_screenshot01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7e48656

Please sign in to comment.