Skip to content

Backport ruckig trajectory_processing plugin - #2902

Merged
rhaschke merged 9 commits into
moveit:masterfrom
simonschmeisser:backport-ruckig
Dec 21, 2022
Merged

rhaschke merged 9 commits into
moveit:masterfrom
simonschmeisser:backport-ruckig

Conversation

@simonschmeisser

Copy link
Copy Markdown
Contributor

Description

This is a backport of moveit/moveit2#571

"Unfortunately" ruckig requires C++ 17 for its headers so this changes the moveit_default_planning_request_adapter_plugins to compile with C++ 17. It's a private property so it does not propagate anywhere and especially does not lead to any dependent code or project requiring C++ 17

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

@AndyZe

AndyZe commented Oct 11, 2021

Copy link
Copy Markdown
Member

Please be aware, this won't work great until 712 is included.

moveit/moveit2#712

@gavanderhoorn

Copy link
Copy Markdown
Member

"Unfortunately" ruckig requires C++ 17 for its headers

I'm not sure as to the state of it, but patch-c++11.sh is included with Ruckig to avoid this 'dependency'.

It's been used successfully by quite a nr of people (PLCs, other limited runtime environments).

@simonschmeisser

Copy link
Copy Markdown
Contributor Author

Please be aware, this won't work great until 712 is included.

ros-planning/moveit2#712

Thanks for the reminder, then let's wait until that has been merged and I'll include it here

"Unfortunately" ruckig requires C++ 17 for its headers

I'm not sure as to the state of it, but patch-c++11.sh is included with Ruckig to avoid this 'dependency'.

I'd favor adding an exception for non-public targets/code instead of extra maintenance efforts

@v4hn v4hn added the wip label Oct 19, 2021
@simonschmeisser

Copy link
Copy Markdown
Contributor Author

should also include moveit/moveit2#777

@AndyZe

AndyZe commented Nov 8, 2021 •

Copy link
Copy Markdown
Member

Trying to test this, it looks like I'm not able to install the Ruckig binary. Any ideas?

rosdep install --from-paths src --ignore-src -r -y

moveit_core: Cannot locate rosdep definition for [ruckig]

(I only have melodic available conveniently)

@simonschmeisser

Copy link
Copy Markdown
Contributor Author

I needed to update the cache: rosdep update and then it worked:

rosdep where-defined ruckig
https://raw.githubusercontent.com/ros/rosdistro/master/melodic/distribution.yaml

@prasuchit

Copy link
Copy Markdown

Hi,

Is this still being considered for backport? I'm currently using noetic and would like to try this out with moveit. Is there an estimated timeline for merging this?

@simonschmeisser

Copy link
Copy Markdown
Contributor Author

There are some more commits in the PRs linked in the discussion that need to be included. No estimate when I'll do it. You could open a PR with those commits against my branch if you want to speed things up

@AndyZe

AndyZe commented Jul 7, 2022

Copy link
Copy Markdown
Member

@prasuchit I think you should open your own PR to update this one, too. It should be as easy as copy-pasting the source code from MoveIt2 main branch.

@prasuchit

Copy link
Copy Markdown

I've used the moveit master branch and added the ruckig related changes based on moveit2 master branch and pushed it here. @AndyZe @simonschmeisser , could you try to compile this on your system and let me know if it succeeds?

I think my cmake version doesn't support "moveit_build_options()", which is used in CMakeLists of latest version of moveit.

Because of this I'm unable to verify my changes.

Given that I'm no expert in Moveit's internal structure or anything ruckig related, I might have missed something/made errors somewhere, if so, please let me know and I'll correct them. :)

@AndyZe

AndyZe commented Jul 7, 2022

Copy link
Copy Markdown
Member

I'm confused why you would make a PR that you personally can't even use ;) but I'm happy to review it anyway.

Is there something strange with your situation that prevents you from using Noetic?

@prasuchit

Copy link
Copy Markdown

Hi @AndyZe ,

I haven't raised a PR yet, it's on my fork created from @simonschmeisser 's version of the backport. This is the first time I'm adding to a package as large as moveit so I wanted to verify it first with you guys.

I can use noetic without any issues, just the moveit source compilation fails because the latest moveit repo uses some cmake options that aren't being recognized by my current version. I thought instead of getting distracted by a different issue, I can get your help to fix the problem at hand.

@simonschmeisser

Copy link
Copy Markdown
Contributor Author

I just rebased my backport to the current state of MoveIt 1 master branch. What you could do now is to use git cherry-pick SOMEHASH where somehash is the commit hash of further changes in MoveIt2 needed to get ruckig plugin up and running. moveit_build_options() was introduced in MoveIt2, it has nothing to do with the cmake version. It needs to be replaced by similar behaviour when we want to integrate it into MoveIt1. That's what's called back-porting, it sometimes requires some real work ...

@simonschmeisser

Copy link
Copy Markdown
Contributor Author

