Public Member Functions | Public Attributes | Private Member Functions | List of all members
actionlib.simple_action_client.SimpleActionClient Class Reference

Public Member Functions

def __init__ (self, ns, ActionSpec)
 Constructs a SimpleActionClient and opens connections to an ActionServer. More...
 
def cancel_all_goals (self)
 Cancels all goals currently running on the action server. More...
 
def cancel_goal (self)
 Cancels the goal that we are currently pursuing. More...
 
def cancel_goals_at_and_before_time (self, time)
 Cancels all goals prior to a given timestamp. More...
 
def get_goal_status_text (self)
 Returns the current status text of the goal. More...
 
def get_result (self)
 Gets the Result of the current goal. More...
 
def get_state (self)
 Get the state information for this goal. More...
 
def send_goal (self, goal, done_cb=None, active_cb=None, feedback_cb=None)
 Sends a goal to the ActionServer, and also registers callbacks. More...
 
def send_goal_and_wait (self, goal, execute_timeout=rospy.Duration(), preempt_timeout=rospy.Duration())
 Sends a goal to the ActionServer, waits for the goal to complete, and preempts goal is necessary. More...
 
def stop_tracking_goal (self)
 Stops tracking the state of the current goal. More...
 
def wait_for_result (self, timeout=rospy.Duration())
 Blocks until this goal transitions to done. More...
 
def wait_for_server (self, timeout=rospy.Duration())
 Blocks until the action server connects to this client. More...
 

Public Attributes

 action_client
 
 active_cb
 
 done_cb
 
 done_condition
 
 feedback_cb
 
 gh
 
 simple_state
 

Private Member Functions

def _handle_feedback (self, gh, feedback)
 
def _handle_transition (self, gh)
 
def _set_simple_state (self, state)
 

Detailed Description

Definition at line 46 of file simple_action_client.py.

Constructor & Destructor Documentation

◆ __init__()

def actionlib.simple_action_client.SimpleActionClient.__init__ (   self,
  ns,
  ActionSpec 
)

Constructs a SimpleActionClient and opens connections to an ActionServer.

Parameters
nsThe namespace in which to access the action. For example, the "goal" topic should occur under ns/goal
ActionSpecThe *Action message type. The SimpleActionClient will grab the other message types from this type.

Definition at line 54 of file simple_action_client.py.

Member Function Documentation

◆ _handle_feedback()

def actionlib.simple_action_client.SimpleActionClient._handle_feedback (   self,
  gh,
  feedback 
)
private

Definition at line 247 of file simple_action_client.py.

◆ _handle_transition()

def actionlib.simple_action_client.SimpleActionClient._handle_transition (   self,
  gh 
)
private

Definition at line 214 of file simple_action_client.py.

◆ _set_simple_state()

def actionlib.simple_action_client.SimpleActionClient._set_simple_state (   self,
  state 
)
private

Definition at line 260 of file simple_action_client.py.

◆ cancel_all_goals()

def actionlib.simple_action_client.SimpleActionClient.cancel_all_goals (   self)

Cancels all goals currently running on the action server.

This preempts all goals running on the action server at the point that this message is serviced by the ActionServer.

Definition at line 191 of file simple_action_client.py.

◆ cancel_goal()

def actionlib.simple_action_client.SimpleActionClient.cancel_goal (   self)

Cancels the goal that we are currently pursuing.

Definition at line 203 of file simple_action_client.py.

◆ cancel_goals_at_and_before_time()

def actionlib.simple_action_client.SimpleActionClient.cancel_goals_at_and_before_time (   self,
  time 
)

Cancels all goals prior to a given timestamp.

This preempts all goals running on the action server for which the time stamp is earlier than the specified time stamp this message is serviced by the ActionServer.

Definition at line 199 of file simple_action_client.py.

◆ get_goal_status_text()

def actionlib.simple_action_client.SimpleActionClient.get_goal_status_text (   self)

Returns the current status text of the goal.

The text is sent by the action server. It is designed to help debugging issues on the server side.

Returns
The current status text of the goal.

Definition at line 180 of file simple_action_client.py.

◆ get_result()

def actionlib.simple_action_client.SimpleActionClient.get_result (   self)

