Skip to content

What is the right way to define preemptable action servers? #671

@Affonso-Gui

Description

@Affonso-Gui

To accept /cancel messages from other topics during the execution of a ros::simple-action-server callback I had to use something like the following.

(defun execute-cb (server goal)
  ;; ...

  ;; Check for interruption
  (send server :spin-once)
  (when (send server :is-preempt-requested)
    (send server :set-preempted)
    (return-from execute-cb nil))

  ;; ...
)

Am I missing something here or is this actually the right way to do it?

Also I could not find any solid examples for the action server implementation, do we have any?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions