Class ActionClient
Full interface to an ActionServer ActionClient provides a complete client side implementation of the ActionInterface protocol.
It provides callbacks for every client side transition, giving the user full observation into the client side state machine.
Methods
ActionClient:shutdown () | Shutdown the action client. |
ActionClient:createGoal () | Creates a goal message that can be filled and then sent via the sendGoal() method. |
ActionClient:sendGoal (transition_cb, feedback_cb) | Sends a goal to the ActionServer, and also registers callbacks |
ActionClient:cancelGoalsAtAndBeforeTime (time) | Cancel all goals that were stamped at and before the specified time
All goals stamped at or before time will be canceled |
ActionClient:cancelAllGoals () | Cancel 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. |
ActionClient:waitForActionServerToStart (timeout) | Waits for the ActionServer to connect to this client Often, it can take a second for the action server & client to negotiate a connection, thus, risking the first few goals to be dropped. |
ActionClient:isServerConnected () | Checks if the action client is successfully connected to the action server |
Methods
- ActionClient:shutdown ()
- Shutdown the action client.
- ActionClient:createGoal ()
- Creates a goal message that can be filled and then sent via the sendGoal() method.
- ActionClient:sendGoal (transition_cb, feedback_cb)
-
Sends a goal to the ActionServer, and also registers callbacks
Parameters:
- transition_cb Callback that gets called on every client state transition
- feedback_cb Callback that gets called whenever feedback for this goal is received
- ActionClient:cancelGoalsAtAndBeforeTime (time)
-
Cancel all goals that were stamped at and before the specified time
All goals stamped at or before
time
will be canceledParameters:
- time
- ActionClient:cancelAllGoals ()
- Cancel 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.
- ActionClient:waitForActionServerToStart (timeout)
-
Waits for the ActionServer to connect to this client
Often, it can take a second for the action server & client to negotiate
a connection, thus, risking the first few goals to be dropped. This call lets
the user wait until the network connection to the server is negotiated
NOTE: Using this call in a single threaded ROS application, or any
application where the action client's callback queue is not being
serviced, will not work. Without a separate thread servicing the queue, or
a multi-threaded spinner, there is no way for the client to tell whether
or not the server is up because it can't receive a status message.
Parameters:
- timeout Max 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
- ActionClient:isServerConnected ()
-
Checks if the action client is successfully connected to the action server
Returns:
-
True if the server is connected, false otherwise