rclnodejs 0.21.2 → 0.21.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/linux-build-and-test-compatibility.yml +5 -3
- package/.github/workflows/linux-build-and-test.yml +2 -2
- package/.github/workflows/windows-build-and-test-compatibility.yml +5 -5
- package/.github/workflows/windows-build-and-test.yml +2 -2
- package/CONTRIBUTORS.md +6 -2
- package/README.md +1 -1
- package/binding.gyp +3 -3
- package/index.js +8 -4
- package/lib/action/client.js +6 -20
- package/lib/action/server.js +1 -1
- package/lib/action/uuid.js +28 -1
- package/lib/interface_loader.js +1 -1
- package/lib/node.js +1 -1
- package/package.json +2 -2
- package/scripts/npmjs-readme.md +1 -1
- package/types/action_server.d.ts +6 -4
- package/types/action_uuid.d.ts +58 -0
- package/types/base.d.ts +1 -0
- package/types/interfaces.d.ts +103 -0
- package/types/node.d.ts +29 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
name: rclnodejs - Linux Build & Compatibility Test
|
|
2
|
+
|
|
1
3
|
on:
|
|
2
4
|
workflow_dispatch:
|
|
3
5
|
|
|
@@ -14,7 +16,7 @@ jobs:
|
|
|
14
16
|
|
|
15
17
|
steps:
|
|
16
18
|
- name: Setup ROS2
|
|
17
|
-
uses: ros-tooling/setup-ros@v0.
|
|
19
|
+
uses: ros-tooling/setup-ros@v0.4
|
|
18
20
|
with:
|
|
19
21
|
required-ros-distributions: ${{ matrix.ros_distribution }}
|
|
20
22
|
|
|
@@ -39,14 +41,14 @@ jobs:
|
|
|
39
41
|
strategy:
|
|
40
42
|
fail-fast: false
|
|
41
43
|
matrix:
|
|
42
|
-
node-version: [10.X, 12.x, 14.X, 16.X, 17.X]
|
|
44
|
+
node-version: [10.X, 12.x, 14.X, 16.X, 17.X, 18.X, 19.X]
|
|
43
45
|
ros_distribution:
|
|
44
46
|
- foxy
|
|
45
47
|
- galactic
|
|
46
48
|
|
|
47
49
|
steps:
|
|
48
50
|
- name: Setup ROS2
|
|
49
|
-
uses: ros-tooling/setup-ros@v0.
|
|
51
|
+
uses: ros-tooling/setup-ros@v0.4
|
|
50
52
|
with:
|
|
51
53
|
required-ros-distributions: ${{ matrix.ros_distribution }}
|
|
52
54
|
|
|
@@ -26,7 +26,7 @@ jobs:
|
|
|
26
26
|
strategy:
|
|
27
27
|
fail-fast: false
|
|
28
28
|
matrix:
|
|
29
|
-
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X]
|
|
29
|
+
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X, 18.X, 19.X]
|
|
30
30
|
steps:
|
|
31
31
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
32
32
|
uses: actions/setup-node@v2
|
|
@@ -34,7 +34,7 @@ jobs:
|
|
|
34
34
|
node-version: ${{ matrix.node-version }}
|
|
35
35
|
|
|
36
36
|
- name: Setup ROS2
|
|
37
|
-
uses: ros-tooling/setup-ros@v0.
|
|
37
|
+
uses: ros-tooling/setup-ros@v0.4
|
|
38
38
|
with:
|
|
39
39
|
required-ros-distributions: ${{ needs.identify-ros-distro.outputs.distro }}
|
|
40
40
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
name: rclnodejs - Windows Build & Test
|
|
2
|
+
name: rclnodejs - Windows Build & Compatibility Test
|
|
3
3
|
|
|
4
4
|
on:
|
|
5
5
|
workflow_dispatch:
|
|
@@ -10,9 +10,9 @@ jobs:
|
|
|
10
10
|
strategy:
|
|
11
11
|
fail-fast: false
|
|
12
12
|
matrix:
|
|
13
|
-
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X]
|
|
13
|
+
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X, 18.X, 19.X]
|
|
14
14
|
ros_distribution:
|
|
15
|
-
- foxy
|
|
15
|
+
# - foxy
|
|
16
16
|
- galactic
|
|
17
17
|
- humble
|
|
18
18
|
- rolling
|
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
node-version: ${{ matrix.node-version }}
|
|
24
24
|
|
|
25
25
|
- name: Setup ROS2
|
|
26
|
-
uses: ros-tooling/setup-ros@v0.
|
|
26
|
+
uses: ros-tooling/setup-ros@v0.4
|
|
27
27
|
with:
|
|
28
28
|
required-ros-distributions: ${{ matrix.ros_distribution }}
|
|
29
29
|
|
|
@@ -48,5 +48,5 @@ jobs:
|
|
|
48
48
|
- name: Test rclnodejs
|
|
49
49
|
shell: cmd
|
|
50
50
|
run: |
|
|
51
|
-
call "c:\dev\${{
|
|
51
|
+
call "c:\dev\${{ matrix.ros_distribution }}\ros2-windows\setup.bat"
|
|
52
52
|
npm test
|
|
@@ -26,7 +26,7 @@ jobs:
|
|
|
26
26
|
strategy:
|
|
27
27
|
fail-fast: false
|
|
28
28
|
matrix:
|
|
29
|
-
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X]
|
|
29
|
+
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X, 18.X, 19.X]
|
|
30
30
|
steps:
|
|
31
31
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
32
32
|
uses: actions/setup-node@v2
|
|
@@ -34,7 +34,7 @@ jobs:
|
|
|
34
34
|
node-version: ${{ matrix.node-version }}
|
|
35
35
|
|
|
36
36
|
- name: Setup ROS2
|
|
37
|
-
uses: ros-tooling/setup-ros@v0.
|
|
37
|
+
uses: ros-tooling/setup-ros@v0.4
|
|
38
38
|
with:
|
|
39
39
|
required-ros-distributions: ${{ needs.identify-ros-distro.outputs.distro }}
|
|
40
40
|
|
package/CONTRIBUTORS.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
rclnodejs contributors (sorted alphabetically)
|
|
2
2
|
==============================================
|
|
3
3
|
|
|
4
|
+
* **[Alaa El Jawad](https://github.com/ejalaa12), [Ian McElroy](https://github.com/imcelroy)**
|
|
5
|
+
- Fix compatibility with ROS2 parameters array types
|
|
6
|
+
- Unit tests for all parameter types
|
|
7
|
+
- Handle concurrent ROS2 client calls, with unit tests
|
|
8
|
+
|
|
4
9
|
* **[Alex Mikhalev](https://github.com/amikhalev)**
|
|
5
10
|
* Fix build for AMENT_PREFIX_PATH with multiple entries
|
|
6
11
|
|
|
@@ -13,7 +18,7 @@ rclnodejs contributors (sorted alphabetically)
|
|
|
13
18
|
* Benchmark test script
|
|
14
19
|
|
|
15
20
|
* **[Kenny Yuan](https://github.com/kenny-y)**
|
|
16
|
-
* Message features: JS generation, typed arrays, plain JS object, compound msgs, many others...
|
|
21
|
+
* Message features: JS generation, typed arrays, plain JS object, compound msgs, many others...
|
|
17
22
|
* npm publish scripts
|
|
18
23
|
* Mac support
|
|
19
24
|
|
|
@@ -47,4 +52,3 @@ rclnodejs contributors (sorted alphabetically)
|
|
|
47
52
|
* ROS2 lifecycle node
|
|
48
53
|
* Rate class
|
|
49
54
|
* Node class hierarchy
|
|
50
|
-
|
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ npm i rclnodejs@x.y.z
|
|
|
45
45
|
|
|
46
46
|
| RCLNODEJS Version | Compatible ROS 2 Release |
|
|
47
47
|
| :-------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
48
|
-
| [0.21.
|
|
48
|
+
| [0.21.4 (current)](https://www.npmjs.com/package/rclnodejs/v/0.21.4) ([API](http://robotwebtools.org/rclnodejs/docs/0.21.3/index.html)) | [Humble Hawksbill](https://github.com/ros2/ros2/releases/tag/release-humble-20220523)<br>[Galactic Geochelone](https://github.com/ros2/ros2/releases/tag/release-galactic-20210716)<br>[Foxy Fitzroy](https://github.com/ros2/ros2/releases/tag/release-foxy-20201211)<br>[Eloquent Elusor](https://github.com/ros2/ros2/releases/tag/release-eloquent-20200124) |
|
|
49
49
|
| [0.10.3](https://github.com/RobotWebTools/rclnodejs/releases/tag/0.10.3) | [Dashing Diademata - Patch 4](https://github.com/ros2/ros2/releases/tag/release-dashing-20191018) |
|
|
50
50
|
|
|
51
51
|
## Documentation
|
package/binding.gyp
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
'OS_LINUX'
|
|
60
60
|
],
|
|
61
61
|
'cflags_cc': [
|
|
62
|
-
'-std=c++
|
|
62
|
+
'-std=c++17'
|
|
63
63
|
],
|
|
64
64
|
'include_dirs':
|
|
65
65
|
[
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
'OS_WINDOWS'
|
|
101
101
|
],
|
|
102
102
|
'cflags_cc': [
|
|
103
|
-
'-std=c++
|
|
103
|
+
'-std=c++17'
|
|
104
104
|
],
|
|
105
105
|
'include_dirs': [
|
|
106
106
|
'./src/third_party/dlfcn-win32/',
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
|
|
157
157
|
'CLANG_CXX_LIBRARY': 'libc++',
|
|
158
158
|
'MACOS_DEPLOYMENT_TARGET': '10.12',
|
|
159
|
-
'CLANG_CXX_LANGUAGE_STANDARD': 'c++
|
|
159
|
+
'CLANG_CXX_LANGUAGE_STANDARD': 'c++17'
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
],
|
package/index.js
CHANGED
|
@@ -42,6 +42,7 @@ const validator = require('./lib/validator.js');
|
|
|
42
42
|
const Time = require('./lib/time.js');
|
|
43
43
|
const ActionClient = require('./lib/action/client.js');
|
|
44
44
|
const ActionServer = require('./lib/action/server.js');
|
|
45
|
+
const ActionUuid = require('./lib/action/uuid.js');
|
|
45
46
|
const ClientGoalHandle = require('./lib/action/client_goal_handle.js');
|
|
46
47
|
const { CancelResponse, GoalResponse } = require('./lib/action/response.js');
|
|
47
48
|
const ServerGoalHandle = require('./lib/action/server_goal_handle.js');
|
|
@@ -80,13 +81,13 @@ async function getCurrentGeneratorVersion() {
|
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
83
|
|
|
84
|
+
let _rosVersionChecked = false;
|
|
85
|
+
|
|
83
86
|
/**
|
|
84
87
|
* A module that exposes the rclnodejs interfaces.
|
|
85
88
|
* @exports rclnodejs
|
|
86
89
|
*/
|
|
87
90
|
let rcl = {
|
|
88
|
-
_rosVersionChecked: false,
|
|
89
|
-
|
|
90
91
|
/** {@link Clock} class */
|
|
91
92
|
Clock: Clock,
|
|
92
93
|
|
|
@@ -150,6 +151,9 @@ let rcl = {
|
|
|
150
151
|
/** {@link ActionServer} class */
|
|
151
152
|
ActionServer: ActionServer,
|
|
152
153
|
|
|
154
|
+
/** {@link ActionUuid} class */
|
|
155
|
+
ActionUuid: ActionUuid,
|
|
156
|
+
|
|
153
157
|
/** {@link ClientGoalHandle} class */
|
|
154
158
|
ClientGoalHandle: ClientGoalHandle,
|
|
155
159
|
|
|
@@ -245,7 +249,7 @@ let rcl = {
|
|
|
245
249
|
|
|
246
250
|
rclnodejs.init(context.handle, argv);
|
|
247
251
|
|
|
248
|
-
if (
|
|
252
|
+
if (_rosVersionChecked) {
|
|
249
253
|
// no further processing required
|
|
250
254
|
return;
|
|
251
255
|
}
|
|
@@ -262,7 +266,7 @@ let rcl = {
|
|
|
262
266
|
|
|
263
267
|
await generator.generateAll(forced);
|
|
264
268
|
// TODO determine if tsd generateAll() should be here
|
|
265
|
-
|
|
269
|
+
_rosVersionChecked = true;
|
|
266
270
|
},
|
|
267
271
|
|
|
268
272
|
/**
|
package/lib/action/client.js
CHANGED
|
@@ -100,7 +100,7 @@ class ActionClient extends Entity {
|
|
|
100
100
|
);
|
|
101
101
|
|
|
102
102
|
if (goalHandle.accepted) {
|
|
103
|
-
let uuid = ActionUuid.
|
|
103
|
+
let uuid = ActionUuid.fromMessage(goalHandle.goalId).toString();
|
|
104
104
|
if (this._goalHandles.has(uuid)) {
|
|
105
105
|
throw new Error(`Two goals were accepted with the same ID (${uuid})`);
|
|
106
106
|
}
|
|
@@ -150,7 +150,7 @@ class ActionClient extends Entity {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
processFeedbackMessage(message) {
|
|
153
|
-
let uuid = ActionUuid.
|
|
153
|
+
let uuid = ActionUuid.fromMessage(message.goal_id).toString();
|
|
154
154
|
if (this._feedbackCallbacks.has(uuid)) {
|
|
155
155
|
this._feedbackCallbacks.get(uuid)(
|
|
156
156
|
message.toPlainObject(this.typedArrayEnabled).feedback
|
|
@@ -161,8 +161,8 @@ class ActionClient extends Entity {
|
|
|
161
161
|
processStatusMessage(message) {
|
|
162
162
|
// Update the status of all goal handles maintained by this Action Client
|
|
163
163
|
for (const statusMessage of message.status_list.data) {
|
|
164
|
-
let uuid = ActionUuid.
|
|
165
|
-
statusMessage.goal_info.goal_id
|
|
164
|
+
let uuid = ActionUuid.fromMessage(
|
|
165
|
+
statusMessage.goal_info.goal_id
|
|
166
166
|
).toString();
|
|
167
167
|
let status = statusMessage.status;
|
|
168
168
|
|
|
@@ -200,7 +200,7 @@ class ActionClient extends Entity {
|
|
|
200
200
|
*/
|
|
201
201
|
sendGoal(goal, feedbackCallback, goalUuid) {
|
|
202
202
|
let request = new this._typeClass.impl.SendGoalService.Request();
|
|
203
|
-
request['goal_id'] = goalUuid ||
|
|
203
|
+
request['goal_id'] = goalUuid || ActionUuid.randomMessage();
|
|
204
204
|
request.goal = goal;
|
|
205
205
|
|
|
206
206
|
let sequenceNumber = rclnodejs.actionSendGoalRequest(
|
|
@@ -215,7 +215,7 @@ class ActionClient extends Entity {
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
if (feedbackCallback) {
|
|
218
|
-
let uuid = ActionUuid.
|
|
218
|
+
let uuid = ActionUuid.fromMessage(request.goal_id).toString();
|
|
219
219
|
this._feedbackCallbacks.set(uuid, feedbackCallback);
|
|
220
220
|
}
|
|
221
221
|
|
|
@@ -345,20 +345,6 @@ class ActionClient extends Entity {
|
|
|
345
345
|
return deferred.promise;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
/**
|
|
349
|
-
* Creates a new random UUID message.
|
|
350
|
-
* @ignore
|
|
351
|
-
* @returns {object} - The new UUID message.
|
|
352
|
-
*/
|
|
353
|
-
_createRandomUuid() {
|
|
354
|
-
let uuid = ActionUuid.random();
|
|
355
|
-
|
|
356
|
-
let uuidMsg = new ActionInterfaces.UUID();
|
|
357
|
-
uuidMsg.uuid = uuid.bytes;
|
|
358
|
-
|
|
359
|
-
return uuidMsg;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
348
|
_removePendingGoalRequest(sequenceNumber) {
|
|
363
349
|
this._pendingGoalRequests.delete(sequenceNumber);
|
|
364
350
|
this._sequenceNumberGoalIdMap.delete(sequenceNumber);
|
package/lib/action/server.js
CHANGED
|
@@ -190,7 +190,7 @@ class ActionServer extends Entity {
|
|
|
190
190
|
*
|
|
191
191
|
* The purpose of the cancel callback is to decide if a request to cancel an on-going
|
|
192
192
|
* (or queued) goal should be accepted or rejected.
|
|
193
|
-
* The callback should take one parameter containing the cancel request and must return a
|
|
193
|
+
* The callback should take one parameter containing the cancel request (a goal handle) and must return a
|
|
194
194
|
* {@link CancelResponse} value.
|
|
195
195
|
*
|
|
196
196
|
* There can only be one cancel callback per {@link ActionServer}, therefore calling this
|
package/lib/action/uuid.js
CHANGED
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
|
|
15
15
|
'use strict';
|
|
16
16
|
|
|
17
|
+
const ActionInterfaces = require('./interfaces.js');
|
|
17
18
|
const { v4: uuidv4 } = require('uuid');
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* @class - Represents a unique identifier used by actions.
|
|
21
22
|
* @ignore
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
24
|
class ActionUuid {
|
|
25
25
|
/**
|
|
26
26
|
* Creates a new instance of ActionUuid.
|
|
@@ -73,6 +73,33 @@ class ActionUuid {
|
|
|
73
73
|
toString() {
|
|
74
74
|
return [].slice.call(this._bytes).join(',');
|
|
75
75
|
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Create an instance from a ROS2 UUID message
|
|
79
|
+
* @param {unique_identifier_msgs.msg.UUID} msg - The ROS2 UUID message
|
|
80
|
+
* @returns {ActionUuid} - The new instance.
|
|
81
|
+
*/
|
|
82
|
+
static fromMessage(msg) {
|
|
83
|
+
return ActionUuid.fromBytes(msg.uuid);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Create a ROS2 UUID message from this instance.
|
|
88
|
+
* @returns {unique_identifier_msgs.msg.UUID} - The new ROS2 UUID message
|
|
89
|
+
*/
|
|
90
|
+
toMessage() {
|
|
91
|
+
const uuidMsg = new ActionInterfaces.UUID();
|
|
92
|
+
uuidMsg.uuid = this.bytes;
|
|
93
|
+
return uuidMsg;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Create a ROS2 UUID message with random uuid data
|
|
98
|
+
* @returns {ActionUuid} - The new instance.
|
|
99
|
+
*/
|
|
100
|
+
static randomMessage() {
|
|
101
|
+
return ActionUuid.random().toMessage();
|
|
102
|
+
}
|
|
76
103
|
}
|
|
77
104
|
|
|
78
105
|
module.exports = ActionUuid;
|
package/lib/interface_loader.js
CHANGED
|
@@ -114,7 +114,7 @@ let interfaceLoader = {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
throw new Error(
|
|
117
|
-
`The message required does not exist: ${packageName}, ${type}, ${messageName}`
|
|
117
|
+
`The message required does not exist: ${packageName}, ${type}, ${messageName} at ${generator.generatedRoot}`
|
|
118
118
|
);
|
|
119
119
|
},
|
|
120
120
|
};
|
package/lib/node.js
CHANGED
|
@@ -1293,7 +1293,7 @@ class Node extends rclnodejs.ShadowNode {
|
|
|
1293
1293
|
* @return {ParameterDescriptor[]} - The parameter descriptors.
|
|
1294
1294
|
*/
|
|
1295
1295
|
getParameterDescriptors(names = []) {
|
|
1296
|
-
|
|
1296
|
+
let descriptors = [];
|
|
1297
1297
|
|
|
1298
1298
|
if (names.length == 0) {
|
|
1299
1299
|
// get all parameters
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rclnodejs",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.4",
|
|
4
4
|
"description": "ROS2.0 JavaScript client with Node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -89,6 +89,6 @@
|
|
|
89
89
|
]
|
|
90
90
|
},
|
|
91
91
|
"engines": {
|
|
92
|
-
"node": ">= 10.23.1 <
|
|
92
|
+
"node": ">= 10.23.1 <20.0.0"
|
|
93
93
|
}
|
|
94
94
|
}
|
package/scripts/npmjs-readme.md
CHANGED
|
@@ -45,7 +45,7 @@ npm i rclnodejs@x.y.z
|
|
|
45
45
|
|
|
46
46
|
| RCLNODEJS Version | Compatible ROS 2 Release |
|
|
47
47
|
| :-------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
48
|
-
| [0.21.
|
|
48
|
+
| [0.21.4 (current)](https://www.npmjs.com/package/rclnodejs/v/0.21.4) ([API](http://robotwebtools.org/rclnodejs/docs/0.21.3/index.html)) | [Humble Hawksbill](https://github.com/ros2/ros2/releases/tag/release-humble-20220523)<br>[Galactic Geochelone](https://github.com/ros2/ros2/releases/tag/release-galactic-20210716)<br>[Foxy Fitzroy](https://github.com/ros2/ros2/releases/tag/release-foxy-20201211)<br>[Eloquent Elusor](https://github.com/ros2/ros2/releases/tag/release-eloquent-20200124) |
|
|
49
49
|
| [0.10.3](https://github.com/RobotWebTools/rclnodejs/releases/tag/0.10.3) | [Dashing Diademata - Patch 4](https://github.com/ros2/ros2/releases/tag/release-dashing-20191018) |
|
|
50
50
|
|
|
51
51
|
## Documentation
|
package/types/action_server.d.ts
CHANGED
|
@@ -84,7 +84,9 @@ declare module 'rclnodejs' {
|
|
|
84
84
|
type HandleAcceptedCallback<T extends TypeClass<ActionTypeClassName>> = (
|
|
85
85
|
goalHandle: ServerGoalHandle<T>
|
|
86
86
|
) => void;
|
|
87
|
-
type CancelCallback
|
|
87
|
+
type CancelCallback<T extends TypeClass<ActionTypeClassName>> = (
|
|
88
|
+
goalHandle?: ServerGoalHandle<T>
|
|
89
|
+
) => Promise<CancelResponse> | CancelResponse;
|
|
88
90
|
|
|
89
91
|
interface ActionServerOptions extends Options<ActionQoS> {
|
|
90
92
|
/**
|
|
@@ -116,7 +118,7 @@ declare module 'rclnodejs' {
|
|
|
116
118
|
executeCallback: ExecuteCallback<T>,
|
|
117
119
|
goalCallback?: GoalCallback<T>,
|
|
118
120
|
handleAcceptedCallback?: HandleAcceptedCallback<T>,
|
|
119
|
-
cancelCallback?: CancelCallback
|
|
121
|
+
cancelCallback?: CancelCallback<T>,
|
|
120
122
|
options?: ActionServerOptions
|
|
121
123
|
);
|
|
122
124
|
|
|
@@ -153,14 +155,14 @@ declare module 'rclnodejs' {
|
|
|
153
155
|
*
|
|
154
156
|
* The purpose of the cancel callback is to decide if a request to cancel an on-going
|
|
155
157
|
* (or queued) goal should be accepted or rejected.
|
|
156
|
-
* The callback should take one parameter containing the cancel request and must return a
|
|
158
|
+
* The callback should take one parameter containing the cancel request ( a GoalHandle) and must return a
|
|
157
159
|
* {@link CancelResponse} value.
|
|
158
160
|
*
|
|
159
161
|
* There can only be one cancel callback per {@link ActionServer}, therefore calling this
|
|
160
162
|
* function will replace any previously registered callback.
|
|
161
163
|
* @param cancelCallback - Callback function, if not provided, then unregisters any previously registered callback.
|
|
162
164
|
*/
|
|
163
|
-
registerCancelCallback(cancelCallback?: CancelCallback): void;
|
|
165
|
+
registerCancelCallback(cancelCallback?: CancelCallback<T>): void;
|
|
164
166
|
|
|
165
167
|
/**
|
|
166
168
|
* Register a callback for executing action goals.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
declare module 'rclnodejs' {
|
|
2
|
+
/**
|
|
3
|
+
* @class - Represents a unique identifier used by actions.
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export class ActionUuid {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new instance of ActionUuid.
|
|
10
|
+
* @param bytes - The bytes to create the UUID from.
|
|
11
|
+
* A new random UUID will be created, if not provided.
|
|
12
|
+
*/
|
|
13
|
+
constructor(bytes?: Uint8Array);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new {@link ActionUuid} from the given bytes.
|
|
17
|
+
* @param bytes - The bytes to create the UUID from.
|
|
18
|
+
* @returns The new UUID.
|
|
19
|
+
*/
|
|
20
|
+
static fromBytes(byte: Uint8Array): ActionUuid;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new random {@link ActionUuid}.
|
|
24
|
+
* @returns The new UUID.
|
|
25
|
+
*/
|
|
26
|
+
static random(): ActionUuid;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Gets the bytes from the UUID.
|
|
30
|
+
*/
|
|
31
|
+
get bytes(): Uint8Array;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Returns the UUID as a string.
|
|
35
|
+
* @returns String representation of the UUID.
|
|
36
|
+
*/
|
|
37
|
+
toString(): string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Create an instance from a ROS2 UUID message
|
|
41
|
+
* @param msg - The ROS2 UUID message
|
|
42
|
+
* @returns The new instance.
|
|
43
|
+
*/
|
|
44
|
+
static fromMessage(msg: unique_identifier_msgs.msg.UUID): ActionUuid;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Create a ROS2 UUID message from this instance.
|
|
48
|
+
* @returns The new ROS2 UUID message
|
|
49
|
+
*/
|
|
50
|
+
toMessage(): unique_identifier_msgs.msg.UUID;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Create a ROS2 UUID message with random uuid data
|
|
54
|
+
* @returns The new instance.
|
|
55
|
+
*/
|
|
56
|
+
static randomMessage(): unique_identifier_msgs.msg.UUID;
|
|
57
|
+
}
|
|
58
|
+
}
|
package/types/base.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable spaced-comment */
|
|
2
2
|
/// <reference path="action_client.d.ts" />
|
|
3
3
|
/// <reference path="action_server.d.ts" />
|
|
4
|
+
/// <reference path="action_uuid.d.ts" />
|
|
4
5
|
/// <reference path="client.d.ts" />
|
|
5
6
|
/// <reference path="clock_type.d.ts" />
|
|
6
7
|
/// <reference path="clock.d.ts" />
|
package/types/interfaces.d.ts
CHANGED
|
@@ -1752,6 +1752,22 @@ declare module 'rclnodejs' {
|
|
|
1752
1752
|
|
|
1753
1753
|
namespace rosbag2_interfaces {
|
|
1754
1754
|
namespace srv {
|
|
1755
|
+
export interface BurstConstructor extends ROSService {
|
|
1756
|
+
readonly Request: Burst_RequestConstructor;
|
|
1757
|
+
readonly Response: Burst_ResponseConstructor;
|
|
1758
|
+
}
|
|
1759
|
+
export interface Burst_Request {
|
|
1760
|
+
num_messages: number;
|
|
1761
|
+
}
|
|
1762
|
+
export interface Burst_RequestConstructor {
|
|
1763
|
+
new(other?: Burst_Request): Burst_Request;
|
|
1764
|
+
}
|
|
1765
|
+
export interface Burst_Response {
|
|
1766
|
+
actually_burst: number;
|
|
1767
|
+
}
|
|
1768
|
+
export interface Burst_ResponseConstructor {
|
|
1769
|
+
new(other?: Burst_Response): Burst_Response;
|
|
1770
|
+
}
|
|
1755
1771
|
export interface GetRateConstructor extends ROSService {
|
|
1756
1772
|
readonly Request: GetRate_RequestConstructor;
|
|
1757
1773
|
readonly Response: GetRate_ResponseConstructor;
|
|
@@ -1857,6 +1873,21 @@ declare module 'rclnodejs' {
|
|
|
1857
1873
|
export interface SetRate_ResponseConstructor {
|
|
1858
1874
|
new(other?: SetRate_Response): SetRate_Response;
|
|
1859
1875
|
}
|
|
1876
|
+
export interface SnapshotConstructor extends ROSService {
|
|
1877
|
+
readonly Request: Snapshot_RequestConstructor;
|
|
1878
|
+
readonly Response: Snapshot_ResponseConstructor;
|
|
1879
|
+
}
|
|
1880
|
+
export interface Snapshot_Request {
|
|
1881
|
+
}
|
|
1882
|
+
export interface Snapshot_RequestConstructor {
|
|
1883
|
+
new(other?: Snapshot_Request): Snapshot_Request;
|
|
1884
|
+
}
|
|
1885
|
+
export interface Snapshot_Response {
|
|
1886
|
+
success: boolean;
|
|
1887
|
+
}
|
|
1888
|
+
export interface Snapshot_ResponseConstructor {
|
|
1889
|
+
new(other?: Snapshot_Response): Snapshot_Response;
|
|
1890
|
+
}
|
|
1860
1891
|
export interface TogglePausedConstructor extends ROSService {
|
|
1861
1892
|
readonly Request: TogglePaused_RequestConstructor;
|
|
1862
1893
|
readonly Response: TogglePaused_ResponseConstructor;
|
|
@@ -2252,12 +2283,14 @@ declare module 'rclnodejs' {
|
|
|
2252
2283
|
export interface SolidPrimitive {
|
|
2253
2284
|
type: number;
|
|
2254
2285
|
dimensions: number[] | Float64Array;
|
|
2286
|
+
polygon: geometry_msgs.msg.Polygon;
|
|
2255
2287
|
}
|
|
2256
2288
|
export interface SolidPrimitiveConstructor {
|
|
2257
2289
|
readonly BOX: number;
|
|
2258
2290
|
readonly SPHERE: number;
|
|
2259
2291
|
readonly CYLINDER: number;
|
|
2260
2292
|
readonly CONE: number;
|
|
2293
|
+
readonly PRISM: number;
|
|
2261
2294
|
readonly BOX_X: number;
|
|
2262
2295
|
readonly BOX_Y: number;
|
|
2263
2296
|
readonly BOX_Z: number;
|
|
@@ -2266,6 +2299,7 @@ declare module 'rclnodejs' {
|
|
|
2266
2299
|
readonly CYLINDER_RADIUS: number;
|
|
2267
2300
|
readonly CONE_HEIGHT: number;
|
|
2268
2301
|
readonly CONE_RADIUS: number;
|
|
2302
|
+
readonly PRISM_HEIGHT: number;
|
|
2269
2303
|
new(other?: SolidPrimitive): SolidPrimitive;
|
|
2270
2304
|
}
|
|
2271
2305
|
}
|
|
@@ -2772,6 +2806,41 @@ declare module 'rclnodejs' {
|
|
|
2772
2806
|
export interface BasicTypesConstructor {
|
|
2773
2807
|
new(other?: BasicTypes): BasicTypes;
|
|
2774
2808
|
}
|
|
2809
|
+
export interface BoundedPlainSequences {
|
|
2810
|
+
bool_values: boolean[];
|
|
2811
|
+
byte_values: number[] | Uint8Array;
|
|
2812
|
+
char_values: number[] | Int8Array;
|
|
2813
|
+
float32_values: number[] | Float32Array;
|
|
2814
|
+
float64_values: number[] | Float64Array;
|
|
2815
|
+
int8_values: number[] | Int8Array;
|
|
2816
|
+
uint8_values: number[] | Uint8Array;
|
|
2817
|
+
int16_values: number[] | Int16Array;
|
|
2818
|
+
uint16_values: number[] | Uint16Array;
|
|
2819
|
+
int32_values: number[] | Int32Array;
|
|
2820
|
+
uint32_values: number[] | Uint32Array;
|
|
2821
|
+
int64_values: number[];
|
|
2822
|
+
uint64_values: number[];
|
|
2823
|
+
basic_types_values: test_msgs.msg.BasicTypes[];
|
|
2824
|
+
constants_values: test_msgs.msg.Constants[];
|
|
2825
|
+
defaults_values: test_msgs.msg.Defaults[];
|
|
2826
|
+
bool_values_default: boolean[];
|
|
2827
|
+
byte_values_default: number[] | Uint8Array;
|
|
2828
|
+
char_values_default: number[] | Int8Array;
|
|
2829
|
+
float32_values_default: number[] | Float32Array;
|
|
2830
|
+
float64_values_default: number[] | Float64Array;
|
|
2831
|
+
int8_values_default: number[] | Int8Array;
|
|
2832
|
+
uint8_values_default: number[] | Uint8Array;
|
|
2833
|
+
int16_values_default: number[] | Int16Array;
|
|
2834
|
+
uint16_values_default: number[] | Uint16Array;
|
|
2835
|
+
int32_values_default: number[] | Int32Array;
|
|
2836
|
+
uint32_values_default: number[] | Uint32Array;
|
|
2837
|
+
int64_values_default: number[];
|
|
2838
|
+
uint64_values_default: number[];
|
|
2839
|
+
alignment_check: number;
|
|
2840
|
+
}
|
|
2841
|
+
export interface BoundedPlainSequencesConstructor {
|
|
2842
|
+
new(other?: BoundedPlainSequences): BoundedPlainSequences;
|
|
2843
|
+
}
|
|
2775
2844
|
export interface BoundedSequences {
|
|
2776
2845
|
bool_values: boolean[];
|
|
2777
2846
|
byte_values: number[] | Uint8Array;
|
|
@@ -3552,8 +3621,12 @@ declare module 'rclnodejs' {
|
|
|
3552
3621
|
frame_locked: boolean;
|
|
3553
3622
|
points: geometry_msgs.msg.Point[];
|
|
3554
3623
|
colors: std_msgs.msg.ColorRGBA[];
|
|
3624
|
+
texture_resource: string;
|
|
3625
|
+
texture: sensor_msgs.msg.CompressedImage;
|
|
3626
|
+
uv_coordinates: visualization_msgs.msg.UVCoordinate[];
|
|
3555
3627
|
text: string;
|
|
3556
3628
|
mesh_resource: string;
|
|
3629
|
+
mesh_file: visualization_msgs.msg.MeshFile;
|
|
3557
3630
|
mesh_use_embedded_materials: boolean;
|
|
3558
3631
|
}
|
|
3559
3632
|
export interface MarkerConstructor {
|
|
@@ -3594,6 +3667,20 @@ declare module 'rclnodejs' {
|
|
|
3594
3667
|
readonly ROSLAUNCH: number;
|
|
3595
3668
|
new(other?: MenuEntry): MenuEntry;
|
|
3596
3669
|
}
|
|
3670
|
+
export interface MeshFile {
|
|
3671
|
+
filename: string;
|
|
3672
|
+
data: number[] | Uint8Array;
|
|
3673
|
+
}
|
|
3674
|
+
export interface MeshFileConstructor {
|
|
3675
|
+
new(other?: MeshFile): MeshFile;
|
|
3676
|
+
}
|
|
3677
|
+
export interface UVCoordinate {
|
|
3678
|
+
u: number;
|
|
3679
|
+
v: number;
|
|
3680
|
+
}
|
|
3681
|
+
export interface UVCoordinateConstructor {
|
|
3682
|
+
new(other?: UVCoordinate): UVCoordinate;
|
|
3683
|
+
}
|
|
3597
3684
|
}
|
|
3598
3685
|
namespace srv {
|
|
3599
3686
|
export interface GetInteractiveMarkersConstructor extends ROSService {
|
|
@@ -3814,6 +3901,8 @@ declare module 'rclnodejs' {
|
|
|
3814
3901
|
'ros2cli_test_interfaces/msg/ShortVariedNested': ros2cli_test_interfaces.msg.ShortVariedNested,
|
|
3815
3902
|
'ros2cli_test_interfaces/srv/ShortVariedMultiNested_Request': ros2cli_test_interfaces.srv.ShortVariedMultiNested_Request,
|
|
3816
3903
|
'ros2cli_test_interfaces/srv/ShortVariedMultiNested_Response': ros2cli_test_interfaces.srv.ShortVariedMultiNested_Response,
|
|
3904
|
+
'rosbag2_interfaces/srv/Burst_Request': rosbag2_interfaces.srv.Burst_Request,
|
|
3905
|
+
'rosbag2_interfaces/srv/Burst_Response': rosbag2_interfaces.srv.Burst_Response,
|
|
3817
3906
|
'rosbag2_interfaces/srv/GetRate_Request': rosbag2_interfaces.srv.GetRate_Request,
|
|
3818
3907
|
'rosbag2_interfaces/srv/GetRate_Response': rosbag2_interfaces.srv.GetRate_Response,
|
|
3819
3908
|
'rosbag2_interfaces/srv/IsPaused_Request': rosbag2_interfaces.srv.IsPaused_Request,
|
|
@@ -3828,6 +3917,8 @@ declare module 'rclnodejs' {
|
|
|
3828
3917
|
'rosbag2_interfaces/srv/Seek_Response': rosbag2_interfaces.srv.Seek_Response,
|
|
3829
3918
|
'rosbag2_interfaces/srv/SetRate_Request': rosbag2_interfaces.srv.SetRate_Request,
|
|
3830
3919
|
'rosbag2_interfaces/srv/SetRate_Response': rosbag2_interfaces.srv.SetRate_Response,
|
|
3920
|
+
'rosbag2_interfaces/srv/Snapshot_Request': rosbag2_interfaces.srv.Snapshot_Request,
|
|
3921
|
+
'rosbag2_interfaces/srv/Snapshot_Response': rosbag2_interfaces.srv.Snapshot_Response,
|
|
3831
3922
|
'rosbag2_interfaces/srv/TogglePaused_Request': rosbag2_interfaces.srv.TogglePaused_Request,
|
|
3832
3923
|
'rosbag2_interfaces/srv/TogglePaused_Response': rosbag2_interfaces.srv.TogglePaused_Response,
|
|
3833
3924
|
'rosgraph_msgs/msg/Clock': rosgraph_msgs.msg.Clock,
|
|
@@ -3922,6 +4013,7 @@ declare module 'rclnodejs' {
|
|
|
3922
4013
|
'test_msgs/action/NestedMessage_SendGoal_Response': test_msgs.action.NestedMessage_SendGoal_Response,
|
|
3923
4014
|
'test_msgs/msg/Arrays': test_msgs.msg.Arrays,
|
|
3924
4015
|
'test_msgs/msg/BasicTypes': test_msgs.msg.BasicTypes,
|
|
4016
|
+
'test_msgs/msg/BoundedPlainSequences': test_msgs.msg.BoundedPlainSequences,
|
|
3925
4017
|
'test_msgs/msg/BoundedSequences': test_msgs.msg.BoundedSequences,
|
|
3926
4018
|
'test_msgs/msg/Builtins': test_msgs.msg.Builtins,
|
|
3927
4019
|
'test_msgs/msg/Constants': test_msgs.msg.Constants,
|
|
@@ -3985,6 +4077,8 @@ declare module 'rclnodejs' {
|
|
|
3985
4077
|
'visualization_msgs/msg/Marker': visualization_msgs.msg.Marker,
|
|
3986
4078
|
'visualization_msgs/msg/MarkerArray': visualization_msgs.msg.MarkerArray,
|
|
3987
4079
|
'visualization_msgs/msg/MenuEntry': visualization_msgs.msg.MenuEntry,
|
|
4080
|
+
'visualization_msgs/msg/MeshFile': visualization_msgs.msg.MeshFile,
|
|
4081
|
+
'visualization_msgs/msg/UVCoordinate': visualization_msgs.msg.UVCoordinate,
|
|
3988
4082
|
'visualization_msgs/srv/GetInteractiveMarkers_Request': visualization_msgs.srv.GetInteractiveMarkers_Request,
|
|
3989
4083
|
'visualization_msgs/srv/GetInteractiveMarkers_Response': visualization_msgs.srv.GetInteractiveMarkers_Response,
|
|
3990
4084
|
};
|
|
@@ -4191,6 +4285,8 @@ declare module 'rclnodejs' {
|
|
|
4191
4285
|
'ros2cli_test_interfaces/msg/ShortVariedNested': ros2cli_test_interfaces.msg.ShortVariedNestedConstructor,
|
|
4192
4286
|
'ros2cli_test_interfaces/srv/ShortVariedMultiNested_Request': ros2cli_test_interfaces.srv.ShortVariedMultiNested_RequestConstructor,
|
|
4193
4287
|
'ros2cli_test_interfaces/srv/ShortVariedMultiNested_Response': ros2cli_test_interfaces.srv.ShortVariedMultiNested_ResponseConstructor,
|
|
4288
|
+
'rosbag2_interfaces/srv/Burst_Request': rosbag2_interfaces.srv.Burst_RequestConstructor,
|
|
4289
|
+
'rosbag2_interfaces/srv/Burst_Response': rosbag2_interfaces.srv.Burst_ResponseConstructor,
|
|
4194
4290
|
'rosbag2_interfaces/srv/GetRate_Request': rosbag2_interfaces.srv.GetRate_RequestConstructor,
|
|
4195
4291
|
'rosbag2_interfaces/srv/GetRate_Response': rosbag2_interfaces.srv.GetRate_ResponseConstructor,
|
|
4196
4292
|
'rosbag2_interfaces/srv/IsPaused_Request': rosbag2_interfaces.srv.IsPaused_RequestConstructor,
|
|
@@ -4205,6 +4301,8 @@ declare module 'rclnodejs' {
|
|
|
4205
4301
|
'rosbag2_interfaces/srv/Seek_Response': rosbag2_interfaces.srv.Seek_ResponseConstructor,
|
|
4206
4302
|
'rosbag2_interfaces/srv/SetRate_Request': rosbag2_interfaces.srv.SetRate_RequestConstructor,
|
|
4207
4303
|
'rosbag2_interfaces/srv/SetRate_Response': rosbag2_interfaces.srv.SetRate_ResponseConstructor,
|
|
4304
|
+
'rosbag2_interfaces/srv/Snapshot_Request': rosbag2_interfaces.srv.Snapshot_RequestConstructor,
|
|
4305
|
+
'rosbag2_interfaces/srv/Snapshot_Response': rosbag2_interfaces.srv.Snapshot_ResponseConstructor,
|
|
4208
4306
|
'rosbag2_interfaces/srv/TogglePaused_Request': rosbag2_interfaces.srv.TogglePaused_RequestConstructor,
|
|
4209
4307
|
'rosbag2_interfaces/srv/TogglePaused_Response': rosbag2_interfaces.srv.TogglePaused_ResponseConstructor,
|
|
4210
4308
|
'rosgraph_msgs/msg/Clock': rosgraph_msgs.msg.ClockConstructor,
|
|
@@ -4299,6 +4397,7 @@ declare module 'rclnodejs' {
|
|
|
4299
4397
|
'test_msgs/action/NestedMessage_SendGoal_Response': test_msgs.action.NestedMessage_SendGoal_ResponseConstructor,
|
|
4300
4398
|
'test_msgs/msg/Arrays': test_msgs.msg.ArraysConstructor,
|
|
4301
4399
|
'test_msgs/msg/BasicTypes': test_msgs.msg.BasicTypesConstructor,
|
|
4400
|
+
'test_msgs/msg/BoundedPlainSequences': test_msgs.msg.BoundedPlainSequencesConstructor,
|
|
4302
4401
|
'test_msgs/msg/BoundedSequences': test_msgs.msg.BoundedSequencesConstructor,
|
|
4303
4402
|
'test_msgs/msg/Builtins': test_msgs.msg.BuiltinsConstructor,
|
|
4304
4403
|
'test_msgs/msg/Constants': test_msgs.msg.ConstantsConstructor,
|
|
@@ -4362,6 +4461,8 @@ declare module 'rclnodejs' {
|
|
|
4362
4461
|
'visualization_msgs/msg/Marker': visualization_msgs.msg.MarkerConstructor,
|
|
4363
4462
|
'visualization_msgs/msg/MarkerArray': visualization_msgs.msg.MarkerArrayConstructor,
|
|
4364
4463
|
'visualization_msgs/msg/MenuEntry': visualization_msgs.msg.MenuEntryConstructor,
|
|
4464
|
+
'visualization_msgs/msg/MeshFile': visualization_msgs.msg.MeshFileConstructor,
|
|
4465
|
+
'visualization_msgs/msg/UVCoordinate': visualization_msgs.msg.UVCoordinateConstructor,
|
|
4365
4466
|
'visualization_msgs/srv/GetInteractiveMarkers_Request': visualization_msgs.srv.GetInteractiveMarkers_RequestConstructor,
|
|
4366
4467
|
'visualization_msgs/srv/GetInteractiveMarkers_Response': visualization_msgs.srv.GetInteractiveMarkers_ResponseConstructor,
|
|
4367
4468
|
};
|
|
@@ -4399,6 +4500,7 @@ declare module 'rclnodejs' {
|
|
|
4399
4500
|
'rcl_interfaces/srv/SetParameters': rcl_interfaces.srv.SetParametersConstructor,
|
|
4400
4501
|
'rcl_interfaces/srv/SetParametersAtomically': rcl_interfaces.srv.SetParametersAtomicallyConstructor,
|
|
4401
4502
|
'ros2cli_test_interfaces/srv/ShortVariedMultiNested': ros2cli_test_interfaces.srv.ShortVariedMultiNestedConstructor,
|
|
4503
|
+
'rosbag2_interfaces/srv/Burst': rosbag2_interfaces.srv.BurstConstructor,
|
|
4402
4504
|
'rosbag2_interfaces/srv/GetRate': rosbag2_interfaces.srv.GetRateConstructor,
|
|
4403
4505
|
'rosbag2_interfaces/srv/IsPaused': rosbag2_interfaces.srv.IsPausedConstructor,
|
|
4404
4506
|
'rosbag2_interfaces/srv/Pause': rosbag2_interfaces.srv.PauseConstructor,
|
|
@@ -4406,6 +4508,7 @@ declare module 'rclnodejs' {
|
|
|
4406
4508
|
'rosbag2_interfaces/srv/Resume': rosbag2_interfaces.srv.ResumeConstructor,
|
|
4407
4509
|
'rosbag2_interfaces/srv/Seek': rosbag2_interfaces.srv.SeekConstructor,
|
|
4408
4510
|
'rosbag2_interfaces/srv/SetRate': rosbag2_interfaces.srv.SetRateConstructor,
|
|
4511
|
+
'rosbag2_interfaces/srv/Snapshot': rosbag2_interfaces.srv.SnapshotConstructor,
|
|
4409
4512
|
'rosbag2_interfaces/srv/TogglePaused': rosbag2_interfaces.srv.TogglePausedConstructor,
|
|
4410
4513
|
'sensor_msgs/srv/SetCameraInfo': sensor_msgs.srv.SetCameraInfoConstructor,
|
|
4411
4514
|
'std_srvs/srv/Empty': std_srvs.srv.EmptyConstructor,
|
package/types/node.d.ts
CHANGED
|
@@ -248,6 +248,21 @@ declare module 'rclnodejs' {
|
|
|
248
248
|
options?: Options
|
|
249
249
|
): Publisher<T>;
|
|
250
250
|
|
|
251
|
+
/**
|
|
252
|
+
* Create a Subscription.
|
|
253
|
+
*
|
|
254
|
+
* @param typeClass - Type of ROS messages the subscription will subscribe to
|
|
255
|
+
* @param topic - Name of the topic the subcription will subscribe to.
|
|
256
|
+
* @param callback - Called when a new message is received.
|
|
257
|
+
* The serialized message will be null-terminated.
|
|
258
|
+
* @returns New instance of Subscription.
|
|
259
|
+
*/
|
|
260
|
+
createSubscription<T extends TypeClass<MessageTypeClassName>>(
|
|
261
|
+
typeClass: T,
|
|
262
|
+
topic: string,
|
|
263
|
+
callback: SubscriptionCallback<T>
|
|
264
|
+
): Subscription;
|
|
265
|
+
|
|
251
266
|
/**
|
|
252
267
|
* Create a Subscription.
|
|
253
268
|
*
|
|
@@ -278,6 +293,20 @@ declare module 'rclnodejs' {
|
|
|
278
293
|
options?: Options
|
|
279
294
|
): Client<T>;
|
|
280
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Create a Service.
|
|
298
|
+
*
|
|
299
|
+
* @param typeClass - Service type
|
|
300
|
+
* @param serviceName - Name of the service.
|
|
301
|
+
* @param callback - Callback function for notification of incoming requests.
|
|
302
|
+
* @returns An instance of Service.
|
|
303
|
+
*/
|
|
304
|
+
createService<T extends TypeClass<ServiceTypeClassName>>(
|
|
305
|
+
typeClass: T,
|
|
306
|
+
serviceName: string,
|
|
307
|
+
callback: ServiceRequestHandler<T>
|
|
308
|
+
): ServiceType<T>;
|
|
309
|
+
|
|
281
310
|
/**
|
|
282
311
|
* Create a Service.
|
|
283
312
|
*
|