Public Member Functions | Public Attributes | List of all members
actionlib.action_server.ActionServer Class Reference

The ActionServer is a helpful tool for managing goal requests to a node. More...

Inheritance diagram for actionlib.action_server.ActionServer:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, ns, ActionSpec, goal_cb, cancel_cb=nop_cb, auto_start=True)
 Constructor for an ActionServer. More...
 
def initialize (self)
 Initialize all ROS connections and setup timers. More...
 
def internal_cancel_callback (self, goal_id)
 The ROS callback for cancel requests coming into the ActionServer. More...
 
def internal_goal_callback (self, goal)
 The ROS callback for goals coming into the ActionServer. More...
 
def publish_feedback (self, status, feedback)
 Publishes feedback for a given goal. More...
 
def publish_result (self, status, result)
 Publishes a result for a given goal. More...
 
def publish_status (self)
 Explicitly publish status. More...
 
def publish_status_async (self)
 Publish status for all goals on a timer event. More...
 
def register_cancel_callback (self, cancel_cb)
 Register a callback to be invoked when a new cancel is received, this will replace any previously registered callback. More...
 
def register_goal_callback (self, cb)
 Register a callback to be invoked when a new goal is received, this will replace any previously registered callback. More...
 
def start (self)
 Start the action server. More...
 

Public Attributes

 ActionFeedback
 
 ActionGoal
 
 ActionResult
 
 ActionResultType
 
 ActionSpec
 
 auto_start
 
 cancel_callback
 
 cancel_sub
 
 feedback_pub
 
 goal_callback
 
 goal_sub
 
 id_generator
 
 last_cancel
 
 lock
 
 ns
 
 pub_queue_size
 
 result_pub
 
 started
 
 status_frequency
 
 status_list
 
 status_list_timeout
 
 status_pub
 
 status_timer
 
 sub_queue_size
 

Detailed Description

The ActionServer is a helpful tool for managing goal requests to a node.

It allows the user to specify callbacks that are invoked when goal or cancel requests come over the wire, and passes back GoalHandles that can be used to track the state of a given goal request. The ActionServer makes no assumptions about the policy used to service these goals, and sends status for each goal over the wire until the last GoalHandle associated with a goal request is destroyed.

Definition at line 69 of file action_server.py.

Constructor & Destructor Documentation

◆ __init__()

def actionlib.action_server.ActionServer.__init__ (   self,
  ns,
  ActionSpec,
  goal_cb,
  cancel_cb = nop_cb,
  auto_start = True 
)

Constructor for an ActionServer.

Parameters
ns/nameA namespace for the action server
actionspecAn explicit specification of the action
goal_cbA goal callback to be called when the ActionServer receives a new goal over the wire
cancel_cbA cancel callback to be called when the ActionServer receives a new cancel request over the wire
auto_startA boolean value that tells the ActionServer wheteher or not to start publishing as soon as it comes up. THIS SHOULD ALWAYS BE SET TO FALSE TO AVOID RACE CONDITIONS and start() should be called after construction of the server.

Definition at line 76 of file action_server.py.

Member Function Documentation

◆ initialize()

def actionlib.action_server.ActionServer.initialize (   self)

Initialize all ROS connections and setup timers.

Definition at line 138 of file action_server.py.

◆ internal_cancel_callback()

def actionlib.action_server.ActionServer.internal_cancel_callback (   self,
  goal_id 
)

The ROS callback for cancel requests coming into the ActionServer.

Definition at line 198 of file action_server.py.

◆ internal_goal_callback()

def actionlib.action_server.ActionServer.internal_goal_callback (   self,
  goal 
)

The ROS callback for goals coming into the ActionServer.

Definition at line 252 of file action_server.py.

◆ publish_feedback()

def actionlib.action_server.ActionServer.publish_feedback (   self,
  status,
  feedback 
)

Publishes feedback for a given goal.

Parameters
statusThe status of the goal with which the feedback is associated
feedbackThe feedback to publish

Definition at line 188 of file action_server.py.

◆ publish_result()

def actionlib.action_server.ActionServer.publish_result (   self,
  status,
  result 
)

Publishes a result for a given goal.

Parameters
statusThe status of the goal with which the result is associated
resultThe result to publish

Definition at line 175 of file action_server.py.

◆ publish_status()

def actionlib.action_server.ActionServer.publish_status (   self)

Explicitly publish status.

Definition at line 304 of file action_server.py.

◆ publish_status_async()

def actionlib.action_server.ActionServer.publish_status_async (   self)

Publish status for all goals on a timer event.

Definition at line 296 of file action_server.py.

◆ register_cancel_callback()

def actionlib.action_server.ActionServer.register_cancel_callback (   self,
  cancel_cb 
)

Register a callback to be invoked when a new cancel is received, this will replace any previously registered callback.

Parameters
cbThe callback to invoke

Definition at line 127 of file action_server.py.

◆ register_goal_callback()

def actionlib.action_server.ActionServer.register_goal_callback (   self,
  cb 
)

Register a callback to be invoked when a new goal is received, this will replace any previously registered callback.

Parameters
cbThe callback to invoke

Definition at line 122 of file action_server.py.

◆ start()

def actionlib.action_server.ActionServer.start (   self)

Start the action server.

Definition at line 131 of file action_server.py.

Member Data Documentation

◆ ActionFeedback

actionlib.action_server.ActionServer.ActionFeedback

Definition at line 86 of file action_server.py.

◆ ActionGoal

actionlib.action_server.ActionServer.ActionGoal

Definition at line 83 of file action_server.py.

◆ ActionResult

actionlib.action_server.ActionServer.ActionResult

Definition at line 84 of file action_server.py.

◆ ActionResultType

actionlib.action_server.ActionServer.ActionResultType

Definition at line 85 of file action_server.py.

◆ ActionSpec

actionlib.action_server.ActionServer.ActionSpec

Definition at line 82 of file action_server.py.

◆ auto_start

actionlib.action_server.ActionServer.auto_start

Definition at line 111 of file action_server.py.

◆ cancel_callback

actionlib.action_server.ActionServer.cancel_callback

Definition at line 110 of file action_server.py.

◆ cancel_sub

actionlib.action_server.ActionServer.cancel_sub

Definition at line 91 of file action_server.py.

◆ feedback_pub

actionlib.action_server.ActionServer.feedback_pub

Definition at line 94 of file action_server.py.

◆ goal_callback

actionlib.action_server.ActionServer.goal_callback

Definition at line 107 of file action_server.py.

◆ goal_sub

actionlib.action_server.ActionServer.goal_sub

Definition at line 90 of file action_server.py.

◆ id_generator

actionlib.action_server.ActionServer.id_generator

Definition at line 105 of file action_server.py.

◆ last_cancel

actionlib.action_server.ActionServer.last_cancel

Definition at line 102 of file action_server.py.

◆ lock

actionlib.action_server.ActionServer.lock

Definition at line 96 of file action_server.py.

◆ ns

actionlib.action_server.ActionServer.ns

Definition at line 77 of file action_server.py.

◆ pub_queue_size

actionlib.action_server.ActionServer.pub_queue_size

Definition at line 139 of file action_server.py.

◆ result_pub

actionlib.action_server.ActionServer.result_pub

Definition at line 93 of file action_server.py.

◆ started

actionlib.action_server.ActionServer.started

Definition at line 113 of file action_server.py.

◆ status_frequency

actionlib.action_server.ActionServer.status_frequency

Definition at line 157 of file action_server.py.

◆ status_list

actionlib.action_server.ActionServer.status_list

Definition at line 100 of file action_server.py.

◆ status_list_timeout

actionlib.action_server.ActionServer.status_list_timeout

Definition at line 103 of file action_server.py.

◆ status_pub

actionlib.action_server.ActionServer.status_pub

Definition at line 92 of file action_server.py.

◆ status_timer

actionlib.action_server.ActionServer.status_timer

Definition at line 98 of file action_server.py.

◆ sub_queue_size

actionlib.action_server.ActionServer.sub_queue_size

Definition at line 146 of file action_server.py.


The documentation for this class was generated from the following file:


actionlib
Author(s): Eitan Marder-Eppstein, Vijay Pradeep, Mikael Arguedas
autogenerated on Mon Feb 28 2022 21:34:39