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

Add preempted ResultCode for WrappedResult and preempt API for ServerGoalHandle #1117

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from

Conversation

naiveHobo
Copy link
Contributor

Signed-off-by: Sarthak Mittal [email protected]

Closes #1104

@naiveHobo
Copy link
Contributor Author

naiveHobo commented May 17, 2020

The current version assumes the availability of action_msgs::msg::GoalStatus::STATUS_ABORTED action_msgs::msg::GoalStatus::STATUS_PREEMPTED. The code was written and tested with this addition in action_msgs. Does this call for a ticket requesting this addition in rcl_interfaces or should I make changes here?

@@ -581,7 +581,8 @@ class Client : public ClientBase
if (
goal_status == GoalStatus::STATUS_SUCCEEDED ||
goal_status == GoalStatus::STATUS_CANCELED ||
goal_status == GoalStatus::STATUS_ABORTED)
goal_status == GoalStatus::STATUS_ABORTED ||
goal_status == 7) // GoalStatus::STATUS_PREEMPTED)
Copy link
Collaborator

Choose a reason for hiding this comment

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

ASSERT_LT(0u, received_msgs.size());
auto & msg = received_msgs.back();
ASSERT_EQ(1u, msg->status_list.size());
EXPECT_EQ(action_msgs::msg::GoalStatus::STATUS_ABORTED, msg->status_list.at(0).status);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is expected to STATUS_ABORTED? not STATUS_PREEMPTED?

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 action_msgs::msg::GoalStatus msgs published on /_action/status will still have their status set to ABORTED when preemption takes place in through ServerGoalHandle::preempt(). The message received here is published by rcl_actions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks, i understand now.

@fujitatomoya
Copy link
Collaborator

I believe that rclpy action also needs to be updated based on this fix. Otherwise we lose the consistency.

@naiveHobo
Copy link
Contributor Author

If rclpy and action_msgs is also expected to make this update, it would make sense to add preemption to rcl_action altogether.

@SteveMacenski
Copy link
Collaborator

@naiveHobo do you mean it assumes the STATUS_PREEMPTED not STATUS_ABORTED in your description?

I don't necessarily think that we have to implement the python version as well. That could be left to another party that cares about that (which we don't) unless the maintainers here require it.

@@ -37,7 +37,8 @@ enum class ResultCode : int8_t
UNKNOWN = action_msgs::msg::GoalStatus::STATUS_UNKNOWN,
SUCCEEDED = action_msgs::msg::GoalStatus::STATUS_SUCCEEDED,
CANCELED = action_msgs::msg::GoalStatus::STATUS_CANCELED,
ABORTED = action_msgs::msg::GoalStatus::STATUS_ABORTED
ABORTED = action_msgs::msg::GoalStatus::STATUS_ABORTED,
PREEMPTED = 7 // action_msgs::msg::GoalStatus::STATUS_PREEMPTED
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, please add this to the GoalStatus

@SteveMacenski
Copy link
Collaborator

cppcheck caught something in CI you may need to look at.

@jacobperron
Copy link
Member

The cppcheck failures are happening on the master branch, so I guess it's not related: http://build.ros2.org/view/Fdev/job/Fdev__rclcpp__ubuntu_focal_amd64/25/testReport/

@naiveHobo
Copy link
Contributor Author

Waiting for ros2/rcl_interfaces#105 to pass so action_msgs::msg::GoalStatus::STATUS_PREEMPTED can be used in this PR.

@SteveMacenski
Copy link
Collaborator

Thanks for linking that here. @jacobperron who's the owner of that one?

@jacobperron
Copy link
Member

@jacobperron who's the owner of that one?

If you're referring to the rcl_interfaces PR, nobody yet; the core ROS 2 repositories have shared maintainership across the team. Typically, people will be assigned during triage meetings.

I can take a quick look at the proposed changes, but these kinds of API changes will have to wait until post-Foxy release.

@SteveMacenski
Copy link
Collaborator

SteveMacenski commented May 20, 2020

Makes sense, I wouldn't expect otherwise. It would be nice to get in at a soon-after sync. This would be a critical fault for Navigation2 if this wasn't available in Foxy at all. It currently blocks the only reasonable solution some severe architectural issues.

@sloretz
Copy link
Contributor

sloretz commented May 28, 2020

@naiveHobo it looks like there's a merge conflict. Mind resolving it?

@audrow audrow changed the base branch from master to rolling June 28, 2022 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rclcpp_actions: Add preempted ResultCode for WrappedResult and preempt API for ServerGoalHandle
6 participants