Class: ActionClient

ActionClient(node, typeClass, actionName, options)

- ROS Action client.

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
Name Type Description
enableTypedArray boolean The topic will use TypedArray if necessary, default: true.
qos object ROS Middleware "quality of service" options.
Properties
Name Type Description
goalServiceQosProfile QoS Quality of service option for the goal service, default: QoS.profileServicesDefault.
resultServiceQosProfile QoS Quality of service option for the result service, default: QoS.profileServicesDefault.
cancelServiceQosProfile QoS Quality of service option for the cancel service, default: QoS.profileServicesDefault..
feedbackSubQosProfile QoS Quality of service option for the feedback subscription, default: new QoS(QoS.HistoryPolicy.RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT, 10).
statusSubQosProfile QoS Quality of service option for the status subscription, default: QoS.profileActionStatusDefault.
Source:

Methods

configureIntrospection(clock, qos, introspectionState)

Configure introspection.
Parameters:
Name Type Description
clock Clock Clock to use for service event timestamps
qos QoS QoSProfile for the service event publisher
introspectionState ServiceIntrospectionState State to set introspection to
Source:

destroy() → {undefined}

Destroy the underlying action client handle.
Source:
Returns:
Type
undefined

getNumEntities() → {object}

Get the number of wait set entities that make up an action entity.
Properties:
Name Type Description
subscriptionsNumber number The number of subscriptions.
guardConditionsNumber number The number of guard conditions.
timersNumber number The number of timers.
clientsNumber number The number of clients.
servicesNumber number The number of services.
Source:
Returns:
- An object containing the number of various entities.
Type
object

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 wait for the goal ACK asynchronously. Return a Promise object that is resolved with a ClientGoalHandle when receipt of the goal is acknowledged by an action server, see client state transition https://docs.ros.org/en/jazzy/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Actions/Understanding-ROS2-Actions.html
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>