ROS 1 Driver
ROS (Robot Operating System) is a widely used robotics middleware that offers a large amount of prebuilt tools for robotics. The base ROS tooling handles inter-process communications so connecting sensors to other software packages can be done trivially. ROS also includes extremely useful visualization, logging, and simulation tools.
multisense_ros (https://github.com/carnegierobotics/multisense_ros) is a ROS driver that can be used to connect to a multisense and publish camera data in native ROS messaging formats
All models of current, legacy, and development MultiSense stereo cameras are supported by the MultiSense ROS Driver. This includes:
MultiSense S27
MultiSense S30
MultiSense KS21
MultiSense S21
MultiSense ST21
MultiSense SL
MultiSense S7
MultiSense S7S
MultiSense Remote Head
Prerequisites
The instructions provided here have been designed and tested to work with a host installation of Ubuntu 20.04 LTS (Focal Fossa) and the ROS Noetic Ninjemys distribution.
For details on ROS installation options, please see the ROS wiki: http://wiki.ros.org/noetic/Installation/Ubuntu
Once the Noetic Ninjemys distribution has been installed, return to these instructions for installing the MultiSense ROS1 driver.
A binary driver is available to users that have installed ROS using the ROS Ubuntu repositories.
Compiling the driver from source is also supported. To do so, ensure that the dependencies required to build ROS packages are installed. See the ROS wiki directions to set up your environment for building packages: http://wiki.ros.org/noetic/Installation/Ubuntu#Dependencies_for_building_packages Following set up of the build environment, continue to Building From Source.
Binary Package
Note
The version of multisense_ros available via apt may not be the latest. For instructions on installing the latest version of multisense_ros, please Building From Source.
The multisense-ros library is available as a binary package for some ROS distros (https://index.ros.org/r/multisense_ros/github-carnegierobotics-multisense_ros).
If ROS has been installed on the host system using the ROS package repository, multisense_ros can be installed with the package manager in the same fashion.
$ sudo apt install ros-noetic-multisense
Building From Source
Building the ROS 1 MultiSense driver from source can be accomplished by executing the commands outlined below.
# define an installation location for the driver
MULTISENSE_SOURCE_DIR=~/multisense_ros1_driver
# create the directory structure
mkdir -p "${MULTISENSE_SOURCE_DIR}/src"
# navigate to the source directory in the workspace
cd "${MULTISENSE_SOURCE_DIR}/src"
# be sure to source the ROS distribution
source /opt/ros/noetic/setup.bash
# create a catkin workspace
catkin_init_workspace .
# clone the MultiSense ROS1 driver sources
git clone --recurse-submodules https://github.com/carnegierobotics/multisense_ros.git multisense
# change to the base directory of the driver install
cd "${MULTISENSE_SOURCE_DIR}"
# use rosdep to install any dependencies
rosdep install --from-paths src --ignore-src -r -y
# build the driver
catkin_make
Updating the Driver Compiled from Source
To update a driver that has been installed from source, perform the following actions.
# define the installation location
MULTISENSE_SOURCE_DIR=~/multisense_ros1_driver
# navigate to the MultiSense repository under the installation directory
cd "${MULTISENSE_SOURCE_DIR}/src/multisense"
# update the local revision of the code
git pull
# navigate to the base installation directory for MultiSense
cd "${MULTISENSE_SOURCE_DIR}"
# clean up the previous build files
rm -r build
rm -r devel
# source the ROS environment
source /opt/ros/noetic/setup.bash
# build the new driver
catkin_make
Running ROS Driver
ROS handles launching applications using launch files. Launch files are used to synchronize running many processes at once, monitoring the processes while running, and closing all processes during shutdown. Useful launch files for multisense_ros are available in the multisense_bringup package. These example launch files can be included in user launch files to launch more than one application at once
Environment Setup
To run the ROS driver, first ensure the network is set up correctly based on the networking section.
Next, source the ROS environment. If using the binary packages, this is as easy as sourcing the noetic environment script from its standard installation location.
$ source /opt/ros/noetic/setup.bash
If multisense_ros was built from source, source the setup.bash
script from
the catkin workspace that was used for the compilation of the driver. It will
be found under the devel
directory
$ source "${MULTISENSE_SOURCE_DIR}/devel/setup.bash"
Launching
To launch the driver run the following command
$ roslaunch multisense_bringup multisense.launch
It is possible to configure the IP address, MTU, and camera topic namespace using arguments to the launch file. For a complete list of available arguments and their defaults, run:
$ roslaunch multisense_bringup multisense.launch -ros-args
To modify the IP address or MTU, launch the camera using the following syntax
$ roslaunch multisense_bringup multisense.launch mtu:=<desired_mtu> ip_address:=<sensor_ip>
Viewing Camera Data with RViz
Once the multisense_ros driver is launched it will be possible to view images and 3D point cloud data using RViz.
First, start RViz
$ rosrun rviz rviz
A configuration file for RViz is provided as part multisense_bringup package. Once RViz opens, to File → Open Config. Navigate to the directory for the configuration. Its install location will vary depending on the installation method used.
For drivers installed from the binary packages the ROS Ubuntu repositories, the
default location is
/opt/ros/noetic/share/multisense_bringup/rviz_config.rviz
For driver installations loaded from source, the file can be found at
${MULTISENSE_SOURCE_DIR}/src/multisense/multisense_bringup/rviz_config.rviz
The RViz configuration file provided will load the correct configuration needed to visualize all sensors on the MultiSense.