# Blickfeld ROS2 package
This package provides a ROS2 node for publishing PointCloud2 messages from Blickfeld LiDAR devices.
It also works with RTI Connext.
A launch with yaml parameterization also works in principle. However, for this package, the use of `ros2 launch` is still
experimental with ROS2 Eloquent and therefore may not work, or only partially.
## Supported devices
The Blickfeld ROS2 driver supports all currently available Blickfeld LiDARs such as Cube 1 and Cube Range 1.
## Dependencies
To install the Blickfeld ROS2 driver, please make sure the following dependencies are installed on your system.
* [blickfeld-scanner-library (BSL)](https://docs.blickfeld.com/cube/latest/external/blickfeld-scanner-lib/install.html) with system-wide protobuf installation.
* [diagnostic_updater](https://index.ros.org/p/diagnostic_updater/) can be acquired via your distribution's package manager, or via
$ rosdep update
$ rosdep install --from-paths src --ignore-src -r -y
## Build
$ colcon build --symlink-install --cmake-clean-first
If compiling with RTI Connext yields a CMake warning, please recompile without cleaning the build space beforehand.
## Running the Blickfeld ROS node
The typical way to start the Blickfeld driver is as following:
$ ros2 run blickfeld_driver blickfeld_node --ros-args -p host:=cube-0056 --remap __node:=bf_lidar
You can also start it with more parameters, e.g.:
$ ros2 run blickfeld_driver blickfeld_node --ros-args -p host:=cube-0056 -p publish_ambient_light:=true -p publish_intensities:=false
If you prefer a similar way to **launch**, like you would in ROS(1) (beware of the new ".xml"), you can start the driver like this:
$ ros2 launch -a blickfeld_driver live_scanner.launch.xml host:=cube-0056
Or if you prefer to put the parameters into a yaml:
$ ros2 launch blickfeld_driver live_scanner_yaml.launch.py
This then uses a parameter yaml in the config directory.
### Parameters
All the following parameters are available in launch _and_ run:
| Argument | Note | Default |
| ------ | ------ | ------ |
| **host** (required) | The host name or the IP of the device you want to publish the point clouds from, e.g., `cube-0028`. | |
| node_name | Name of this ROS node. | `bf_lidar` |
| point_cloud_out | Topic to publish the PointCloud2 message to. | `$(var node_name)/points_raw` |
| remap | Remap this node’s input/output topics to commonly used ones.
If `false`, canonical names in the form of `$(var node_name)/foo_(in/out)` are used, depending on whether a topic is an input or an output topic. | `true` |
| lidar_frame_id | The ROS TF where the point cloud should be in. | `lidar` |
| rviz | Start rviz if this argument is true. | `false` |
| use_lidar_timestamp | Set to true if the timestamp in the ROS point cloud message should be generated from the device timestamp; otherwise the timestamp will be the ROS time when the frame was received on ROS. | `true` |
| publish_intensities | Set to true if the PointCloud2 message should contain intensities. | `true` |
| publish_ambient_light | Set to true if the PointCloud2 message should contain the ambient light level. | `false` |
| publish_explicit_range | Set to true if the PointCloud2 message should contain the `range` field. | `false` |
| publish_no_return_points | Set to true if the PointCloud2 message should contain points in a given range for pulses without a return. | `false` |
| no_return_point_range | Dummy range for points of pulses without a return. | `1.0` |
| publish_all_returns | Set to true to publish all the returns for every point. Adds the field `return_id` (ID for each returned point) to the point cloud. | `false` |
| publish_time_delta | If `true`, the PointCloud2 message will contain the timestamp field per point to represent the time offset from the start of the frame. | `false` |
| publish_point_id | Add the `scanline_id` field, the `scanline_point_index` field (= the point’s number in the scan line), and the `point_id` (= frame-global point ID) to PointCloud2 message.
If the device is configured to return multiple return points (multiple reflections), all these three IDs will be identical; only the `return_id` will differ. | `false` |
### Debugging
Add '__log_level:=debug' to see details:
$ ros2 run blickfeld_driver blickfeld_node --ros-args --remap __node:=bf_lidar -p host:=cube-0056 -p publish_ambient_light:=true -p publish_no_return_points:=true __log_level:=debug
#### ROS2 message content
To look at the ROS message sent by this ROS node, you can use
$ debugging_tools/ros2-topic-echoparsed.py
It shows all the fields present in the message.
## License
This package is released under a [BSD 3-Clause License](LICENSE) (see also [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause))