This example uses the ament_cmake
build system and colcon
command line tool, as
used by the Robot Operating System (ROS) 2, with an installed instance of the
Drake binary packages.
To use ament_cmake
and colon
from the ROS 2 Dashing package archive, install
the required packages and configure your environment as follows:
sudo ../scripts/setup/linux/ubuntu/bionic/install_prereqs --ros-dashing
source /opt/ros/dashing/setup.bash
To build the drake_ament_cmake_installed
library:
colon build --cmake-args "-DCMAKE_PREFIX_PATH=/path/to/drake;$CMAKE_PREFIX_PATH"
If the Drake binary package is installed to /opt/drake
, you may omit the
--cmake-args <args>
argument.
To build and run the drake_ament_cmake_installed
test executable:
colon test