There are a few more commits and PRs that went into the ruckig plugin so maybe actually @AndyZe hands-on approach of copy-pasting and adapting the final resulting file makes more sense than trying to cherry pick all of the commits from https://github.com/ros-planning/moveit2/commits/main/moveit_core/trajectory_processing/src/ruckig_traj_smoothing.cpp individually

@AndyZe

AndyZe commented Dec 14, 2022

Copy link
Copy Markdown
Member

I'm going to try to get this across the finish line now 👍

AndyZe and others added 5 commits December 14, 2022 14:25
* Implement a check for identical waypoints

* Add duration extension. It allows much faster motion

* Reset Ruckig before duration extension

* Readability and style updates

* Parameterize max attempts by fraction rather than num. attempts

* Fix type error. Do not copy trajectory

* Boolean simplification

* Style cleanup

* Make an issue for Ruckig pass_to_input() replacement

* Use make_unique rather than .reset()

* Start a unit test

* Two compiling tests

* Three passing tests  :)

* Rucking "Finished" state is acceptable, too
@rhaschke

Copy link
Copy Markdown
Contributor

Given that ruckig is obviously missing from Bionic/Melodic, I suggest building that plugin optionally only on Focal/Noetic.
The other builds fail due to a simple unused argument. I'm surprised that MoveIt2 checks passed for this issue!

@simonschmeisser

Copy link
Copy Markdown
Contributor Author

Given that ruckig is obviously missing from Bionic/Melodic, I suggest building that plugin optionally only on Focal/Noetic.

What makes that obvious and why shouldn't it be released to ROS1 as well?

@rhaschke

Copy link
Copy Markdown
Contributor

Given that ruckig is obviously missing from Bionic/Melodic ...

What makes that obvious?

Sorry, you are right! The error message from the failing CI build made me conclude that ruckig is missing in Melodic:
catkin_package() DEPENDS on 'ruckig' but neither 'ruckig_INCLUDE_DIRS' nor 'ruckig_LIBRARIES' is defined.

Looks like this is another issue. I will have a look...

@codecov

codecov Bot commented Dec 15, 2022 •

Copy link
Copy Markdown

Codecov Report

Base: 57.17% // Head: 62.02% // Increases project coverage by +4.86% 🎉

Coverage data is based on head (9c29f16) compared to base (8390be7).
Patch coverage: 86.23% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2902      +/-   ##
==========================================
+ Coverage   57.17%   62.02%   +4.86%     
==========================================
  Files         334      380      +46     
  Lines       30220    33593    +3373     
==========================================
+ Hits        17274    20834    +3560     
+ Misses      12946    12759     -187     
Impacted Files Coverage Δ
..._adapter_plugins/src/add_ruckig_traj_smoothing.cpp 0.00% <0.00%> (ø)
...rajectory_processing/src/ruckig_traj_smoothing.cpp 91.85% <91.85%> (ø)
...bot_model/include/moveit/robot_model/robot_model.h 84.00% <0.00%> (-1.91%) ⬇️
...g_scene_interface/src/planning_scene_interface.cpp 51.10% <0.00%> (-1.09%) ⬇️
...raint_samplers/src/default_constraint_samplers.cpp 81.00% <0.00%> (-0.29%) ⬇️
..._motion_planner_testutils/cartesianconfiguration.h 100.00% <0.00%> (ø)
...n_planner_testutils/motionplanrequestconvertible.h 100.00% <0.00%> (ø)
moveit_ros/moveit_servo/src/servo.cpp 63.23% <0.00%> (ø)
...tup_assistant/src/tools/collision_linear_model.cpp 0.00% <0.00%> (ø)
moveit_ros/moveit_servo/src/pose_tracking.cpp 44.85% <0.00%> (ø)
... and 117 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rhaschke

Copy link
Copy Markdown
Contributor

Everything is compiling now. But there is a test failure on Melodic. Somebody with more insight should handle this...

@AndyZe AndyZe added backport porting back changes from more current branches and removed wip labels Dec 15, 2022
@AndyZe

AndyZe commented Dec 20, 2022

Copy link
Copy Markdown
Member

OK, this should be 100% synched with MoveIt2 now, and I've just tested it. 👍

@rhaschke
rhaschke merged commit c9677ce into moveit:master Dec 21, 2022
@rhaschke

Copy link
Copy Markdown
Contributor

After having merged this PR, GHA fails now on ruckig tests - but only for one out of 3 builds?! Same for the prerelease test.
I wasn't able yet to reproduce the issue locally. As this currently blocks the prepared release, I'm grateful for help, @AndyZe.

@rhaschke rhaschke mentioned this pull request Dec 21, 2022
@AndyZe

AndyZe commented Dec 21, 2022

Copy link
Copy Markdown
Member

OK, I'll look into it. Thanks

@rhaschke

Copy link
Copy Markdown
Contributor

It doesn't seem to be related to a Release build. I don't have any more ideas...
If we can't find the underlying reason, we could just disable the test...

@AndyZe

AndyZe commented Dec 21, 2022

Copy link
Copy Markdown
Member

That's fine with me, for now. It's going to take awhile to look into this strange error, I think.

Do you want to make a PR?

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

Labels

backport porting back changes from more current branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants