Skip to content

Commit 5715fc3

Browse files
author
Minggang Wang
committed
Correct the description of sendGoal function
Fix #689
1 parent 3eb5077 commit 5715fc3

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

lib/action/client.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ class ActionClient extends Entity {
188188
}
189189

190190
/**
191-
* Send a goal and asynchronously get the result.
191+
* Send a goal and wait for the goal ACK asynchronously.
192192
*
193-
* The result of the returned Promise is set to a ClientGoalHandle when receipt of the goal
194-
* is acknowledged by an action server.
193+
* Return a Promise object that is resolved with a ClientGoalHandle when receipt of the goal
194+
* is acknowledged by an action server, see client state transition https://index.ros.org/doc/ros2/Tutorials/Understanding-ROS2-Actions/
195195
*
196196
* @param {object} goal - The goal request.
197197
* @param {function} feedbackCallback - Callback function for feedback associated with the goal.
@@ -259,7 +259,7 @@ class ActionClient extends Entity {
259259
if (timeout !== undefined && timeout >= -1) {
260260
waitMs = Math.min(waitMs, deadline - Date.now());
261261
}
262-
await new Promise(resolve => setTimeout(resolve, waitMs));
262+
await new Promise((resolve) => setTimeout(resolve, waitMs));
263263
serviceAvailable = this.isActionServerAvailable();
264264
}
265265
return serviceAvailable;
@@ -305,7 +305,10 @@ class ActionClient extends Entity {
305305
}
306306

307307
/**
308-
* Request the result for an active goal asynchronously.
308+
* Get the result of an active goal asynchronously.
309+
*
310+
* Return a Promise object that is resolved with result, see client state transition https://index.ros.org/doc/ros2/Tutorials/Understanding-ROS2-Actions/
311+
*
309312
* @ignore
310313
* @param {ClientGoalHandle} goalHandle - Handle to the goal to cancel.
311314
* @returns {Promise} - A Promise that resolves when the get result request has been processed.

types/action_client.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ declare module 'rclnodejs' {
9999
);
100100

101101
/**
102-
* Send a goal and asynchronously get the result.
102+
* Send a goal and wait for the goal ACK asynchronously.
103103
*
104-
* The result of the returned Promise is set to a ClientGoalHandle when receipt of the goal
105-
* is acknowledged by an action server.
104+
* Return a Promise object that is resolved with a ClientGoalHandle when receipt of the goal
105+
* is acknowledged by an action server, see client state transition https://index.ros.org/doc/ros2/Tutorials/Understanding-ROS2-Actions/
106106
*
107107
* @param goal - The goal request.
108108
* @param feedbackCallback - Callback function for feedback associated with the goal.

0 commit comments

Comments
 (0)