Skip to content

Conversation

@nbbrooks
Copy link
Contributor

@nbbrooks nbbrooks commented Sep 3, 2025

Description

This PR gets the required CI jobs passing again by addressing API changes from the following:

I check which header format / API to use by checking the rclcpp version, which is generated via rclcpp'ss invocation of the ament_generate_version_header CMake function. Other places in the MoveIt2 codebase where the include could be .h or .hpp (depending on the target distro), we decide which to use by checking if the hpp file can be found. I decided to just use RCLCPP_VERSION_GTE everywhere and make a note which newest distro uses the "old" API so we can delete those checks when that distro (for example, Kilted) goes EOL.

I am following the RCLCPP_VERSION_GTE versions used in the Nav2 project, which are pretty close to what I saw when inspecting the rclcpp package version at each distro branch date.

  • rolling, l-turtle >= 30
  • kilted >= 29.6
  • jazzy >= 29
  • humble (this ends up always being your elseif)

Caveats

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@codecov
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 8.57143% with 64 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.22%. Comparing base (4fc5c82) to head (5e3086e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...g_scene_rviz_plugin/src/planning_scene_display.cpp 0.00% 10 Missing ⚠️
...anning_rviz_plugin/src/motion_planning_display.cpp 0.00% 9 Missing ⚠️
...obot_state_rviz_plugin/src/robot_state_display.cpp 0.00% 8 Missing ⚠️
...ctomap_updater/src/depth_image_octomap_updater.cpp 0.00% 6 Missing ⚠️
...ugin_render_tools/src/trajectory_visualization.cpp 0.00% 6 Missing ⚠️
...occupancy_map_monitor/src/occupancy_map_server.cpp 0.00% 5 Missing ⚠️
...octomap_updater/src/pointcloud_octomap_updater.cpp 0.00% 5 Missing ⚠️
moveit_kinematics/test/test_kinematics_plugin.cpp 0.00% 3 Missing ⚠️
...c/default_capabilities/tf_publisher_capability.cpp 0.00% 3 Missing ⚠️
...it_ros/moveit_servo/demos/servo_keyboard_input.cpp 0.00% 3 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##            main    #3567       +/-   ##
==========================================
+ Coverage   0.00%   46.22%   +46.22%     
==========================================
  Files        180      720      +540     
  Lines      22601    62743    +40142     
  Branches    3099     7594     +4495     
==========================================
+ Hits           0    28995    +28995     
- Misses     22601    33582    +10981     
- Partials       0      166      +166     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nbbrooks nbbrooks force-pushed the pr-fix-qos-deprecations branch from 729a606 to 3f931ed Compare September 8, 2025 04:18
@nbbrooks nbbrooks changed the title Fix compile Warning/Error (tf2*.h is deprecated) + QOS deprecations Fix deprecations in image_common and tf2_ros Sep 8, 2025
@nbbrooks
Copy link
Contributor Author

nbbrooks commented Sep 8, 2025

Still remaining deprecation warning treated as error failures related to #3528

@nbbrooks nbbrooks requested a review from v4hn September 8, 2025 16:43
@nbbrooks
Copy link
Contributor Author

nbbrooks commented Sep 8, 2025

This is building successfully locally now with colcon build --event-handlers desktop_notification- status- --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Werror=deprecated-declarations"

I have not tested that Rviz functionality is preserved with this change - I am a little concerned about any 0.1f values getting truncated to 0s in the new Rviz API per my comment here, but am not sure what the actual effect would be.


if (planning_scene_monitor_)
updateInternal(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::duration<float>(wall_dt)),
std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::duration<float>(ros_dt)));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should just have this call PlanningSceneDisplay::update(std::chrono::nanoseconds wall_dt, std::chrono::nanoseconds ros_dt) rather than duplicate the implementation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea when implementing ros2/rviz#1533 was that the update(float, float) methods could be removed in favour of the update(std::chrono... methods.

If the update(float, float) overload is removed, then calling update(float, float) method will just call the base class version, which automatically calls the (overloaded) update(std::chrono... version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I am keeping this overloaded PlanningSceneDisplay::update(float wall_dt, float ros_dt) method is due to how we use branches in the moveit2 repo:

  • humble, kilted, jazzy, etc - Stable versions of non-EOL distros. No API breaking changes are pushed to these branches. Build farm releases for non-rolling distros are built from these branches.
  • main - This targets rolling, but also compiles against non-EOL distro APIs with MoveIt breaking changes. This enables people on Humble to use the latest features that broke API if they wish (but requires a source build).

The changes to motion_planning_display.hpp might make this more clear.

So I'm keeping the MoveIt Rviz plugin PlanningSceneDisplay::update(float wall_dt, float ros_dt) API to avoid breaking API for those folks (but have marked it as deprecated in Rolling).

Copy link
Contributor

@riv-mjohnson riv-mjohnson Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be sufficient to just add a using declaration to each class, to use the base class' update methods?

Something like

class PlanningSceneDisplay : public rviz_common:Display {
  ...
  using rviz_common::Display::update;
  void update(std::chrono::nanoseconds ...
}

so that PlanningSceneDisplay::update(float, float) just calls rviz_common::Display(float, float) (which in turn just calls PlanningSceneDisplay::update(std::chrono, std::chrono))?

(I think the using declaration is needed to avoid shadowing / name hiding of the update(float, float) method with the update(std::chrono method. See https://stackoverflow.com/questions/31271661/partial-inheritance-of-set-of-overloaded-virtual-functions for details.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I am following, let's give it a shot.

If I have a rough time with it, I may just revert to the more verbose approach so I can get this fix in (and fix CI).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think .hpp is also available in Kilted and older, do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which .hpp file do you mean? the tf2_ros .hpp files? That change only went in July, so the "treat deprecations as errors" compile failures only need to be addressed in Rolling.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the tf2 ros hpp files, it is also backported and now available in Kilted and order, so I think it's fine for older distribution to use .hpp as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing out using tf2_ros hpp includes in Kilted now.

{
if (int_marker_display_)
int_marker_display_->update(
std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::duration<float>(wall_dt)),
Copy link
Contributor

@riv-mjohnson riv-mjohnson Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this will treat float wall_dt and float ros_dt as being in seconds, and convert them to std::chrono::nanoseconds?

The point of ros2/rviz#1533 is that float wall_dt and float ros_dt are (erroneously, and contrary to documentation) already in nanoseconds. See ros2/rviz#1322 and #3528.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review - I will read through those issues in more detail and revise!

@nbbrooks nbbrooks force-pushed the pr-fix-qos-deprecations branch from 80d4883 to 2eeff3a Compare September 12, 2025 13:56
@nbbrooks
Copy link
Contributor Author

Unfortunately we will need the next rolling release (which will include xacro 2.1.1) for this to pass as is (see PickNikRobotics/launch_param_builder#16).

@nbbrooks
Copy link
Contributor Author

@rhaschke Looking for some advice here. I'm trying to get the required Rolling CI jobs green in this PR so we can merge in PRs without a admin overriding CI (and also not knowing if there are errors past the deprecation-treated-as-error failures). What would you recommend with regard to PickNikRobotics/launch_param_builder#16 ?

  1. Wait for the next Rolling sync with xacro 2.1.1
  2. Add xacro to the moveit2.repo (temporarily) until the next rolling sync
  3. Add launch_param_builder to the moveit2.repo (temporarily) including additions to conform to the current xacro Rolling API

@riv-mjohnson
Copy link
Contributor

@MatthijsBurgh
Copy link
Contributor

Sync has happened

@riv-mjohnson
Copy link
Contributor

Looks like the pipelines are still failing with xacro and warehouse problems

@MatthijsBurgh
Copy link
Contributor

Xacro 2.1.1 is released on rolling. And should fix the pathlib compatibility. The code shown in the stacktrace doesn't match the 2.1.1 tag. So maybe caching is preventing the newest xacro to be installed.

@riv-mjohnson
Copy link
Contributor

Yeah, it looks like the old dependencies are being pulled in from the docker cache https://github.com/moveit/moveit2/actions/caches

The quick fix would just be to delete the relevant caches from there.

The longer fix would be to have a preprocessing step so the version numbers are passed into the relevant places in the dockerfile, so it rebuilds the correct layers when dependencies update.

@nbbrooks
Copy link
Contributor Author

nbbrooks commented Oct 7, 2025

Looks like deleting the rolling and humble ci cache did not get it passing...maybe I need to delete it all.

@nbbrooks
Copy link
Contributor Author

nbbrooks commented Oct 7, 2025

I think this is actually a correct deprecation treated as error failure, though I don't understand how things were passing earlier.

@nbbrooks
Copy link
Contributor Author

nbbrooks commented Oct 7, 2025

Oh, the constructor deprecation was in ros2/geometry2#714 not ros2/geometry2#805, that is how. 😭

@riv-mjohnson
Copy link
Contributor

Yeah, looks like new errors. So at least the rolling sync problems are fixed.

@nbbrooks
Copy link
Contributor Author

Also need to fix deprecations in ros2/rclcpp#2848 now.

It would be nice if the deprecation warnings linked to the PR that generated them. It would save me some time chasing stuff down, especially because the ROS 2 SEO still needs a lot of attention.

…ode_interfaces::NodeBaseInterface::SharedPtr node_ptr) to SingleThreadedExecutor::spin_some() API
@nbbrooks nbbrooks requested review from AndyZe, MarqRazz, mini-1235 and riv-mjohnson and removed request for mini-1235 and riv-mjohnson October 11, 2025 18:38
@nbbrooks nbbrooks enabled auto-merge (squash) October 12, 2025 17:05
@nbbrooks
Copy link
Contributor Author

It looks like the Tutorial Docker Images / tutorial-source job is not optional like I thought. I am going to force merge this so we can start getting some other stuff merged in (if their non-tutorial Rolling jobs pass) and fix the tutorial issue in a follow-up.

@nbbrooks nbbrooks disabled auto-merge October 12, 2025 17:26
@nbbrooks nbbrooks merged commit 65aa94c into moveit:main Oct 12, 2025
9 of 10 checks passed
@github-project-automation github-project-automation bot moved this to ✅ Done in MoveIt Oct 12, 2025
@nbbrooks
Copy link
Contributor Author

nbbrooks commented Oct 12, 2025

moveit/moveit2_tutorials#1071 should get Tutorial Docker Images / tutorial-source passing again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants