Skip to content
This repository was archived by the owner on Nov 13, 2017. It is now read-only.

fix trajectory service blocking callback queue#717

Merged
davetcoleman merged 3 commits intoindigo-develfrom
fix-traj-service
Jul 19, 2016
Merged

fix trajectory service blocking callback queue#717
davetcoleman merged 3 commits intoindigo-develfrom
fix-traj-service

Conversation

@rhaschke
Copy link
Copy Markdown
Contributor

As an ExecuteService request might block (waiting for trajectory execution to finish),
processing of other events/callbacks from the main spinner thread would be blocked.

Hence, ExecuteService is now served from a separate spinner thread, using a separate callback queue. This enables trajectory stopping in #713.

An alternative, IMHO even better approach is to turn the service into an action, which provides feedback and can be explicitly interrupted. I did that, but it requires several changes to existing moveit_config packages: as the service capability would be renamed (from MoveGroupExecuteService to MoveGroupExecuteAction all move_group.launch files would need an update.

However, I could think of a slow transition, adding the new capability in Kinetic and loading both the old and new capability in newly created move_config packages. In some later release we could remove the old service capability, hoping that meanwhile everybody has adapted their move configs.
What do you think of that idea?

rhaschke added 2 commits July 16, 2016 17:22
As execute service request might block (waiting for trajectory execution to finish),
processing of other events/callbacks from the main spinner thread would be blocked.
@rhaschke
Copy link
Copy Markdown
Contributor Author

If accepted, this PR should be applied to Jade and Kinetic as well. It's an important bug fix.

// We need to serve each service request in a thread independent of the main spinner thread.
// Otherwise, a synchronous execution request (i.e. waiting for the execution to finish) would block
// execution of the main spinner thread.
// Hence, we use an own asynchronous spinner listening to our own callback queue.
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.

"we use our own"

@davetcoleman
Copy link
Copy Markdown
Member

+1 after code-reviewing, would appreciate someone (doesn't have to be a maintainer) verifying this does as stated

@davetcoleman
Copy link
Copy Markdown
Member

However, I could think of a slow transition, adding the new capability in Kinetic and loading both the old and new capability in newly created move_config packages. In some later release we could remove the old service capability, hoping that meanwhile everybody has adapted their move configs.

+1

@rhaschke
Copy link
Copy Markdown
Contributor Author

Considered review comments.

@rhaschke
Copy link
Copy Markdown
Contributor Author

With #716 this PR isn't strictly necessary anymore. However,, as it is bad programming practice to block the main spinner thread, I suggest to merge anyway. Implementation provides a nice example how to solve similar situations.

@davetcoleman
Copy link
Copy Markdown
Member

thanks!

also - i notice you pushed the branch directly to the ros-planning org - i think its cleaner practice to keep your own branch on your fork, so that we don't have to occasionally cleanout forgotten branches (which I've done several times for MoveIt) and so users can quickly find relevant *-devel branches

@rhaschke rhaschke deleted the fix-traj-service branch July 19, 2016 19:30
rhaschke added a commit that referenced this pull request Jul 19, 2016
serve ExecuteService from separate spinner thread
rhaschke added a commit that referenced this pull request Jul 20, 2016
rhaschke added a commit that referenced this pull request Jul 21, 2016
serve ExecuteService from separate spinner thread
rhaschke added a commit that referenced this pull request Jul 21, 2016
otamachan pushed a commit to otamachan/moveit_ros that referenced this pull request Oct 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants