Skip to content

Commit

Permalink
Merge branch 'main' into pr-iron_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
henningkayser authored Feb 27, 2024
2 parents af978d9 + 5887eb0 commit 581589f
Show file tree
Hide file tree
Showing 708 changed files with 15,519 additions and 18,008 deletions.
10 changes: 9 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ Checks: '-*,
modernize-make-unique,
modernize-avoid-bind,
misc-unused-parameters,
readability-braces-around-statements,
readability-braces-around-statements,
readability-named-parameter,
readability-redundant-smartptr-get,
readability-redundant-string-cstr,
readability-simplify-boolean-expr,
readability-container-size-empty,
readability-identifier-naming,
readability-static-definition-in-anonymous-namespace,
'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
Expand All @@ -37,6 +38,9 @@ CheckOptions:
value: CamelCase
- key: readability-identifier-naming.UnionCase
value: CamelCase
# function names
- key: readability-identifier-naming.FunctionCase
value: camelBack
# method names
- key: readability-identifier-naming.MethodCase
value: camelBack
Expand All @@ -50,8 +54,12 @@ CheckOptions:
# const static or global variables are UPPER_CASE
- key: readability-identifier-naming.EnumConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.StaticVariableCasePrefix
value: 's_'
- key: readability-identifier-naming.StaticConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.ClassConstantCase
value: UPPER_CASE
...
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
!moveit_planners/ompl/package.xml
!moveit_planners/chomp/chomp_motion_planner/package.xml
!moveit_planners/chomp/chomp_interface/package.xml
!moveit_planners/chomp/chomp_optimizer_adapter/package.xml
!moveit_planners/pilz_industrial_motion_planner_testutils/package.xml
!moveit_planners/pilz_industrial_motion_planner/package.xml
!moveit_planners/moveit_planners/package.xml
!moveit_planners/trajopt/package.xml
!moveit_runtime/package.xml
!moveit/package.xml
!moveit_ros/warehouse/package.xml
Expand Down
2 changes: 0 additions & 2 deletions .github/CODEOWNERS.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@

/moveit_planners/ompl/ @BryceStevenWilley @mamoll
/moveit_planners/chomp/chomp_interface/ @raghavendersahdev @knorth55 @bmagyar
/moveit_planners/chomp/chomp_optimizer_adapter/ @raghavendersahdev @knorth55 @bmagyar
/moveit_planners/chomp/chomp_motion_planner/ @raghavendersahdev @knorth55 @bmagyar
/moveit_planners/trajopt @ommmid @mamoll
/moveit_planners/pilz_industrial_motion_planner @jschleicher @ct2034
/moveit_planners/pilz_industrial_motion_planner_testutils/ @jschleicher @ct2034
13 changes: 8 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,32 +101,35 @@ jobs:
with:
file: moveit2.repos
- name: Cache upstream workspace
uses: pat-s/always-upload-cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.BASEDIR }}/upstream_ws
key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
restore-keys: ${{ env.CACHE_PREFIX }}
save-always: true
env:
CACHE_PREFIX: ${{ steps.rosdistro_release_date.outputs.date }}-upstream_ws-${{ steps.repos_edit_timestamp.outputs.timestamp }}-${{ matrix.env.IMAGE }}-${{ hashFiles('moveit2*.repos', '.github/workflows/ci.yaml') }}
# The target directory cache doesn't include the source directory because
# that comes from the checkout. See "prepare target_ws for cache" task below
- name: Cache target workspace
if: "!matrix.env.CCOV"
uses: pat-s/always-upload-cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.BASEDIR }}/target_ws
key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
restore-keys: ${{ env.CACHE_PREFIX }}
save-always: true
env:
CACHE_PREFIX: target_ws${{ matrix.env.CCOV && '-ccov' || '' }}-${{ matrix.env.IMAGE }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml', '.github/workflows/ci.yaml') }}
- name: Cache ccache
uses: pat-s/always-upload-cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
${{ env.CACHE_PREFIX }}-${{ github.sha }}
${{ env.CACHE_PREFIX }}
save-always: true
env:
CACHE_PREFIX: ccache-${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && '-ccov' || '' }}
- name: Configure ccache
Expand All @@ -145,7 +148,7 @@ jobs:
run: |
testspace "[ ${{ matrix.env.IMAGE }} ]${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml"
- name: Upload test artifacts (on failure)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure() && (steps.ici.outputs.run_target_test || steps.ici.outputs.target_test_results)
with:
name: test-results-${{ matrix.env.IMAGE }}
Expand All @@ -158,7 +161,7 @@ jobs:
workdir: ${{ env.BASEDIR }}/target_ws
ignore: '"*/target_ws/build/*" "*/target_ws/install/*" "*/test/*"'
- name: Upload codecov report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
if: always() && matrix.env.CCOV && steps.ici.outputs.target_test_results == '0'
with:
files: ${{ env.BASEDIR }}/target_ws/coverage.info
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ jobs:
steps:
- name: Delete Untagged Images
if: (github.event_name != 'pull_request') && (github.repository == 'ros-planning/moveit2')
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.DELETE_PACKAGES_TOKEN }}
script: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install clang-format-14
run: sudo apt-get install clang-format-14
- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1
id: precommit
- name: Upload pre-commit changes
if: failure() && steps.precommit.outcome == 'failure'
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,23 @@ jobs:
with:
file: moveit2.repos
- name: Cache upstream workspace
uses: pat-s/always-upload-cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.BASEDIR }}/upstream_ws
key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
restore-keys: ${{ env.CACHE_PREFIX }}
save-always: true
env:
CACHE_PREFIX: ${{ steps.rosdistro_release_date.outputs.date }}-upstream_ws-${{ steps.repos_edit_timestamp.outputs.timestamp }}-rolling-ci-${{ hashFiles('moveit2*.repos', '.github/workflows/ci.yaml') }}
- name: Cache ccache
uses: pat-s/always-upload-cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-rolling-ci-ccov-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
ccache-rolling-ci-ccov-${{ github.sha }}
ccache-rolling-ci-ccov
save-always: true
- name: Configure ccache
run: |
mkdir -p ${{ env.CCACHE_DIR }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
stale-issue-label: 'stale'
stale-pr-label: 'stale'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tutorial_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ jobs:
- name: "Remove .dockerignore"
run: rm .dockerignore # enforce full source context
- name: Cache ccache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .ccache
key: docker-tutorial-ccache-${{ matrix.ROS_DISTRO }}-${{ hashFiles( '.docker/tutorial-source/Dockerfile' ) }}
- name: inject ccache into docker
uses: reproducible-containers/[email protected].2
uses: reproducible-containers/[email protected].4
with:
cache-source: .ccache
cache-target: /root/.ccache/
Expand All @@ -74,7 +74,7 @@ jobs:
steps:
- name: Delete Untagged Images
if: (github.event_name != 'pull_request') && (github.repository == 'ros-planning/moveit2')
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.DELETE_PACKAGES_TOKEN }}
script: |
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,12 @@ repos:
- id: codespell
args: ['--write-changes', '--ignore-words=.codespell_words', '--skip="*.eps"']
exclude: CHANGELOG.rst

- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.10
hooks:
- id: cmake-format
- id: cmake-lint
args:
- "--disabled-codes=C0301" # Disable Line too long lint
- "--suppress-decorations"
41 changes: 35 additions & 6 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,48 @@
API changes in MoveIt releases

