Skip to content

Latest commit

 

History

History
272 lines (192 loc) · 9.37 KB

File metadata and controls

272 lines (192 loc) · 9.37 KB

Qb2 ROS2 driver

Overview

The main function of the Qb2 ROS2 driver is to convert the point cloud data from the Qb2 into a ROS PointCloud2 msg.

Two nodes are available:

  1. Qb2Driver: The live node connects to one Qb2 and publishes the point cloud based on the scan pattern frequency set on the device.

  2. Qb2SnapshotDriver: The snapshot node can connect to multiple Qb2s and request single frames from all connected Qb2s based on the frequency configured for the node. The driver sequentially requests the point clouds from each device and publishes all point clouds onto their respective topics simultaneously and with the same timestamp.

Supported devices

The Blickfeld Qb2 ROS2 driver supports all variants of Blickfeld Qb2 devices.

Supported ROS2 Distributions

The Blickfeld Qb2 ROS2 driver supports the following ROS2 distributions:

  • Foxy Fitzroy

  • Humble Hawksbill

Initial result

driver result 1
Figure 1. Same point cloud visualized in ROS2 rviz and the Qb2 WebGui. On the right the raw point cloud from the device is visualized and on the left the same point cloud in PointCloud2 is visualized.

Dependencies

Before proceeding, make sure to install the following dependencies on your system:

  • ROS2:

  • Diagnostic Updater: Use debian package on Ubuntu 20.04 and greater

  • Colcon: Required for building the ROS workspace

  • Protobuf: >= v3.6.1, use debian package on Ubuntu 20.04 and greater

  • gRPC: >= v1.16.1, use debian package on Ubuntu 20.04 and greater

     sudo apt update
     sudo apt install ros-${ROS_DISTRO}-diagnostic-updater libgrpc++-dev protobuf-compiler-grpc libprotobuf-dev

Build

Before proceeding with the build, ensure that you source your ROS2 distribution. ROS2 must be sourced in every shell to access ROS2 commands. Use the following command to source ROS2:

 source /opt/ros/${ROS_DISTRO}/setup.bash

Next, follow these steps to create your colcon workspace:

  1. Create the colcon workspace:

     mkdir -p ${colcon_workspace}/src

    Replace ${colcon_workspace} with your custom directory path.

  2. Move or clone the blickfeld_qb2_ros2_driver package into the {colcon_workspace}/src directory

  3. Build your workspace:

     cd ${colcon_workspace}
     colcon build --symlink-install --cmake-clean-first --packages-up-to blickfeld_qb2_ros2_driver
Important
Make sure to replace ${colcon_workspace} with your actual workspace path and follow these steps to successfully build the package.

Run

The driver can be executed through several methods:

  • Using ROS2 component CLI to integrate it into an existing container named /ComponentManager (ROS2 component).

  • Utilizing ROS2 component CLI to operate it in standalone mode (ROS2 standalone component).

  • Employing ROS2 launch CLI (ROS2 launch).

Below are examples to commence the live or snapshot nodes:

Live driver

  • ROS2 component

     ros2 component load /ComponentManager blickfeld_qb2_ros2_driver blickfeld::ros_interop::Qb2Driver -p fqdn:="qb2"
  • ROS2 standalone component

     ros2 component standalone blickfeld_qb2_ros2_driver blickfeld::ros_interop::Qb2Driver -p fqdn:="qb2"
  • ROS2 launch

     ros2 launch blickfeld_qb2_ros2_driver blickfeld_qb2_ros2_driver.launch.py

Snapshot driver

  • ROS2 component

     ros2 component load /ComponentManager blickfeld_qb2_ros2_driver blickfeld::ros_interop::Qb2SnapshotDriver -p fqdns:="[qb2-1, qb2-2]" -p fqdn_frame_ids:="[qb2-1, qb2-2]" -p fqdn_point_cloud_topics:="[/bf/points_raw_1, /bf/points_raw_2]"
  • ROS2 standalone component

     ros2 component standalone blickfeld_qb2_ros2_driver blickfeld::ros_interop::Qb2SnapshotDriver -p fqdns:="[qb2-1, qb2-2]" -p fqdn_frame_ids:="[qb2-1, qb2-2]" -p fqdn_point_cloud_topics:="[/bf/points_raw_1, /bf/points_raw_2]"
  • ROS2 launch

     ros2 launch blickfeld_qb2_ros2_driver blickfeld_qb2_ros2_snapshot_driver.launch.py

