rclnodejs 0.21.0 → 0.21.3
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/identify-ros-distro.yml +44 -0
- package/.github/workflows/linux-build-and-test-compatibility.yml +67 -0
- package/.github/workflows/linux-build-and-test.yml +51 -0
- package/.github/workflows/windows-build-and-test-compatibility.yml +52 -0
- package/.github/workflows/windows-build-and-test.yml +63 -0
- package/CONTRIBUTORS.md +6 -2
- package/README.md +5 -5
- package/binding.gyp +51 -4
- package/index.js +12 -4
- package/lib/action/client.js +6 -20
- package/lib/action/server.js +1 -1
- package/lib/action/uuid.js +28 -1
- package/lib/client.js +13 -10
- package/lib/distro.js +70 -0
- package/lib/interface_loader.js +1 -1
- package/lib/node.js +17 -10
- package/lib/parameter.js +14 -11
- package/package.json +4 -4
- package/scripts/npmjs-readme.md +5 -5
- package/scripts/ros_distro.js +19 -21
- package/src/rcl_bindings.cpp +7 -9
- package/types/action_server.d.ts +12 -8
- package/types/action_uuid.d.ts +58 -0
- package/types/base.d.ts +2 -0
- package/types/distro.d.ts +34 -0
- package/types/node.d.ts +7 -0
- package/.vscode/c_cpp_properties.json +0 -15
- package/scripts/compile_tests.js +0 -124
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Identify ROS Distro from GITHUB_REF_NAME
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
outputs:
|
|
6
|
+
distro:
|
|
7
|
+
description: "The ROS distribution short name"
|
|
8
|
+
value: ${{ jobs.identify-ros-distro.outputs.distro }}
|
|
9
|
+
linuxos:
|
|
10
|
+
description: "The ROS compatible Linux version"
|
|
11
|
+
value: ${{ jobs.identify-ros-distro.outputs.linuxos }}
|
|
12
|
+
env:
|
|
13
|
+
ROLLING_VAR: ${{ contains(github.ref, 'develop') }}
|
|
14
|
+
HUMBLE_VAR: ${{ contains(github.ref, 'humble') }}
|
|
15
|
+
GALACTIC_VAR: ${{ contains(github.ref, 'galactic') }}
|
|
16
|
+
FOXY_VAR: ${{ contains(github.ref, 'foxy') }}
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
identify-ros-distro:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
outputs:
|
|
22
|
+
distro: ${{ steps.identify.outputs.distro }}
|
|
23
|
+
linuxos: ${{ steps.identify.outputs.linuxos }}
|
|
24
|
+
steps:
|
|
25
|
+
- name: Identify distro
|
|
26
|
+
id: identify
|
|
27
|
+
run: |
|
|
28
|
+
if ${ROLLING_VAR} == true; then
|
|
29
|
+
echo "::set-output name=distro::rolling"
|
|
30
|
+
echo "::set-output name=linuxos::ubuntu-22.04"
|
|
31
|
+
elif ${HUMBLE_VAR} == true; then
|
|
32
|
+
echo "::set-output name=distro::humble"
|
|
33
|
+
echo "::set-output name=linuxos::ubuntu-22.04"
|
|
34
|
+
elif ${GALACTIC_VAR} == true; then
|
|
35
|
+
echo "::set-output name=distro::galactic"
|
|
36
|
+
echo "::set-output name=linuxos::ubuntu-20.04"
|
|
37
|
+
elif ${FOXY_VAR} == true; then
|
|
38
|
+
echo "::set-output name=distro::foxy"
|
|
39
|
+
echo "::set-output name=linuxos::ubuntu-20.04"
|
|
40
|
+
else
|
|
41
|
+
echo "Unable to map branch name to ROS distro, using ROLLING as default"
|
|
42
|
+
echo "::set-output name=distro::rolling"
|
|
43
|
+
echo "::set-output name=linuxos::ubuntu-22.04"
|
|
44
|
+
fi
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
on:
|
|
2
|
+
workflow_dispatch:
|
|
3
|
+
|
|
4
|
+
jobs:
|
|
5
|
+
build-humble-and-rolling: # humble and rolling distros
|
|
6
|
+
runs-on: ubuntu-22.04
|
|
7
|
+
strategy:
|
|
8
|
+
fail-fast: false
|
|
9
|
+
matrix:
|
|
10
|
+
node-version: [10.X, 12.x, 14.X, 16.X, 17.X]
|
|
11
|
+
ros_distribution:
|
|
12
|
+
- humble
|
|
13
|
+
- rolling
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Setup ROS2
|
|
17
|
+
uses: ros-tooling/setup-ros@v0.3
|
|
18
|
+
with:
|
|
19
|
+
required-ros-distributions: ${{ matrix.ros_distribution }}
|
|
20
|
+
|
|
21
|
+
- name: Install test-msgs on Linux
|
|
22
|
+
run: |
|
|
23
|
+
sudo apt install ros-${{ matrix.ros_distribution }}-test-msgs
|
|
24
|
+
- uses: actions/checkout@v3
|
|
25
|
+
|
|
26
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
27
|
+
uses: actions/setup-node@v2
|
|
28
|
+
with:
|
|
29
|
+
node-version: ${{ matrix.node-version }}
|
|
30
|
+
|
|
31
|
+
- name: Build and test rclnodejs
|
|
32
|
+
run: |
|
|
33
|
+
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
|
|
34
|
+
npm i
|
|
35
|
+
npm test
|
|
36
|
+
|
|
37
|
+
build-foxy-and-galactic: # foxy and galactic distros
|
|
38
|
+
runs-on: ubuntu-20.04
|
|
39
|
+
strategy:
|
|
40
|
+
fail-fast: false
|
|
41
|
+
matrix:
|
|
42
|
+
node-version: [10.X, 12.x, 14.X, 16.X, 17.X]
|
|
43
|
+
ros_distribution:
|
|
44
|
+
- foxy
|
|
45
|
+
- galactic
|
|
46
|
+
|
|
47
|
+
steps:
|
|
48
|
+
- name: Setup ROS2
|
|
49
|
+
uses: ros-tooling/setup-ros@v0.3
|
|
50
|
+
with:
|
|
51
|
+
required-ros-distributions: ${{ matrix.ros_distribution }}
|
|
52
|
+
|
|
53
|
+
- name: Install test-msgs on Linux
|
|
54
|
+
run: |
|
|
55
|
+
sudo apt install ros-${{ matrix.ros_distribution }}-test-msgs
|
|
56
|
+
- uses: actions/checkout@v3
|
|
57
|
+
|
|
58
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
59
|
+
uses: actions/setup-node@v2
|
|
60
|
+
with:
|
|
61
|
+
node-version: ${{ matrix.node-version }}
|
|
62
|
+
|
|
63
|
+
- name: Build and test rclnodejs
|
|
64
|
+
run: |
|
|
65
|
+
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
|
|
66
|
+
npm i
|
|
67
|
+
npm test
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
name: rclnodejs - Linux Build and Test
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- develop
|
|
8
|
+
- humble-hawksbill
|
|
9
|
+
- galactic-geochelone
|
|
10
|
+
- foxy-fitzroy
|
|
11
|
+
pull_request:
|
|
12
|
+
branches:
|
|
13
|
+
- develop
|
|
14
|
+
- humble-hawksbill
|
|
15
|
+
- galactic-geochelone
|
|
16
|
+
- foxy-fitzroy
|
|
17
|
+
workflow_dispatch:
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
identify-ros-distro:
|
|
21
|
+
uses: ./.github/workflows/identify-ros-distro.yml
|
|
22
|
+
|
|
23
|
+
build:
|
|
24
|
+
needs: identify-ros-distro
|
|
25
|
+
runs-on: ${{ needs.identify-ros-distro.outputs.linuxos }}
|
|
26
|
+
strategy:
|
|
27
|
+
fail-fast: false
|
|
28
|
+
matrix:
|
|
29
|
+
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X]
|
|
30
|
+
steps:
|
|
31
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
32
|
+
uses: actions/setup-node@v2
|
|
33
|
+
with:
|
|
34
|
+
node-version: ${{ matrix.node-version }}
|
|
35
|
+
|
|
36
|
+
- name: Setup ROS2
|
|
37
|
+
uses: ros-tooling/setup-ros@v0.3
|
|
38
|
+
with:
|
|
39
|
+
required-ros-distributions: ${{ needs.identify-ros-distro.outputs.distro }}
|
|
40
|
+
|
|
41
|
+
- name: Install test-msgs on Linux
|
|
42
|
+
run: |
|
|
43
|
+
sudo apt install ros-${{ needs.identify-ros-distro.outputs.distro }}-test-msgs
|
|
44
|
+
|
|
45
|
+
- uses: actions/checkout@v3
|
|
46
|
+
|
|
47
|
+
- name: Build and test rclnodejs
|
|
48
|
+
run: |
|
|
49
|
+
source /opt/ros/${{ needs.identify-ros-distro.outputs.distro }}/setup.bash
|
|
50
|
+
npm i
|
|
51
|
+
npm test
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
|
|
2
|
+
name: rclnodejs - Windows Build & Test Compatibility
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: windows-2019
|
|
10
|
+
strategy:
|
|
11
|
+
fail-fast: false
|
|
12
|
+
matrix:
|
|
13
|
+
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X]
|
|
14
|
+
ros_distribution:
|
|
15
|
+
- foxy
|
|
16
|
+
- galactic
|
|
17
|
+
- humble
|
|
18
|
+
- rolling
|
|
19
|
+
steps:
|
|
20
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
21
|
+
uses: actions/setup-node@v2
|
|
22
|
+
with:
|
|
23
|
+
node-version: ${{ matrix.node-version }}
|
|
24
|
+
|
|
25
|
+
- name: Setup ROS2
|
|
26
|
+
uses: ros-tooling/setup-ros@v0.3
|
|
27
|
+
with:
|
|
28
|
+
required-ros-distributions: ${{ matrix.ros_distribution }}
|
|
29
|
+
|
|
30
|
+
- name: Install ROS2 Rolling (Conditional)
|
|
31
|
+
if: ${{ matrix.ros_distribution == 'rolling' }}
|
|
32
|
+
shell: bash
|
|
33
|
+
run: |
|
|
34
|
+
wget --quiet https://ci.ros2.org/view/packaging/job/packaging_windows/lastSuccessfulBuild/artifact/ws/ros2-package-windows-AMD64.zip -O rolling.zip
|
|
35
|
+
7z x rolling.zip -y -o/c/dev/rolling
|
|
36
|
+
|
|
37
|
+
- name: Prebuild - Setup VS Dev Environment
|
|
38
|
+
uses: seanmiddleditch/gha-setup-vsdevenv@v4
|
|
39
|
+
|
|
40
|
+
- uses: actions/checkout@v3
|
|
41
|
+
|
|
42
|
+
- name: Build rclnodejs
|
|
43
|
+
shell: cmd
|
|
44
|
+
run: |
|
|
45
|
+
call "c:\dev\${{ matrix.ros_distribution }}\ros2-windows\setup.bat"
|
|
46
|
+
npm i
|
|
47
|
+
|
|
48
|
+
- name: Test rclnodejs
|
|
49
|
+
shell: cmd
|
|
50
|
+
run: |
|
|
51
|
+
call "c:\dev\${{ needs.identify-ros-distro.outputs.distro }}\ros2-windows\setup.bat"
|
|
52
|
+
npm test
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
|
|
2
|
+
name: rclnodejs - Windows Build & Test
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- develop
|
|
8
|
+
- humble-hawksbill
|
|
9
|
+
- galactic-geochelone
|
|
10
|
+
- foxy-fitzroy
|
|
11
|
+
pull_request:
|
|
12
|
+
branches:
|
|
13
|
+
- develop
|
|
14
|
+
- humble-hawksbill
|
|
15
|
+
- galactic-geochelone
|
|
16
|
+
- foxy-fitzroy
|
|
17
|
+
workflow_dispatch:
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
identify-ros-distro:
|
|
21
|
+
uses: ./.github/workflows/identify-ros-distro.yml
|
|
22
|
+
|
|
23
|
+
build:
|
|
24
|
+
needs: identify-ros-distro
|
|
25
|
+
runs-on: windows-2019
|
|
26
|
+
strategy:
|
|
27
|
+
fail-fast: false
|
|
28
|
+
matrix:
|
|
29
|
+
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X]
|
|
30
|
+
steps:
|
|
31
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
32
|
+
uses: actions/setup-node@v2
|
|
33
|
+
with:
|
|
34
|
+
node-version: ${{ matrix.node-version }}
|
|
35
|
+
|
|
36
|
+
- name: Setup ROS2
|
|
37
|
+
uses: ros-tooling/setup-ros@v0.3
|
|
38
|
+
with:
|
|
39
|
+
required-ros-distributions: ${{ needs.identify-ros-distro.outputs.distro }}
|
|
40
|
+
|
|
41
|
+
- name: Install ROS2 Rolling (Conditional)
|
|
42
|
+
if: ${{ needs.identify-ros-distro.outputs.distro == 'rolling' }}
|
|
43
|
+
shell: bash
|
|
44
|
+
run: |
|
|
45
|
+
wget --quiet https://ci.ros2.org/view/packaging/job/packaging_windows/lastSuccessfulBuild/artifact/ws/ros2-package-windows-AMD64.zip -O rolling.zip
|
|
46
|
+
7z x rolling.zip -y -o/c/dev/rolling
|
|
47
|
+
|
|
48
|
+
- name: Prebuild - Setup VS Dev Environment
|
|
49
|
+
uses: seanmiddleditch/gha-setup-vsdevenv@v4
|
|
50
|
+
|
|
51
|
+
- uses: actions/checkout@v3
|
|
52
|
+
|
|
53
|
+
- name: Build rclnodejs
|
|
54
|
+
shell: cmd
|
|
55
|
+
run: |
|
|
56
|
+
call "c:\dev\${{ needs.identify-ros-distro.outputs.distro }}\ros2-windows\setup.bat"
|
|
57
|
+
npm i
|
|
58
|
+
|
|
59
|
+
- name: Test rclnodejs
|
|
60
|
+
shell: cmd
|
|
61
|
+
run: |
|
|
62
|
+
call "c:\dev\${{ needs.identify-ros-distro.outputs.distro }}\ros2-windows\setup.bat"
|
|
63
|
+
npm test
|
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
|
@@ -18,7 +18,7 @@ rclnodejs.init().then(() => {
|
|
|
18
18
|
|
|
19
19
|
**Node.js**
|
|
20
20
|
|
|
21
|
-
- [Node.js](https://nodejs.org/en/) version between 10.23 -
|
|
21
|
+
- [Node.js](https://nodejs.org/en/) version between 10.23 - 17.x.
|
|
22
22
|
|
|
23
23
|
**ROS 2 SDK**
|
|
24
24
|
|
|
@@ -43,10 +43,10 @@ npm i rclnodejs@x.y.z
|
|
|
43
43
|
|
|
44
44
|
#### RCLNODEJS - ROS 2 Version Compatibility
|
|
45
45
|
|
|
46
|
-
| RCLNODEJS Version |
|
|
47
|
-
| :-------------------------------------------------------------------------------------------------------------------------------------: |
|
|
48
|
-
| [0.21.
|
|
49
|
-
| [0.10.3](https://github.com/RobotWebTools/rclnodejs/releases/tag/0.10.3) |
|
|
46
|
+
| RCLNODEJS Version | Compatible ROS 2 Release |
|
|
47
|
+
| :-------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
48
|
+
| [0.21.3 (current)](https://www.npmjs.com/package/rclnodejs/v/0.21.3) ([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
|
+
| [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
|
|
52
52
|
|
package/binding.gyp
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
10
|
'variables': {
|
|
11
|
-
'ros_version': '<!(node scripts/ros_distro.js)'
|
|
11
|
+
'ros_version': '<!(node scripts/ros_distro.js)',
|
|
12
12
|
},
|
|
13
13
|
'targets': [
|
|
14
14
|
{
|
|
@@ -61,12 +61,36 @@
|
|
|
61
61
|
'cflags_cc': [
|
|
62
62
|
'-std=c++14'
|
|
63
63
|
],
|
|
64
|
-
'include_dirs':
|
|
64
|
+
'include_dirs':
|
|
65
|
+
[
|
|
65
66
|
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/ ') + '/include/')\")",
|
|
66
67
|
],
|
|
67
68
|
'library_dirs': [
|
|
68
69
|
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/lib/ ') + '/lib/')\")",
|
|
69
70
|
],
|
|
71
|
+
'conditions': [
|
|
72
|
+
[
|
|
73
|
+
'ros_version > 2105', # Humble, Rolling, ...
|
|
74
|
+
{
|
|
75
|
+
'include_dirs':
|
|
76
|
+
[
|
|
77
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/ ') + '/include/')\")",
|
|
78
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl/ ') + '/include/rcl')\")",
|
|
79
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcutils/ ') + '/include/rcutils/')\")",
|
|
80
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rmw/ ') + '/include/rmw/')\")",
|
|
81
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl_yaml_param_parser/ ') + '/include/rcl_yaml_param_parser/')\")",
|
|
82
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rosidl_typesupport_interface/ ') + '/include/rosidl_typesupport_interface/')\")",
|
|
83
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl_action/ ') + '/include/rcl_action/')\")",
|
|
84
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/action_msgs/ ') + '/include/action_msgs/')\")",
|
|
85
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/unique_identifier_msgs/ ') + '/include/unique_identifier_msgs/')\")",
|
|
86
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/builtin_interfaces/ ') + '/include/builtin_interfaces/')\")",
|
|
87
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl_lifecycle/ ') + '/include/rcl_lifecycle/')\")",
|
|
88
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/lifecycle_msgs/ ') + '/include/lifecycle_msgs/')\")",
|
|
89
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rosidl_runtime_c/ ') + '/include/rosidl_runtime_c/')\")",
|
|
90
|
+
],
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
],
|
|
70
94
|
}
|
|
71
95
|
],
|
|
72
96
|
[
|
|
@@ -80,7 +104,7 @@
|
|
|
80
104
|
],
|
|
81
105
|
'include_dirs': [
|
|
82
106
|
'./src/third_party/dlfcn-win32/',
|
|
83
|
-
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '
|
|
107
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include ').replace(/\\\/g, '/') + '/include')\")",
|
|
84
108
|
],
|
|
85
109
|
'msvs_settings': {
|
|
86
110
|
'VCCLCompilerTool': {
|
|
@@ -90,11 +114,34 @@
|
|
|
90
114
|
'AdditionalDependencies': ['psapi.lib'],
|
|
91
115
|
'AdditionalLibraryDirectories': ["<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '\\\lib ').replace(/\\\/g, '/') + '/lib')\")",],
|
|
92
116
|
}
|
|
93
|
-
}
|
|
117
|
+
},
|
|
118
|
+
'conditions': [
|
|
119
|
+
[
|
|
120
|
+
'ros_version > 2105', # Humble, Rolling, ... TODO - not tested due to broken setup_ros v3.3 action on windows
|
|
121
|
+
{
|
|
122
|
+
'include_dirs':
|
|
123
|
+
[
|
|
124
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl ').replace(/\\\/g, '/') + '/include/rcl')\")",
|
|
125
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcutils ').replace(/\\\/g, '/') + '/include/rcutils')\")",
|
|
126
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rmw ').replace(/\\\/g, '/') + '/include/rmw')\")",
|
|
127
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl_yaml_param_parser ').replace(/\\\/g, '/') + '/include/rcl_yaml_param_parser')\")",
|
|
128
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rosidl_runtime_c ').replace(/\\\/g, '/') + '/include/rosidl_runtime_c')\")",
|
|
129
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rosidl_typesupport_interface ').replace(/\\\/g, '/') + '/include/rosidl_typesupport_interface')\")",
|
|
130
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl_action ').replace(/\\\/g, '/') + '/include/rcl_action')\")",
|
|
131
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/action_msgs ').replace(/\\\/g, '/') + '/include/action_msgs')\")",
|
|
132
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/unique_identifier_msgs ').replace(/\\\/g, '/') + '/include/unique_identifier_msgs')\")",
|
|
133
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/builtin_interfaces ').replace(/\\\/g, '/') + '/include/builtin_interfaces')\")",
|
|
134
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl_lifecycle ').replace(/\\\/g, '/') + '/include/rcl_lifecycle')\")",
|
|
135
|
+
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/lifecycle_msgs ').replace(/\\\/g, '/') + '/include/lifecycle_msgs')\")",
|
|
136
|
+
],
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
]
|
|
94
140
|
}
|
|
95
141
|
],
|
|
96
142
|
[
|
|
97
143
|
'OS=="mac"',
|
|
144
|
+
# TODO - macos is no longer a tier-1 ROS platform and we have no binary ROS builds to test for Humble & Rolling
|
|
98
145
|
{
|
|
99
146
|
'defines': [
|
|
100
147
|
'OS_MACOS'
|
package/index.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
'use strict';
|
|
16
16
|
|
|
17
|
+
const DistroUtils = require('./lib/distro.js');
|
|
17
18
|
const { Clock, ROSClock } = require('./lib/clock.js');
|
|
18
19
|
const ClockType = require('./lib/clock_type.js');
|
|
19
20
|
const compareVersions = require('compare-versions');
|
|
@@ -41,6 +42,7 @@ const validator = require('./lib/validator.js');
|
|
|
41
42
|
const Time = require('./lib/time.js');
|
|
42
43
|
const ActionClient = require('./lib/action/client.js');
|
|
43
44
|
const ActionServer = require('./lib/action/server.js');
|
|
45
|
+
const ActionUuid = require('./lib/action/uuid.js');
|
|
44
46
|
const ClientGoalHandle = require('./lib/action/client_goal_handle.js');
|
|
45
47
|
const { CancelResponse, GoalResponse } = require('./lib/action/response.js');
|
|
46
48
|
const ServerGoalHandle = require('./lib/action/server_goal_handle.js');
|
|
@@ -79,13 +81,13 @@ async function getCurrentGeneratorVersion() {
|
|
|
79
81
|
});
|
|
80
82
|
}
|
|
81
83
|
|
|
84
|
+
let _rosVersionChecked = false;
|
|
85
|
+
|
|
82
86
|
/**
|
|
83
87
|
* A module that exposes the rclnodejs interfaces.
|
|
84
88
|
* @exports rclnodejs
|
|
85
89
|
*/
|
|
86
90
|
let rcl = {
|
|
87
|
-
_rosVersionChecked: false,
|
|
88
|
-
|
|
89
91
|
/** {@link Clock} class */
|
|
90
92
|
Clock: Clock,
|
|
91
93
|
|
|
@@ -104,6 +106,9 @@ let rcl = {
|
|
|
104
106
|
*/
|
|
105
107
|
DEFAULT_NUMERIC_RANGE_TOLERANCE: DEFAULT_NUMERIC_RANGE_TOLERANCE,
|
|
106
108
|
|
|
109
|
+
/** {@link DistroUtils} */
|
|
110
|
+
DistroUtils: DistroUtils,
|
|
111
|
+
|
|
107
112
|
/** {@link Duration} class */
|
|
108
113
|
Duration: Duration,
|
|
109
114
|
|
|
@@ -146,6 +151,9 @@ let rcl = {
|
|
|
146
151
|
/** {@link ActionServer} class */
|
|
147
152
|
ActionServer: ActionServer,
|
|
148
153
|
|
|
154
|
+
/** {@link ActionUuid} class */
|
|
155
|
+
ActionUuid: ActionUuid,
|
|
156
|
+
|
|
149
157
|
/** {@link ClientGoalHandle} class */
|
|
150
158
|
ClientGoalHandle: ClientGoalHandle,
|
|
151
159
|
|
|
@@ -241,7 +249,7 @@ let rcl = {
|
|
|
241
249
|
|
|
242
250
|
rclnodejs.init(context.handle, argv);
|
|
243
251
|
|
|
244
|
-
if (
|
|
252
|
+
if (_rosVersionChecked) {
|
|
245
253
|
// no further processing required
|
|
246
254
|
return;
|
|
247
255
|
}
|
|
@@ -258,7 +266,7 @@ let rcl = {
|
|
|
258
266
|
|
|
259
267
|
await generator.generateAll(forced);
|
|
260
268
|
// TODO determine if tsd generateAll() should be here
|
|
261
|
-
|
|
269
|
+
_rosVersionChecked = true;
|
|
262
270
|
},
|
|
263
271
|
|
|
264
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/client.js
CHANGED
|
@@ -28,7 +28,7 @@ class Client extends Entity {
|
|
|
28
28
|
super(handle, typeClass, options);
|
|
29
29
|
this._nodeHandle = nodeHandle;
|
|
30
30
|
this._serviceName = serviceName;
|
|
31
|
-
this.
|
|
31
|
+
this._sequenceNumberToCallbackMap = new Map();
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -58,18 +58,21 @@ class Client extends Entity {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
let rawRequest = requestToSend.serialize();
|
|
61
|
-
|
|
61
|
+
let sequenceNumber = rclnodejs.sendRequest(this._handle, rawRequest);
|
|
62
62
|
debug(`Client has sent a ${this._serviceName} request.`);
|
|
63
|
-
this.
|
|
63
|
+
this._sequenceNumberToCallbackMap.set(sequenceNumber, callback);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
processResponse(sequenceNumber, response) {
|
|
67
|
+
if (this._sequenceNumberToCallbackMap.has(sequenceNumber)) {
|
|
68
|
+
debug(`Client has received ${this._serviceName} response from service.`);
|
|
69
|
+
let callback = this._sequenceNumberToCallbackMap.get(sequenceNumber);
|
|
70
|
+
this._sequenceNumberToCallbackMap.delete(sequenceNumber);
|
|
71
|
+
callback(response.toPlainObject(this.typedArrayEnabled));
|
|
72
|
+
} else {
|
|
73
|
+
error(`Client has received an unexpected ${this._serviceName}
|
|
74
|
+
response with sequence number ${sequenceNumber}.`);
|
|
75
|
+
}
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
/**
|