Skip to content

Commit 607108f

Browse files
committed
v5.5.2: Support for message type 7, improved source id and documentation
* Support for message type 7 * Configuration and support for message specific source ID * Improved transform messages * Improved documentation * Renaming and cleanup
1 parent 19afec1 commit 607108f

File tree

88 files changed

+1445
-1322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1445
-1322
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ doc/20210726_rest_api_test.pptx
5252
doc/*_lidar_localization2.pptx
5353

5454
test/scripts/wireshark.cmd
55+
test/rest_server/python/scripts_LLS1-OdometryUDPSender.py
56+
test/rest_server/python/scripts_LLS2-OdometryUDPSender.py
5557

5658
test/data/wireshark/20210727_*.*
5759
test/data/wireshark/20210921-*.*

CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,24 +116,24 @@ add_executable(gen_service_call src/gen_service_call.cpp)
116116
target_link_libraries(gen_service_call sick_localization_lib ${CURL_LIBRARIES} jsoncpp_lib ${catkin_LIBRARIES})
117117

118118
if(ROS_VERSION GREATER 0)
119-
add_executable(pointcloud_converter src/pointcloud_converter.cpp src/pointcloud_converter_thread.cpp)
120-
target_link_libraries(pointcloud_converter sick_localization_lib ${CURL_LIBRARIES} jsoncpp_lib ${catkin_LIBRARIES})
119+
add_executable(lls_transform src/lls_transform.cpp src/lls_transform_thread.cpp)
120+
target_link_libraries(lls_transform sick_localization_lib ${CURL_LIBRARIES} jsoncpp_lib ${catkin_LIBRARIES})
121121
endif()
122122

123123
if(ROS_VERSION EQUAL 1)
124124
add_dependencies(sick_localization_lib ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
125125
add_dependencies(sick_lidar_localization_main sick_localization_lib ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
126-
add_dependencies(pointcloud_converter sick_localization_lib ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
126+
add_dependencies(lls_transform sick_localization_lib ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
127127
elseif(ROS_VERSION EQUAL 2)
128128
ament_target_dependencies(sick_localization_lib rclcpp geometry_msgs nav_msgs sensor_msgs std_msgs tf2_ros visualization_msgs)
129-
ament_target_dependencies(pointcloud_converter rclcpp geometry_msgs nav_msgs sensor_msgs std_msgs tf2_ros visualization_msgs)
129+
ament_target_dependencies(lls_transform rclcpp geometry_msgs nav_msgs sensor_msgs std_msgs tf2_ros visualization_msgs)
130130
if(ROS2_HUMBLE) # rosidl_typesupport for ROS2 humble or later
131131
rosidl_get_typesupport_target(cpp_typesupport_target ${PROJECT_NAME} "rosidl_typesupport_cpp")
132132
target_link_libraries(sick_localization_lib "${cpp_typesupport_target}")
133-
target_link_libraries(pointcloud_converter "${cpp_typesupport_target}")
133+
target_link_libraries(lls_transform "${cpp_typesupport_target}")
134134
else()
135135
rosidl_target_interfaces(sick_localization_lib ${PROJECT_NAME} "rosidl_typesupport_cpp")
136-
rosidl_target_interfaces(pointcloud_converter ${PROJECT_NAME} "rosidl_typesupport_cpp")
136+
rosidl_target_interfaces(lls_transform ${PROJECT_NAME} "rosidl_typesupport_cpp")
137137
endif()
138138
else()
139139
add_dependencies(sick_lidar_localization_main sick_localization_lib)
@@ -144,16 +144,16 @@ endif()
144144
#############
145145

146146
if(ROS_VERSION EQUAL 1)
147-
install(TARGETS sick_localization_lib sick_lidar_localization_main gen_service_call pointcloud_converter ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
147+
install(TARGETS sick_localization_lib sick_lidar_localization_main gen_service_call lls_transform ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
148148
install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} FILES_MATCHING PATTERN "*.h*")
149149
install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
150150
elseif(ROS_VERSION EQUAL 2)
151151
ament_export_dependencies(sick_localization_lib rclcpp geometry_msgs nav_msgs sensor_msgs std_msgs tf2_ros)
152152
ament_export_include_directories(include/${PROJECT_NAME}/)
153153
ament_export_libraries(sick_localization_lib sick_lidar_localization_main)
154154
ament_package()
155-
# install(TARGETS sick_localization_lib sick_lidar_localization_main gen_service_call pointcloud_converter DESTINATION lib)
156-
install(TARGETS sick_localization_lib sick_lidar_localization_main gen_service_call pointcloud_converter DESTINATION lib/${PROJECT_NAME})
155+
# install(TARGETS sick_localization_lib sick_lidar_localization_main gen_service_call lls_transform DESTINATION lib)
156+
install(TARGETS sick_localization_lib sick_lidar_localization_main gen_service_call lls_transform DESTINATION lib/${PROJECT_NAME})
157157
install(DIRECTORY launch DESTINATION share/${PROJECT_NAME})
158158
else()
159159
install(DIRECTORY launch DESTINATION ${CMAKE_BINARY_DIR})

README.md

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The drivers support the following ROS versions in the same source:
1515
## Specification
1616

1717
The customer requirements and the REST API specification for the implementation of the project:
18-
-[specification](doc/specifications/README.md)
18+
[specification](doc/specifications/README.md)
1919

2020
## Build on native Linux
2121

@@ -210,8 +210,8 @@ Common parameters are:
210210
|--------------------|-------------------|--------------------|-------------|-----------------|
211211
| hostname | 192.168.0.1 | string | hostname:=192.168.0.1 | IP address of the SIM localization controller |
212212
| verbose | 0 | int | verbose:=1 | Print informational messages (verbose>0, otherwise error messages only) |
213-
| udp_ip_sim_output | "" | string | udp_ip_sim_output:=192.168.0.100 | IP address of your local machine (i.e. the receiver of UDP stream messages) |
214-
| udp_ip_sim_input | 192.168.0.1 | string | udp_ip_sim_input:=192.168.0.1 | IP address of host to send input UDP messages to, should be identical to hostname (except for unittests) |
213+
| udp_ip_lls_output | "" | string | udp_ip_lls_output:=192.168.0.100 | IP address of your local machine (i.e. the receiver of UDP stream messages) |
214+
| udp_ip_lls_input | 192.168.0.1 | string | udp_ip_lls_input:=192.168.0.1 | IP address of host to send input UDP messages to, should be identical to hostname (except for unittests) |
215215
216216
## REST API services
217217
@@ -234,32 +234,36 @@ UDP stream output messages are:
234234
* [Localization result messages type 5 version 2](msg/LocalizationControllerResultMessage0502.msg)
235235
236236
UDP stream input messages are:
237-
* [Odometry messages type 1 version 1](msg/OdometryMessage0101.msg)
238237
* [Odometry messages type 1 version 4](msg/OdometryMessage0104.msg)
239238
* [Odometry messages type 1 version 5](msg/OdometryMessage0105.msg)
240239
* [Encoder measurement messages type 2 version 2](msg/EncoderMeasurementMessage0202.msg)
241240
* [Code measurement messages type 3 version 3](msg/CodeMeasurementMessage0303.msg)
241+
* [Code measurement messages type 7 version 1](msg/CodeMeasurementMessage0701.msg)
242242
* [Line measurement messages type 4 version 3](msg/LineMeasurementMessage0403.msg)
243243
* [Line measurement messages type 4 version 4](msg/LineMeasurementMessage0404.msg)
244244
245-
See [UDP stream messages](doc/sim_messages.md) for details and examples.
245+
See [UDP stream messages](doc/lls_messages.md) for details and examples.
246246
247247
## Timestamps and time synchronization
248248
249249
The localization timestamps in UDP output messages are converted to system time using a Software-PLL. See [Time synchronization](doc/timing.md) and [Software-PLL](doc/software_pll.md) for details.
250250
251+
## System setup and source Ids
252+
253+
See [System setup and source Ids](doc/source_id.md) for further information about source Ids and their configuration.
254+
251255
## Tools and unittests
252256
253257
### Visualization of localization results
254258
255-
Localization results (i.e. the sensor position and orientation) can be visualized on ROS using pointcloud_convert. The tool converts Localization result messages and publishes the sensor pose and transform. Run pointcloud_converter and rviz, then add topic `/cloud/PointCloud2` and display type `TF`.
259+
Localization results (i.e. the sensor position and orientation) can be visualized on ROS using lls_transform. The tool converts localization result messages and publishes the sensor pose and transform. Run lls_transform and rviz, then add display type `TF`.
256260
257261
ROS-1 usage example:
258262
259263
```
260264
source ./install/setup.bash
261265
roslaunch sick_lidar_localization sick_lidar_localization.launch &
262-
sleep 3 ; roslaunch sick_lidar_localization pointcloud_converter.launch &
266+
sleep 3 ; roslaunch sick_lidar_localization lls_transform.launch &
263267
sleep 3 ; rosrun rviz rviz -d ./src/sick_lidar_localization/test/config/rviz_sick_lidar_localization_pointcloud.rviz
264268
```
265269
@@ -268,13 +272,29 @@ ROS-2 usage example:
268272
```
269273
source ./install/setup.bash
270274
ros2 run sick_lidar_localization sick_lidar_localization ./src/sick_lidar_localization/launch/sick_lidar_localization.launch &
271-
sleep 3 ; ros2 run sick_lidar_localization pointcloud_converter ./src/sick_lidar_localization/launch/pointcloud_converter.launch &
275+
sleep 3 ; ros2 run sick_lidar_localization lls_transform ./src/sick_lidar_localization/launch/lls_transform.launch &
272276
sleep 3 ; rviz2 -d ./src/sick_lidar_localization//test/config/rviz2_sick_lidar_localization_pointcloud.rviz2
273277
```
274278
275-
The following screenshot shows an example of the sensor pose with the sensor transform and 4 points in "cloud" coordinates:
279+
The following screenshot shows an example of the sensor pose:
280+
281+
![rviz_pointcloud_converter_screenshot](doc/screenshots/rviz_pointcloud_converter_screenshot2.png)
282+
283+
Poses are published by ROS-transform-messages (TF) of tType geometry_msgs::TransformStamped. Each TF message has a parent and a child coordinate system identified by tf_parent_frame_id resp. tf_child_frame_id. These frame ids are configured in the launchfile, by default:
284+
* tf_parent_frame_id: "map"
285+
* tf_child_frame_id: "lls"
286+
287+
The default frame ids for transformations should only be used as an example. In a real application, the reference to the robot is usually specified here, as it is, for example, in the ROS Nagivation stack. Here one would then use the reference
288+
* tf_parent_frame_id: "base_link"
289+
* tf_child_frame_id: "lls"
276290
277-
![rviz_pointcloud_converter_screenshot](doc/screenshots/rviz_pointcloud_converter_screenshot1.png)
291+
Frame ids are normally customized according to the application resp. setup
292+
* tf_parent_frame_id: "map" is used by rviz by default
293+
* tf_parent_frame_id: "base_link" is often used in examples
294+
295+
Other frame ids can be e.g. "robot", "vehicle" or "lidar". Choose parameter tf_parent_frame_id and tf_child_frame_id to match the target setup!
296+
297+
See https://roboticsknowledgebase.com/wiki/state-estimation/ros-navigation/ for further examples.
278298
279299
### Unittests
280300
@@ -319,6 +339,12 @@ Open sick_lidar_localization.sln in build folder and rebuild (debug version)
319339
See [Quickstart-Setup-SOPASair.md](doc/Quickstart-Setup-SOPASair.md) for a quickstart.
320340
Find detailed information in the operation manuals published on https://supportportal.sick.com/products/localization/lidar-localization/lidar-loc/ .
321341
342+
### Source Ids
343+
344+
:question: What are source Ids and how should I configure them?
345+
346+
:white_check_mark: See [System setup and source Ids](doc/source_id.md) for further information about source Ids and their configuration.
347+
322348
### Test and diagnosis
323349
324350
:question: How can I activate informational messages for tests and diagnosis?
@@ -335,7 +361,7 @@ Find detailed information in the operation manuals published on https://supportp
335361
336362
:white_check_mark: sick_rest_server.py requires python3 and flask. Install flask with `pip install flask` (on Linux, use `pip3 install flask`)
337363
338-
:question: `ModuleNotFoundError: No module named pcapng` when running sim_pcapng_player.py
364+
:question: `ModuleNotFoundError: No module named pcapng` when running lls_pcapng_player.py
339365
340366
:white_check_mark: sick_rest_server.py requires python3 with modules scapy, pypcapfile and python-pcapng. Install with `pip` (resp `pip3` on Linux):
341367
```

doc/cpp_api.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,41 +32,56 @@ int main(int argc, char** argv)
3232
sick_lidar_localization::UDPMessage::OdometryPayload0105 odometry0105;
3333
sick_lidar_localization::UDPMessage::EncoderMeasurementPayload0202 encoder_measurement0202;
3434
sick_lidar_localization::UDPMessage::CodeMeasurementPayload0303 code_measurement0303;
35+
sick_lidar_localization::UDPMessage::CodeMeasurementPayload0701 code_measurement0701;
3536
sick_lidar_localization::UDPMessage::LineMeasurementPayload0403 line_measurement0403;
3637
sick_lidar_localization::UDPMessage::LineMeasurementPayload0404 line_measurement0404;
3738
odometry0104.telegram_count = 1000001;
3839
odometry0104.timestamp = 123456789;
40+
odometry0104.source_id = 0;
3941
odometry0104.x_velocity = -1234;
4042
odometry0104.y_velocity = -1234;
4143
odometry0104.angular_velocity = 1234;
4244
odometry0105.telegram_count = 1000002;
4345
odometry0105.timestamp = 123456780;
46+
odometry0105.source_id = 0;
4447
odometry0105.x_position = -1234;
4548
odometry0105.y_position = -1234;
4649
odometry0105.heading = 1234;
4750
encoder_measurement0202.telegram_count = 1000003;
4851
encoder_measurement0202.timestamp = 123456781;
52+
encoder_measurement0202.source_id = 0;
4953
encoder_measurement0202.encoder_value = 123456789;
5054
code_measurement0303.telegram_count = 1000004;
5155
code_measurement0303.timestamp = 123456782;
56+
code_measurement0303.source_id = 0;
5257
code_measurement0303.code = 1234;
58+
code_measurement0701.telegram_count = 1000004;
59+
code_measurement0701.timestamp = 123456782;
60+
code_measurement0701.source_id = 0;
61+
code_measurement0701.code = "1234";
62+
code_measurement0701.x_position = -1234;
63+
code_measurement0701.y_position = -1234;
64+
code_measurement0701.heading = 1234;
5365
line_measurement0403.telegram_count = 1000005;
5466
line_measurement0403.timestamp = 123456783;
67+
line_measurement0403.source_id = 0;
5568
line_measurement0403.num_lanes = 1;
5669
line_measurement0403.lanes.push_back(1234);
5770
line_measurement0404.telegram_count = 1000006;
5871
line_measurement0404.timestamp = 123456784;
72+
line_measurement0404.source_id = 0;
5973
line_measurement0404.lcp1 = 12;
6074
line_measurement0404.lcp2 = 34;
6175
line_measurement0404.lcp3 = 56;
6276
line_measurement0404.cnt_lpc = 78;
6377
line_measurement0404.reserved = 0;
64-
if (!lidar_loc_api.sendUDPMessage(odometry0104, false, false, 1)
65-
|| !lidar_loc_api.sendUDPMessage(odometry0105, false, false, 1)
66-
|| !lidar_loc_api.sendUDPMessage(encoder_measurement0202, false, false, 1)
67-
|| !lidar_loc_api.sendUDPMessage(code_measurement0303, false, false, 1)
68-
|| !lidar_loc_api.sendUDPMessage(line_measurement0403, false, false, 1)
69-
|| !lidar_loc_api.sendUDPMessage(line_measurement0404, false, false, 1))
78+
if (!lidar_loc_api.sendUDPMessage(odometry0104, false, false)
79+
|| !lidar_loc_api.sendUDPMessage(odometry0105, false, false)
80+
|| !lidar_loc_api.sendUDPMessage(encoder_measurement0202, false, false)
81+
|| !lidar_loc_api.sendUDPMessage(code_measurement0303, false, false)
82+
|| !lidar_loc_api.sendUDPMessage(code_measurement0701, false, false)
83+
|| !lidar_loc_api.sendUDPMessage(line_measurement0403, false, false)
84+
|| !lidar_loc_api.sendUDPMessage(line_measurement0404, false, false))
7085
{
7186
ROS_ERROR_STREAM("## ERROR sick_lidar_localization: UDPSender::sendUDPPayload() failed");
7287
}

0 commit comments

Comments
 (0)