Gets the Result of the current goal.

Definition at line 148 of file simple_action_client.py.

◆ get_state()

def actionlib.simple_action_client.SimpleActionClient.get_state (   self)

Get the state information for this goal.

Possible States Are: PENDING, ACTIVE, RECALLED, REJECTED, PREEMPTED, ABORTED, SUCCEEDED, LOST.

Returns
The goal's state. Returns LOST if this SimpleActionClient isn't tracking a goal.

Definition at line 162 of file simple_action_client.py.

◆ send_goal()

def actionlib.simple_action_client.SimpleActionClient.send_goal (   self,
  goal,
  done_cb = None,
  active_cb = None,
  feedback_cb = None 
)

Sends a goal to the ActionServer, and also registers callbacks.

If a previous goal is already active when this is called. We simply forget about that goal and start tracking the new goal. No cancel requests are made.

Parameters
done_cbCallback that gets called on transitions to Done. The callback should take two parameters: the terminal state (as an integer from actionlib_msgs/GoalStatus) and the result.
active_cbNo-parameter callback that gets called on transitions to Active.
feedback_cbCallback that gets called whenever feedback for this goal is received. Takes one parameter: the feedback.

Definition at line 83 of file simple_action_client.py.

◆ send_goal_and_wait()

def actionlib.simple_action_client.SimpleActionClient.send_goal_and_wait (   self,
  goal,
  execute_timeout = rospy.Duration(),
  preempt_timeout = rospy.Duration() 
)

Sends a goal to the ActionServer, waits for the goal to complete, and preempts goal is necessary.

If a previous goal is already active when this is called. We simply forget about that goal and start tracking the new goal. No cancel requests are made.

If the goal does not complete within the execute_timeout, the goal gets preempted

If preemption of the goal does not complete withing the preempt_timeout, this method simply returns

Parameters
execute_timeoutThe time to wait for the goal to complete
preempt_timeoutThe time to wait for preemption to complete
Returns
The goal's state.

Definition at line 109 of file simple_action_client.py.

◆ stop_tracking_goal()

def actionlib.simple_action_client.SimpleActionClient.stop_tracking_goal (   self)

Stops tracking the state of the current goal.

Unregisters this goal's callbacks

This is useful if we want to make sure we stop calling our callbacks before sending a new goal. Note that this does not cancel the goal, it simply stops looking for status info about this goal.

Definition at line 211 of file simple_action_client.py.

◆ wait_for_result()

def actionlib.simple_action_client.SimpleActionClient.wait_for_result (   self,
  timeout = rospy.Duration() 
)

Blocks until this goal transitions to done.

Parameters
timeoutMax time to block before returning. A zero timeout is interpreted as an infinite timeout.
Returns
True if the goal finished. False if the goal didn't finish within the allocated timeout

Definition at line 124 of file simple_action_client.py.

◆ wait_for_server()

def actionlib.simple_action_client.SimpleActionClient.wait_for_server (   self,
  timeout = rospy.Duration() 
)

Blocks until the action server connects to this client.

Parameters
timeoutMax time to block before returning. A zero timeout is interpreted as an infinite timeout.
Returns
True if the server connected in the allocated time. False on timeout

Definition at line 66 of file simple_action_client.py.

Member Data Documentation

◆ action_client

actionlib.simple_action_client.SimpleActionClient.action_client

Definition at line 55 of file simple_action_client.py.

◆ active_cb

actionlib.simple_action_client.SimpleActionClient.active_cb

Definition at line 88 of file simple_action_client.py.

◆ done_cb

actionlib.simple_action_client.SimpleActionClient.done_cb

Definition at line 87 of file simple_action_client.py.

◆ done_condition

actionlib.simple_action_client.SimpleActionClient.done_condition

Definition at line 58 of file simple_action_client.py.

◆ feedback_cb

actionlib.simple_action_client.SimpleActionClient.feedback_cb

Definition at line 89 of file simple_action_client.py.

◆ gh

actionlib.simple_action_client.SimpleActionClient.gh

Definition at line 57 of file simple_action_client.py.

◆ simple_state

actionlib.simple_action_client.SimpleActionClient.simple_state

Definition at line 56 of file simple_action_client.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