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 roseus_resume support #488

Merged
merged 1 commit into from
Oct 27, 2022
Merged

Conversation

Affonso-Gui
Copy link
Member

Solution for #485.

if we need to install all action client, may be we try to find them from program code

I have taken this approach, searching and stopping all instances of ros::simple-action-client registered as slots in the robot-interface instance.
https://github.com/Affonso-Gui/roseus_resume/blob/eus10/euslisp/interruption-handler.l#L60-L70

The initialization code is then moved to robot-interface, and can be enabled by default in other robots without any modification. Roseus_resume will be automatically disabled on eus9 or when the package is not found, and can also be manually disabled by setting the *enable-roseus-resume* variable to nil.

(setq *enable-roseus-resume* nil)
(pr2-init)

Other (user-defined) actions can also be registered as interruption targets by further calling the roseus_resume:install-interruption-handler function.

(pr2-init)
(roseus_resume:install-interruption-handler *ri*
  my-action-client
  my-other-action-client)

If the user doesn't want to interrupt a certain action, this can be achieved by overwriting the :get-action-status, :interrupt-angle-vector, or roseus_resume:on-interruption.
The last one is preferred for local overwrites.

(handler-bind ((roseus_resume:on-interruption
                #'(lambda (c)
                    (send *ri* :interrupt-angle-vector
                          (remove gripper-controller (send c :status))))))
  (do-something))

@knorth55
Copy link
Member

Good!

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.

3 participants