## ROS Rolling
- `lockSceneRead()` and `lockSceneWrite()` are now protected member functions, for internal use only. To lock the planning scene, use LockedPlanningSceneRO or LockedPlanningSceneRW:
- [12/2023] `trajectory_processing::Path` and `trajectory_processing::Trajectory` APIs have been updated to prevent misuse.
The constructors have been replaced by builder methods so that errors can be communicated. Paths and trajectories now need to be created with `Path::Create()` and `Trajectory::Create()`. These methods now return an `std::optional` that needs to be checked for a valid value. `Trajectory` no longer has the `isValid()` method. If it's invalid, `Trajectory::Create()` will return `std::nullopt`. Finally, `Path` now takes the list of input waypoints as `std::vector`, instead of `std::list`.
- [12/2023] LMA kinematics plugin is removed to remove the maintenance work because better alternatives exist like KDL or TracIK
- [10/2023] The planning pipeline now has a vector of planner plugins rather than a single one. Please update the planner plugin parameter e.g. like this:
```diff
- planning_plugin: ompl_interface/OMPLPlanner
+ planning_plugins:
+ - ompl_interface/OMPLPlanner
```
- [10/2023] Planning request adapters are now separated into PlanRequest (preprocessing) and PlanResponse (postprocessing) adapters. The adapters are configured with ROS parameter vectors (vector order corresponds to execution order). Please update your pipeline configurations for example like this:
```diff
- request_adapters: >-
- default_planner_request_adapters/AddTimeOptimalParameterization
- default_planner_request_adapters/ResolveConstraintFrames
- default_planner_request_adapters/FixWorkspaceBounds
- default_planner_request_adapters/FixStartStateBounds
- default_planner_request_adapters/FixStartStateCollision
- default_planner_request_adapters/FixStartStatePathConstraints
+ # The order of the elements in the adapter corresponds to the order they are processed by the motion planning pipeline.
+ request_adapters:
+ - default_planning_request_adapters/ResolveConstraintFrames
+ - default_planning_request_adapters/ValidateWorkspaceBounds
+ - default_planning_request_adapters/CheckStartStateBounds
+ - default_planning_request_adapters/CheckStartStateCollision
+ response_adapters:
+ - default_planning_response_adapters/AddTimeOptimalParameterization
+ - default_planning_response_adapters/ValidateSolution
+ - default_planning_response_adapters/DisplayMotionPath
```
- [2021] `lockSceneRead()` and `lockSceneWrite()` are now protected member functions, for internal use only. To lock the planning scene, use ``LockedPlanningSceneRO`` or ``LockedPlanningSceneRW``:
```
planning_scene_monitor::LockedPlanningSceneRO ls(planning_scene_monitor);
moveit::core::RobotModelConstPtr model = ls->getRobotModel();
```
- ServoServer was renamed to ServoNode
- `CollisionObject` messages are now defined with a `Pose`, and shapes and subframes are defined relative to the object's pose. This makes it easier to place objects with subframes and multiple shapes in the scene. This causes several changes:
- [2021] ServoServer was renamed to ServoNode
- [2021] `CollisionObject` messages are now defined with a `Pose`, and shapes and subframes are defined relative to the object's pose. This makes it easier to place objects with subframes and multiple shapes in the scene. This causes several changes:
- `getFrameTransform()` now returns this pose instead of the first shape's pose.
- The Rviz plugin's manipulation tab now uses the object's pose instead of the shape pose to evaluate if object's are in the region of interest.
- Planning scene geometry text files (`.scene`) have changed format. Loading old files is still supported. You can add a line `0 0 0 0 0 0 1` under each line with an asterisk to upgrade old files.
- add API for passing RNG to setToRandomPositionsNearBy
- Static member variable interface of the CollisionDetectorAllocatorTemplate for the string NAME was replaced with a virtual method `getName`.
- Enhance `RDFLoader` to load from string parameter OR string topic (and add the ability to publish a string topic).
- [2021] Add API for passing RNG to setToRandomPositionsNearBy
- [2021] Static member variable interface of the CollisionDetectorAllocatorTemplate for the string NAME was replaced with a virtual method `getName`.
- [2021] Enhance `RDFLoader` to load from string parameter OR string topic (and add the ability to publish a string topic).

## ROS Noetic
- RobotModel no longer overrides empty URDF collision geometry by matching the visual geometry of the link.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The [MoveIt Motion Planning Framework for ROS 2](http://moveit.ros.org). For the

## Getting Started

See our extensive [Tutorials and Documentation](https://moveit.picknik.ai/)
See our extensive [Tutorials and Documentation](https://moveit.picknik.ai/).

## Install

Expand All @@ -36,15 +36,15 @@ This open source project is maintained by supporters from around the world — s
</a>

[PickNik Inc](https://picknik.ai/) is leading the development of MoveIt.
If you would like to support this project, please contact [email protected]
If you would like to support this project, please contact [email protected].

<a href="http://rosin-project.eu">
<img src="http://rosin-project.eu/wp-content/uploads/rosin_ack_logo_wide.png"
alt="rosin_logo" height="60" >
</a>

The port to ROS 2 was supported by ROSIN - ROS-Industrial Quality-Assured Robot Software Components.
More information: <a href="http://rosin-project.eu">rosin-project.eu</a>
More information: <a href="http://rosin-project.eu">rosin-project.eu</a>.

<img src="http://rosin-project.eu/wp-content/uploads/rosin_eu_flag.jpg"
alt="eu_flag" height="45" align="left" >
Expand All @@ -53,7 +53,7 @@ This project has received funding from the European Union’s Horizon 2020
research and innovation programme under grant agreement no. 732287.

## Generate API Doxygen Documentation
See [How To Generate API Doxygen Reference Locally](https://moveit.picknik.ai/main/doc/how_to_guides/how_to_generate_api_doxygen_locally.html)
See [How To Generate API Doxygen Reference Locally](https://moveit.picknik.ai/main/doc/how_to_guides/how_to_generate_api_doxygen_locally.html).

# Buildfarm
| Package | Humble Binary | Iron Binary | Rolling Binary |
Expand Down
38 changes: 16 additions & 22 deletions doc/MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,30 @@

In MoveIt 1 we commonly use named ROS logging macros (i.e. `ROS_INFO_NAMED`) with file-specific logger names defined as `constexpr char LOGNAME[]="logger_name"`.
ROS 2 provides similar macros (i.e. `RCLCPP_INFO`) that instead of an optional name always require a `rclcpp::Logger` instance for scoping the namespace.
All source files that use ROS logging should now define a file-specific `static const rclcpp::Logger` named `LOGGER`, located at the top of the file and inside the namespace with the narrowest scope (if there is one).
This leads to the following basic migration steps:

1. Replace `LOGNAME` with `rclcpp::Logger` instance:
In ROS 2 logging is tied to the Node object for publishing to /rosout.
For namespaces there is the option of creating a child logger.
However because of initaliziation order (child logger has to be created after rclcpp::init is called and from a method on the logger from the node) you can no longer define the logger object as a file level static.
`moveit_core` provides a `util` library which contains some functions to make this situation more ergonomic.
```C++
#include <moveit/utils/logger.hpp>
```

<b>Old:</b>
Wherever the node is created there is the option to set the root logging namespace to be from the node for moveit using this syntax:

constexpr char LOGNAME[] = "logger_name";
```C++
moveit::setNodeLoggerName(node->get_name());
```
<b>New:</b>

static const rclcpp::Logger LOGGER = rclcpp::get_logger("logger_name");

2. Replace logging macros:

<b>Old:</b>

ROS_INFO_NAMED(LOGNAME, "Very important info message");

<b>New:</b>

RCLCPP_INFO(LOGGER, "Very important info message");
Then wherever you call a logging macro you can use the `moveit::getLogger()` function:
```C++
RCLCPP_INFO(moveit::getLogger("my_namespace"), "Very important info message");
```

### Logger naming convention

Migrating the loggers is a good opportunity to make logger names more consistent.
In order to create unique and descriptive logger names we encourage the following naming pattern: general `LIBRARY_NAME.SOURCE_FILE_NAME`.
For instance, the file `joint_model_group.cpp` inside the library `moveit_robot_model` contains the following logger:

static const rclcpp::Logger LOGGER = rclcpp::get_logger("moveit_robot_model.joint_model_group");

For finding the `LIBRARY_NAME` refer to the line `add_library(LIBRARY_NAME ...)` in the library's `CMakeLists.txt`.
If the source file name is the same or very similar to the library name it is sufficient to only use the source file name.
Expand All @@ -42,4 +36,4 @@ If the source file name is the same or very similar to the library name it is su

Some classes declared in header files may contain log messages, for instance to warn about not-implemented virtual functions in abstract classes.
A logger defined in the header file would not tell us what derived class is missing the implementation, since the source name would be resolved from the header file.
For this case, the base class should declare a private member variable `static const rclcpp::Logger LOGGER` which is to be defined in the implementing class using the corresponding source file name.
For this case, the base class should declare a private member variable `rclcpp::Logger logger_;` which is to be defined in the implementing class using the corresponding source file name.
5 changes: 5 additions & 0 deletions moveit/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package moveit
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.9.0 (2024-01-09)
------------------
* Merge branch 'main' into dependabot/github_actions/SonarSource/sonarcloud-github-c-cpp-2
* Contributors: Sebastian Jahr

2.8.0 (2023-09-10)
------------------

Expand Down
6 changes: 0 additions & 6 deletions moveit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@ cmake_minimum_required(VERSION 3.22)
project(moveit)
find_package(ament_cmake REQUIRED)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_flake8_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
Loading

0 comments on commit 581589f

Please sign in to comment.