|
moveit2
The MoveIt Motion Planning Framework for ROS 2.
|
This document defines how the main branch of moveit2 supports several ROS 2 distributions at the same time. It has four topics:
If a change crosses a distro boundary, follow the pattern for that case. Add a MIGRATION.md entry (§2.5).
Each distro that has not reached end of life has a long-lived branch on moveit/moveit2. The branches today are humble, jazzy, and kilted. Each branch serves apt users of its distro. Choose the source by what the user needs:
When to cut a branch: Cut the branch for a non-Rolling distro from main just before a breaking API or ABI change merges into main. Releases for that distro then come from the branch. main receives the breaking change and moves on. A distro branch receives only bug-fix backports from main and must not change the API or ABI of that distro.
When you cut a distro branch under the rule above, fork it from main. Make these changes in one bootstrap commit:
The main branch must build and pass CI on every distro in .github/workflows/ci.yaml. Handle differences in the source tree with the patterns below. Do not use per-distro branches for this.
Each conditional block under §2.1 to §2.4 needs a cleanup comment. The comment names the oldest distro that needs the block, for example "Remove when Humble goes EOL". The cleanup PR in Topic 4 removes the block when that distro reaches end of life.
Upstream links: The PR description of each PR that adds or changes a distro difference must link the upstream PR or release that causes it. Other ROS community projects use these links to find the same fix.
When a header, type, or API differs between distros, guard the code. Choose the guard in this order:
| Feature | Guard on |
|---|---|
| Header rename (for example tf2_ros or ament_index_cpp) | __has_include(<header>) |
| Behavior or signature change in tf2_ros | TF2_ROS_VERSION_GTE(...) (from <tf2_ros/version.h>). tf2 itself has no version macro. |
| Behavior or signature change in ament_index_cpp | AMENT_INDEX_CPP_VERSION_GTE(...) (from <ament_index_cpp/version.h>) |
| Behavior or signature change in rclcpp | RCLCPP_VERSION_GTE(...) (from <rclcpp/version.h>) |
| General distro change with no specific package | RCLCPP_VERSION_GTE(...), and verify the threshold (see the RCLCPP_VERSION fallback) |
Example (header change; __has_include requires C++17, the oldest standard on main, see §2.6):
Example (behavior change in tf2_ros, which provides its own version macro):
Example (behavior change in rclcpp):
Find the first release with the change (version macros only):
First release with the spin_some deprecation (rclcpp, guard RCLCPP_VERSION_GTE(30, 1, 1)):
| Release line | Current release | Has the deprecation? | Latest release without the deprecation |
|---|---|---|---|
| Humble | 16.0.21 | no | 16.0.21 |
| Jazzy | 28.1.22 | no | 28.1.22 |
| Kilted | 29.5.11 | no | 29.5.11 |
| Lyrical | 32.0.3 | yes | N/A (32.0.0 already has it) |
| Rolling-on-Noble (frozen) | 30.1.4 | yes | 30.1.0 |
| Rolling-on-Resolute | 33.2.0 | yes | 30.1.0 |
The first upstream tag with the deprecation is 30.1.1. Tag 30.1.0 does not have it. No earlier line has a backport. The guard therefore works on every line in this table.
The Rolling-on-Resolute values come from the ros2-testing suite. The main resolute suite does not publish Rolling packages as of 2026-11-15. ros_buildfarm PR #1151 would sync Rolling to main after each successful sync to testing. Re-check when main resolute lists ros-rolling-* packages. Compare versions only within one suite.
The frozen Rolling-on-Noble image has rclcpp 30.1.4, which already has the spin_some deprecation. The guard RCLCPP_VERSION_GTE(30, 1, 1) therefore selects the new path there. Confirm that this result is intended.
References: #3567, #3703, and #3705 (the wrong-package guard example).
When a package name differs by distro, use the format-3 condition= attribute. Select one <*_depend> entry for each distro.
Rules:
Reference: REP 149.
When the content of a YAML or config file differs by distro, use an override file. The default file is <pkg_share>/<path>/foo.yaml. The file <pkg_share>/<path>/foo.<distro>.yaml overrides it for that distro only.
The launch file checks whether the override exists. Do not write distro names into launch logic.
Python launch (*.launch.py):
XML launch (*.launch.xml): ROS 2 XML launch cannot check whether a file exists. Use <eval> with a Python expression.
Long-term home: moveit_configs_utils.MoveItConfigsBuilder does not apply this convention yet (checked 2026-11-14). Add it there, so every launch that uses the builder receives it.
Cleanup: When the distro that needs the override reaches end of life, remove config/foo.<distro>.yaml. No code change is needed.
When a package is renamed, use feature detection. Look for the new name first. Use the old name only when the new one is not found. Feature detection works with new distros and with downstream users that mix versions. Prefer it to $ENV{ROS_DISTRO} checks.
Use a set(GRIPPER_PKG ...) variable so the rest of the file uses the abstract name.
Use $ENV{ROS_DISTRO} only when feature detection cannot work, for example when two packages with the same name behave differently.
Every PR that adds, changes, or removes a distro-conditional code path must add a MIGRATION.md entry. This applies to §2.1 to §2.4, Topic 3, and Topic 4.
Entry format: A date-prefixed bullet under the distro section. One sentence states the change. One line gives the reason and links the upstream PR. Add a diff block when the migration is not obvious.
Review checklist: Reviewers reject a distro-conditional change that has no MIGRATION.md entry. For §2.1 guards, reviewers also check:
Cleanup: Release-note entries remain, because they are history. Remove a workaround entry together with the workaround code.
Humble and Jazzy build MoveIt as C++17. On Lyrical and Rolling, targets that link rclcpp, which is nearly all of MoveIt, build as C++20, because their rclcpp exports cxx_std_20 (ros2/ament_cmake_ros#62). Write C++17 that also builds without warnings as C++20, and do not guard on __cplusplus. Topic 4, "Removing a distro", raises the floor.
When a moveit2 dependency is released for a distro, its entry exists in rolling/distribution.yaml. If its binary is not yet in the apt repository, CI fails at rosdep install. For example, the package may exist only in ros-testing until a sync. Use §3.1 first.
CI builds these upstream dependencies from source. For each image, CI selects a .repos file:
The sed command keeps the text before the first hyphen. For IMAGE: rolling-ci, CI uses moveit2_rolling.repos. For IMAGE: lyrical-ci-testing, CI looks for moveit2_lyrical.repos. If that file does not exist, CI uses only moveit2.repos.
Rules:
Example (from the current moveit2_rolling.repos, shortened):
Use §3.2 only when §3.1 cannot work. For example, the upstream source is private, does not build, or takes too long to build in CI.
When the code can run without the dependency, use QUIET and a presence check. Pair the optional find_package with a target_compile_definitions feature flag. Source code uses the flag in #ifdef blocks.
Do not skip a subdirectory or install rule without a visible sign. Users must be able to check whether a feature exists without reading the CMake files.
Cleanup: Removing this fallback requires removing the CMake guard, the #ifdef blocks, and the MOVEIT_HAVE_* macro. Check for this at every Rolling sync.
.github/workflows/ci.yaml defines the supported distros. Every distro in that file must build and pass on main. A failing job is either non-blocking (experimental) or a bug to fix.
When REP 2000 declares a distro supported:
Earlier, #3743 added a non-blocking Rolling-on-Resolute job with continue-on-error. That pattern is no longer used on main.
A job may be non-blocking. Set continue-on-error: true and add (experimental) to its name. To make it required, remove both. Add any §3.1 entries first. As of 2026-11-14, main has no experimental job.
When Rolling moves to a new Ubuntu base, package versions can jump by several majors. A §2.1 guard can then select the wrong path. In the CI matrix PR for the new base:
Example: The Noble to Resolute change made some RCLCPP_VERSION_GTE(30, 0, 0) guards wrong. They guarded ament_index_cpp changes (see #3703 and #3705).
When a distro reaches end of life under REP 2000, open one cleanup PR that:
The matrix in ci.yaml is the only list of supported distros. Do not keep a second list.