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

Preempt trajectory execution if one controller aborts #1299

Open
Martin-Oehler opened this issue Jan 9, 2019 · 6 comments
Open

Preempt trajectory execution if one controller aborts #1299

Martin-Oehler opened this issue Jan 9, 2019 · 6 comments

Comments

@Martin-Oehler
Copy link
Contributor

Description

In the current trajectory execution handling, if one goal aborts, the other goals are executed regardless. An aborted goal is likely due to a malfunction of the respective controller/hardware. A collision-free execution can no longer be guaranteed and a further execution of the trajectory is very unsafe. Therefore, I suggest to monitor the state of all controllers and preempt all goals if one goal is aborted.

This issue is related to aborted goal handling of the joint_trajectory_controller ros-controls/ros_controllers#395

I implemented the necessary changes here. I am not sure if further changes are required, it works in my setup. If there is interest to merge this, I will open a PR.

@welcome
Copy link

welcome bot commented Jan 9, 2019

Thanks for reporting an issue. We will have a look asap. If you can think of a fix, please consider providing it as a pull request.

@rhaschke
Copy link
Contributor

rhaschke commented Jan 9, 2019

Thanks for reporting this issue. I agree, that trajectory execution shouldn't continue when one controller aborts. Unfortunately, MoveIt doesn't provide an API in ControllerHandles to report status changes via callbacks. For this reason you had to implement an ugly busy loop.
But, yes, please file this as a PR.

@Martin-Oehler
Copy link
Contributor Author

Unfortunately, MoveIt doesn't provide an API in ControllerHandles to report status changes via callbacks.

I also looked into this, but adding callbacks would require a lot of changes. Maybe it could be refactored at some point.

For this reason you had to implement an ugly busy loop.

It is ugly, I agree. But since it has been a busy loop before, not much changed in that regard.

But, yes, please file this as a PR.

Ok, I will do that. I am leaving this open for now for further discussion.

@rhaschke
Copy link
Contributor

rhaschke commented Jan 9, 2019

What about launching threads for all controller handles to perform the actual waitForExecution() call. These threads can then asynchronously notify the main function about state changes.

Btw, before it wasn't necessarily a busy loop. All implementations of waitForExecution() in MoveIt were not busy looping.

@Martin-Oehler
Copy link
Contributor Author

What about launching threads for all controller handles to perform the actual waitForExecution() call.

That would be a possibility. However, we could also directly poll the states of the controllers using getLastExecutionStatus() and not use waitForExecution() at all. I think that might be even better as you can directly get the state of controllers without the need for additional threads.

@rhaschke
Copy link
Contributor

Yes, I think you are right.

sjahr pushed a commit to sjahr/moveit that referenced this issue Jun 21, 2024
* Modified URDF Infrastructure

* Control Xacro Config

* URDF Modifications Widget

* Use same base class for ROS2Controllers and MoveItControllers (widget/config/setup_step)

* Further cleanup

* Fix ModifiedURDF Generation

* Apply suggestions from code review

Co-authored-by: AndyZe <[email protected]>

* Rename button variable

* Clang line length fix

Co-authored-by: AndyZe <[email protected]>
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

No branches or pull requests

2 participants