Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hybrid Planning] Improve action cancellation #1272

Merged
merged 10 commits into from
Jun 2, 2022

Conversation

AndyZe
Copy link
Member

@AndyZe AndyZe commented May 24, 2022

Action cancellation wasn't working well, so...

  • Move long-running callbacks into new threads
  • Make a unique callback group for each action server
  • Add a script to test cancellation

Test with:

ros2 launch moveit_hybrid_planning hybrid_planning_demo.launch.py

ros2 run moveit_hybrid_planning cancel_action

This work is sponsored by RE2 Robotics.

@AndyZe AndyZe requested a review from JafarAbdi May 24, 2022 15:16
@codecov
Copy link

codecov bot commented May 24, 2022

Codecov Report

Merging #1272 (5835192) into main (456166f) will decrease coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1272      +/-   ##
==========================================
- Coverage   61.46%   61.44%   -0.02%     
==========================================
  Files         274      274              
  Lines       24940    24940              
==========================================
- Hits        15328    15322       -6     
- Misses       9612     9618       +6     
Impacted Files Coverage Δ
moveit_ros/moveit_servo/src/servo_calcs.cpp 65.06% <0.00%> (-1.16%) ⬇️
...dl_kinematics_plugin/src/kdl_kinematics_plugin.cpp 75.36% <0.00%> (-1.07%) ⬇️
...nning_scene_monitor/src/planning_scene_monitor.cpp 45.73% <0.00%> (+0.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 456166f...5835192. Read the comment docs.

@AndyZe AndyZe force-pushed the andyz/hp_action_server branch 3 times, most recently from b867a26 to 0a82ad1 Compare May 24, 2022 21:21
@AndyZe AndyZe marked this pull request as draft May 25, 2022 12:54
@AndyZe AndyZe marked this pull request as ready for review May 25, 2022 13:11
@AndyZe AndyZe force-pushed the andyz/hp_action_server branch 4 times, most recently from 272edff to 7bbce45 Compare May 31, 2022 19:35
@AndyZe AndyZe marked this pull request as draft June 1, 2022 13:14
@AndyZe
Copy link
Member Author

AndyZe commented Jun 1, 2022

Can I get a final review? @henningkayser @JafarAbdi

@AndyZe AndyZe marked this pull request as ready for review June 1, 2022 17:11
@AndyZe AndyZe changed the title [Hybrid Planning] Move long-running callbacks to new threads [Hybrid Planning] Improve action cancellation Jun 1, 2022
Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

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

I'm not a huge fan of the timeout, but I agree that this is probably the most practical approach for now. It's strictly an improvement to the old implementation, and in practice, I don't think that it even matters a lot in these situations. LGTM!

@AndyZe AndyZe merged commit 7427a8e into moveit:main Jun 2, 2022
peterdavidfagan pushed a commit to peterdavidfagan/moveit2 that referenced this pull request Jul 14, 2022
* Small changes to make the action server more performant

* Move the threads to member variables

* Add a simple cancellation demo

* Do not use unique_ptr

* Lint

* Launch file cleanup

* When a new HP goal is received, give the previous some time to cancel

* A unique callback group for each action server
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.

4 participants