Skip to content

[ros2]: Fixed preempting of execution#363

Closed
JafarAbdi wants to merge 3 commits intomoveit:ros2from
JafarAbdi:pr-fix_preempt_execution
Closed

[ros2]: Fixed preempting of execution#363
JafarAbdi wants to merge 3 commits intomoveit:ros2from
JafarAbdi:pr-fix_preempt_execution

Conversation

@JafarAbdi
Copy link
Copy Markdown
Member

Same as JafarAbdi#6

@JafarAbdi
Copy link
Copy Markdown
Member Author

@mechwiz Please review

@codecov
Copy link
Copy Markdown

codecov bot commented May 17, 2022

Codecov Report

Merging #363 (fcdce1e) into ros2 (0128cd9) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             ros2     #363      +/-   ##
==========================================
- Coverage   38.85%   38.82%   -0.03%     
==========================================
  Files          78       78              
  Lines        7520     7526       +6     
==========================================
  Hits         2921     2921              
- Misses       4599     4605       +6     
Impacted Files Coverage Δ
core/src/task.cpp 61.36% <0.00%> (-1.83%) ⬇️

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 0128cd9...fcdce1e. Read the comment docs.

@mechwiz
Copy link
Copy Markdown
Contributor

mechwiz commented May 17, 2022

I tested these changes on a project I'm working on and can verify they work. LGTM!

std::bind(&ExecuteTaskSolutionCapability::preemptCallback, this, std::placeholders::_1)),
ActionServerType::AcceptedCallback(
std::bind(&ExecuteTaskSolutionCapability::goalCallback, this, std::placeholders::_1)));
std::bind(&ExecuteTaskSolutionCapability::goalCallback, this, std::placeholders::_1)),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the std::bind isn't needed here since 1 argument is expected

wyattrees and others added 3 commits May 26, 2022 16:32
…ting the goal so it does not block the server from accepting a cancel request. While client is waiting for the result future, repeatedly check if preempting was requested and send a cancel request if it was
@JafarAbdi JafarAbdi force-pushed the pr-fix_preempt_execution branch from a760804 to fcdce1e Compare May 26, 2022 16:32
Copy link
Copy Markdown
Contributor

@v4hn v4hn left a comment

Choose a reason for hiding this comment

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

preempt was added to allow the user to stop planning.
As execution is just a thin wrapper around the action server it seems like a clumsy interface to repurpose preempt for execution instead.

Wouldn't it be better and more flexible to expose the action client to the user to cancel execution there?

error_code.val = moveit_msgs::msg::MoveItErrorCodes::PREEMPTED;
return error_code;
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is that really the best we can do for this kind of feature? 10ms waits are quite bad style :(

@MarqRazz
Copy link
Copy Markdown

Closing because the functionality was added in 684 🎉

@MarqRazz MarqRazz closed this May 29, 2025
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in MoveIt May 29, 2025
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