EricCousineau-TRI / rules_ros2

Build ROS2 with Bazel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CI

Bazel rules for ROS2

This repo provides functionality to build and use ROS2 with Bazel.

Prerequisites

You will need to install Bazel, see here. Besides Bazel, you will need a C++ compiler and a Python 3 interpreter.

And no, you don't have to install any ROS2 packages via apt.

The code is developed and tested on Ubuntu 20.04 with Python 3.8.

What works?

Available features:

  • Building of C++ and Python nodes (rclcpp and rclpy work).
  • C/C++/Python code generation for interfaces (messages, services and actions).
  • Defining ROS2 deployments with ros2_launch Bazel macro.
  • Defining ROS2 tests with ros2_test Bazel macro.
  • Only CycloneDDS middleware can be used at the moment.
  • Utilities:
    • ros2_param for handling parameters
    • ros2_topic for handling topics

ROS2 packages are by default locked to versions from release-humble-20220523.

NOTE: Unlike ROS1 genmsg which refuses to generate code if the deps between interface targets are not set correctly, code generation for ROS2 seems to not care about this. If the deps are not correctly set, you'll only see failures during compilation of the generated code. It could be that I missed setting some flags to the code generation of ROS2 interfaces.

Please take a look at the examples folder to get started.

What's next?

The grand idea would be to get this repo at least to the level of rules_ros. In particular:

  • It has to be convenient to cross-compile a ROS2 deployment.

About

Build ROS2 with Bazel

License:Apache License 2.0


Languages

Language:Starlark 78.8%Language:Python 20.1%Language:Smarty 1.1%