Constructor
new ActionClient(node, typeClass, actionName, options)
Creates a new action client.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
node |
Node | The ROS node to add the action client to. | |||||||||||||||||||||||||||
typeClass |
function | string | object | Type of the action. | |||||||||||||||||||||||||||
actionName |
string | Name of the action. | |||||||||||||||||||||||||||
options |
object | Action client options.
Properties
|
- Source:
Methods
destroy() → {undefined}
Destroy the underlying action client handle.
- Source:
Returns:
- Type
- undefined
isActionServerAvailable() → {boolean}
Check if there is an action server ready to process requests from this client.
- Source:
Returns:
True if an action server is ready; otherwise, false.
- Type
- boolean
sendGoal(goal, feedbackCallback, goalUuid) → {Promise}
Send a goal and asynchronously get the result.
The result of the returned Promise is set to a ClientGoalHandle when receipt of the goal
is acknowledged by an action server.
Parameters:
Name | Type | Description |
---|---|---|
goal |
object | The goal request. |
feedbackCallback |
function | Callback function for feedback associated with the goal. |
goalUuid |
object | Universally unique identifier for the goal. If None, then a random UUID is generated. |
- Source:
Returns:
- A Promise to a goal handle that resolves when the goal request has been accepted or rejected.
- Type
- Promise
(async) waitForServer(timeout) → {Promise.<boolean>}
Wait until the action server is available or a timeout is reached. This
function polls for the server state so it may not return as soon as the
server is available.
Parameters:
Name | Type | Description |
---|---|---|
timeout |
number | The maximum amount of time to wait for, if timeout is `undefined` or `< 0`, this will wait indefinitely. |
- Source:
Returns:
true if the service is available.
- Type
- Promise.<boolean>