-
Notifications
You must be signed in to change notification settings - Fork 345
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
[JTC]: Abort goal on deactivate #1517
[JTC]: Abort goal on deactivate #1517
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fix.
But the test is failing in every CI job, does it succeed locally?
setCanceled()
is also called in preempt_active_goal()
, should we also change it there?
Yes, they were succeeding locally, I will have a look.
That seems reasonable, I will check that. |
Things seem to be a bit more complicated there. From my understanding, we call If I add a manual call to Trajectory replacement seems to be working fine and as expected, however the overwritten trajectory doesn't return until the overwriting trajectory finished. Then, it reports For the time being I would suggest to restrict this PR to the |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1517 +/- ##
==========================================
+ Coverage 84.19% 84.26% +0.06%
==========================================
Files 123 123
Lines 11322 11359 +37
Branches 956 962 +6
==========================================
+ Hits 9533 9572 +39
+ Misses 1473 1470 -3
- Partials 316 317 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another reference https://design.ros2.org/articles/actions.html
- ABORTED - The goal was terminated by the action server without an external request.
- CANCELED - The goal was canceled after an external request from an action client.
indeed, abort is what we need.
Can you please open an issue regarding the preemption?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well.
Thanks for adding a proper test :)
28845e6
into
ros-controls:master
(cherry picked from commit 28845e6)
Currently, when deactivating the JTC once a trajectory is being executed leads to the following problems:
[ros2_control_node-1] [WARN] [1737719032.541174555] [realtime_tools]: goal_handle attempted invalid transition from state EXECUTING with event CANCELED, at ./src/rcl_action/goal_handle.c:95
(See scaled_joint_trajectory_controller does not behave as expected when stop is pressed on the robot UniversalRobots/Universal_Robots_ROS2_Driver#1250)I narrowed that down to the
RealtimeServerGoalHandle
callinggh_->canceled
which is supposed to be called only, once the goal is already cancelling according to its documentation. The transition doesn't succeed and hence that message gets repeated in every cycle of the non-realtime-thread, and the action never terminates.I've added a test for that event in this PR and a possible solution: Calling
setAborted
instead ofsetCanceled
in the JTC when it is being deactivated does work. I also think, this is a valid feedback to the user, as the goal isn't preempted by the user but it is aborted due to the controller going down.