Parameters

Note
The point cloud contains cartesian coordinates represented as individual FLOAT32 values for x, y, and z.

Live driver

Important
The user is required to provide a valid address for connection, as no default value is available.
Argument Default Note

fqdn

``

Fully qualified domain name: IP-address or host name of the Qb2 device which is to publish its point cloud.

frame_id

lidar

The name of the TF frame (coordinate system) which is to be added to the point cloud message.

point_cloud_topic

/bf/points_raw

The topic for publishing the point cloud.

use_measurement_timestamp

false

Select either the device timestamp or the ROS timestamp. By default, the setting is "false," which corresponds to the ROS timestamp.

publish_intensity

true

Select to publish the intensity (photon_count) of each point in addition to the x, y, and z as UINT32 value or not. By default, the setting is "true", which corresponds to publishing the intensity value.

publish_point_id

true

Select to publish the point_id (direction_id) of each measurement in addition to the x, y, and z as UINT32 value or not. By default, the setting is "true", which corresponds to publishing the point_id.

Snapshot driver

Important
To establish a connection to the device in snapshot mode, the user must provide at least one valid 'fqdn', 'frame_id' and 'point_cloud_topic'. No default value are available for these parameters.
Important
The entry list for 'fqdns', 'fqdn_frame_ids' and 'fqdn_point_cloud_topics' should be the same size otherwise the driver will not start.
Argument Default Note

fqdns

[]

Fully qualified domain name: IP-address or host name of the Qb2 device which is to publish its point cloud.

fqdn_frame_ids

[]

The name of the TF frame (coordinate system) which is to be added to the point cloud message.

fqdn_point_cloud_topics

[]

The list of topics for publishing the point cloud of each fqdn.

snapshot_frequency

0.1

The frequency (hz) to snapshot a point cloud from the Qb2s, this value should be something between [0, 0.1]. Use 0 to disable the snapshot frequency (the service call can still be used to manually trigger a snapshot).

use_measurement_timestamp

false

Select either the device timestamp or the ROS timestamp. By default, the setting is "false," which corresponds to the ROS timestamp.

publish_intensity

true

Select to publish the intensity (photon_count) of each point in addition to the x, y, and z as UINT32 value or not. By default, the setting is "true", which corresponds to publishing the intensity value.

publish_point_id

true

Select to publish the point_id (direction_id) of each measurement in addition to the x, y, and z as UINT32 value or not. By default, the setting is "true", which corresponds to publishing the point_id.

max_retries

3

The number or retries for getting point cloud from each Qb2 in case of failure during the snapshot trigger.

Services

The snapshot driver offers a service call to manually trigger snapshots, in addition to the time based snapshots that can be configured using the 'snapshot_frequency' parameter. To manually trigger the snapshot, utilize the ROS2 service:

 ros2 service call /trigger_snapshot std_srvs/srv/Trigger

Diagnostic message

Field Note

device_fqdn

The fqdn of the Qb2.

connection_status

True if the driver is connected to the Qb2, otherwise False.

failed_connection_attempts

The number of failed connection attempts to Qb2 since the start of the driver.

connection_attempts_since_last_connection

The number of connection attempts to Qb2 since the last successful connection.

stream_status

True if the point cloud stream channel is created between the driver and the Qb2, otherwise False. The snapshot driver does not open a stream.

failed_opening_stream_attempts

The number of failed attempts to open a point cloud stream to Qb2 since the start of the driver.

opening_stream_attempts_since_last_opened_stream

The number of attempts to open a point cloud stream to Qb2 since the last successful opened stream.

last_frame_success

True if the last frame was read successfully from the Qb2, otherwise False.

last_frame_duration

The time duration for reading the last frame from the Qb2.

total_frames_published

The total number of published point cloud frames by the driver since the start.

total_frames_dropped

The total number of frames that has been dropped since the start of the driver.

total_reboots

The total number of reboots of Qb2 since the start of the driver.

License

This package is released under a BSD 3-Clause License (see also https://opensource.org/licenses/BSD-3-Clause)