Skip to content

Voyant-Photonics/voyant-ros

Repository files navigation

Official ROS drivers for Voyant Lidars

This ROS package provides support for Voyant sensors targeting the ROS2 Humble distribution. Configure the sensor (client) address using the config/sensor_params.yaml file. This package only supports ROS2 Humble and Ubuntu 22.04 for now, and it is not guaranteed to work with other ROS2 distributions or operating systems. Support for other distributions and operating systems will be added in the future.

For Docker instructions on other ROS2 distributions and RMW implementations, refer to the Docker Instructions section.

Supported device

  • Meadowlark: Specsheet (specsheet coming soon...)

Pre-requisites

Follow the official ROS2 documentation to install ROS2 Humble on your system.

Installation

1. Clone the repository

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone git@github.com:Voyant-Photonics/voyant-ros.git

2. Install the package dependencies

Visualization Tools

  • For Foxglove visualization, install Foxglove Studio from the official website
  • Alternatively you can also visualize the pointcloud over the Web using the Foxglove Web. Simply open the Foxglove Web and connect to the default Foxglove websocket server at ws://localhost:8765
  • Install the ROS2-Foxglove bridge:
    sudo apt install ros-humble-foxglove-*

ROS Dependencies

sudo apt install ros-humble-pcl-ros ros-humble-rviz2

Note You can also install it using the rosdep command

rosdep install --from-paths src --ignore-src -r -y

The pointcloud can also be visualized using the RViz, set use_rviz launch argument true to visualize pointcloud in RViz.

Docker Instructions

This repository also provides a Dockerfile to build a Docker image with the ROS2 Humble distribution and the Voyant ROS package. To build the Docker image, run the following command from the repo root:

docker build --build-arg "VIZ_BRIDGE=true" -t voyant_ros2_container .

The Docker image has been tested on Ubuntu 22.04 and ROS2 distributions like Humble, Iron, Rolling and Jazzy. RMW implementations like FastRTPS and CycloneDDS have been tested with the Docker image.

docker build --build-arg "VIZ_BRIDGE=true" \
             --build-arg "ROS_DISTRO=rolling" \ # humble, iron, rolling, jazzy
             --build-arg "RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" \ # rmw_fastrtps_cpp, rmw_cyclonedds_cpp
             -t voyant_ros2_container .

Note The VIZ_BRIDGE argument is optional and can be set to true to install the Foxglove bridge for visualization. The default value is false. If the argument is set to true, the Foxglove bridge will be installed. Follow the instructions from the Visualization Guide to configure Foxglove for pointcloud visualization in separate terminal or in a web browser.

To run the Docker container, execute the following command:

docker run -it --network=host voyant_ros2_container

Install Voyant API

Follow the native installation guide from the official Voyant SDK Documentation.

3. Build the package

source /opt/ros/humble/setup.bash # source ROS2 Humble
colcon build --symlink-install --packages-select voyant_ros

Running the package

1. Source the ROS2 workspace

source install/setup.bash

2. Launch the driver

ros2 launch voyant_ros sensor_launch.py

or with RViz visualization

ros2 launch voyant_ros sensor_launch.py use_rviz:=true # for rviz

Converting .bin files to ROS2 bag format

The configurations for ROS2 bag can be found in config/sensor_params.yaml file. There are two ways you can run use the conversion tool.

1. Using the binaries from colcon build

If you have already build the voyant_ros package using colcon, use the binary files as below.

cd ~/ros2_ws/build/voyant-ros
./bin/voyant_bin_to_mcap ros2_ws/src/voyant-ros/config/sensor_params.yaml # path to your params yaml file

2. Build the package using cmake

cd ~/ros2_ws/src/voyant-ros
mkdir -p build
cd build
cmake ..
make
./bin/voyant_bin_to_mcap ros2_ws/src/voyant-ros/config/sensor_params.yaml # path to your params yaml file

Converting mcap files to bin format

You can only convert MCAP files with the correct data.

At time of writing, that means you will need to record the /device_metadata field and to use point_format: 2 # MDL_EXTENDED when recording.

Build the tool:

# source ROS2 Humble
source /opt/ros/humble/setup.bash
# build with colcon
colcon build --symlink-install --packages-select voyant_ros
# Source the workspace (required for compiled VoyantDeviceMetadata.msg)
source install/setup.bash

Edit the yaml config file to pass the correct file paths.

Run the tool:

./build/voyant_ros/bin/voyant_mcap_to_bin config/mcap_to_bin_params.yaml

Configuring Foxglove for Pointcloud Visualization

The launch command will start the driver and publish pointcloud data on the /point_cloud topic. It will also open the Foxglove GUI for visualization.

  1. Click on Open connection... in the Foxglove GUI on the left panel.
  2. Connect Foxglove to the default Foxglove websocket server at ws://localhost:8765
  3. In the top right corner of the Foxglove GUI title bar, click on the Layout button and import the configuration file from config/voyant_ros_foxglove_cfg.json

This will load a layout with pointcloud data visualization, offering three different color maps. For more information on the colormap options, refer to the Foxglove Colormap Documentation.

Managing the Foxglove Layout Config

The Foxglove configuration uses a template system to keep user scripts version-controlled as separate .ts files.

Files:

  • config/foxglove_user_scripts/*.ts - Edit these scripts directly
  • config/voyant_foxglove_cfg.template.json - Edit layout, panels, and global variables here
  • config/voyant_foxglove_cfg.json (Auto-generated, do not edit) - The layout to import into Foxglove After modifying any user script or the template, regenerate the config:
python3 config/build_foxglove_config.py \
    --template config/voyant_foxglove_cfg.template.json \
    --scripts-dir config/foxglove_user_scripts \
    --output config/voyant_foxglove_cfg.json

And clean up the formatting:

pre-commit run --all-files

About

ROS drivers for Voyant Lidars

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors