Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 0 additions & 81 deletions .circleci/config.yml

This file was deleted.

13 changes: 10 additions & 3 deletions .github/workflows/linux-build-and-test-galactic.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Linux Build and Test on Galactic
name: ROS Galactic - Linux Build and Test

on:
push:
Expand Down Expand Up @@ -37,8 +37,15 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Run test suite on Linux
- name: Build rclnodejs
run: |
source /opt/ros/galactic/setup.bash
npm i
npm test

- name: Run test suite
shell: bash
run: |
source /opt/ros/galactic/setup.bash
node ./scripts/compile_tests.js
source install/local_setup.bash
node --expose-gc ./scripts/run_test.js
47 changes: 47 additions & 0 deletions .github/workflows/linux-build-and-test-humble.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: ROS Humble - Linux Build and Test

on:
push:
branches: [ humble-hawksbill ]
pull_request:
branches: [ humble-hawksbill ]
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
node-version: [10.X, 12.x, 14.X, 16.X, 17.X]

steps:
- name: Setup ROS2
uses: ros-tooling/[email protected]
with:
required-ros-distributions: humble

- name: Install test-msgs on Linux
run: |
sudo apt install ros-humble-test-msgs

- uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Build rclnodejs
run: |
source /opt/ros/humble/setup.bash
npm i

- name: Run test suite
run: |
source /opt/ros/humble/setup.bash
npm test
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Linux Build and Test
name: ROS Rolling - Linux Build and Test

on: [push, pull_request, workflow_dispatch]

jobs:
build:

Expand Down Expand Up @@ -34,4 +33,11 @@ jobs:
run: |
source /opt/ros/rolling/setup.bash
npm i
npm test

- name: Run test suite
shell: bash
run: |
source /opt/ros/rolling/setup.bash
node ./scripts/compile_tests.js
source install/local_setup.bash
node --expose-gc ./scripts/run_test.js
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ rclnodejs.init().then(() => {

Before installing `rclnodejs` please ensure the following software is installed and configured on your system:

- [Nodejs](https://nodejs.org/en/) version between 10.23.1 - 16.x.
- [Nodejs](https://nodejs.org/en/) version between 10.23.1 - 17.x.

- [ROS 2 SDK](https://index.ros.org/doc/ros2/Installation/) for details.
**DON'T FORGET TO [SOURCE THE ROS 2 SETUP FILE](https://index.ros.org/doc/ros2/Tutorials/Configuring-ROS2-Environment/#source-the-setup-files)**
Expand All @@ -61,10 +61,10 @@ To install a specific version of rclnodejs use:
npm i [email protected]
```

| RCLNODEJS Version | Compatible ROS 2 Release |
| :-------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| [0.21.0 (current)](https://www.npmjs.com/package/rclnodejs/v/0.21.0) ([API](http://robotwebtools.org/rclnodejs/docs/0.21.0/index.html)) | [Galactic Geochelone](https://github.com/ros2/ros2/releases/tag/release-galactic-20210716) / [Foxy Fitzroy](https://github.com/ros2/ros2/releases/tag/release-foxy-20201211) / [Eloquent Elusor](https://github.com/ros2/ros2/releases/tag/release-eloquent-20200124) |
| [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) |
| RCLNODEJS Version | Compatible ROS 2 Release |
| :-------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| [0.21.0 (current)](https://www.npmjs.com/package/rclnodejs/v/0.21.0) ([API](http://robotwebtools.org/rclnodejs/docs/0.21.0/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) |
| [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) |

- **Note:** to install rclnodejs from GitHub: add `"rclnodejs":"RobotWebTools/rclnodejs#<branch>"` to your `package.json` depdendency section.

Expand Down
63 changes: 59 additions & 4 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
},
'variables': {
'ros_version': '<!(node scripts/ros_distro.js)'
'ros_version': '<!(node scripts/ros_distro.js)',
},
'targets': [
{
Expand Down Expand Up @@ -61,12 +61,44 @@
'cflags_cc': [
'-std=c++14'
],
'include_dirs': [
'include_dirs':
[
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/ ') + '/include/')\")",
],
'library_dirs': [
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/lib/ ') + '/lib/')\")",
],
'conditions': [
[
'ros_version > 2105', # Humble, Rolling, ...
{
'include_dirs':
[
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/ ') + '/include/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl/ ') + '/include/rcl')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcutils/ ') + '/include/rcutils/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rmw/ ') + '/include/rmw/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl_yaml_param_parser/ ') + '/include/rcl_yaml_param_parser/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rosidl_typesupport_interface/ ') + '/include/rosidl_typesupport_interface/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl_action/ ') + '/include/rcl_action/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/action_msgs/ ') + '/include/action_msgs/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/unique_identifier_msgs/ ') + '/include/unique_identifier_msgs/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/builtin_interfaces/ ') + '/include/builtin_interfaces/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl_lifecycle/ ') + '/include/rcl_lifecycle/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/lifecycle_msgs/ ') + '/include/lifecycle_msgs/')\")",
],
}
],
[
'ros_version == 2205', # Humble
{
'include_dirs':
[
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rosidl_runtime_c/ ') + '/include/rosidl_runtime_c/')\")",
],
}
],
],
}
],
[
Expand All @@ -80,7 +112,7 @@
],
'include_dirs': [
'./src/third_party/dlfcn-win32/',
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '\\\include ').replace(/\\\/g, '/') + '/include')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include ').replace(/\\\/g, '/') + '/include')\")",
],
'msvs_settings': {
'VCCLCompilerTool': {
Expand All @@ -90,11 +122,34 @@
'AdditionalDependencies': ['psapi.lib'],
'AdditionalLibraryDirectories': ["<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '\\\lib ').replace(/\\\/g, '/') + '/lib')\")",],
}
}
},
'conditions': [
[
'ros_version > 2105', # Humble, Rolling, ... TODO - not tested due to broken setup_ros v3.3 action on windows
{
'include_dirs':
[
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl ').replace(/\\\/g, '/') + '/include/rcl')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcutils ').replace(/\\\/g, '/') + '/include/rcutils')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rmw ').replace(/\\\/g, '/') + '/include/rmw')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl_yaml_param_parser ').replace(/\\\/g, '/') + '/include/rcl_yaml_param_parser')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rosidl_runtime_c ').replace(/\\\/g, '/') + '/include/rosidl_runtime_c')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rosidl_typesupport_interface ').replace(/\\\/g, '/') + '/include/rosidl_typesupport_interface')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl_action ').replace(/\\\/g, '/') + '/include/rcl_action')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/action_msgs ').replace(/\\\/g, '/') + '/include/action_msgs')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/unique_identifier_msgs ').replace(/\\\/g, '/') + '/include/unique_identifier_msgs')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/builtin_interfaces ').replace(/\\\/g, '/') + '/include/builtin_interfaces')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl_lifecycle ').replace(/\\\/g, '/') + '/include/rcl_lifecycle')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/lifecycle_msgs ').replace(/\\\/g, '/') + '/include/lifecycle_msgs')\")",
],
}
]
]
}
],
[
'OS=="mac"',
# TODO - macos is no longer a tier-1 ROS platform and we have no binary ROS builds to test for Humble & Rolling
{
'defines': [
'OS_MACOS'
Expand Down
2 changes: 1 addition & 1 deletion docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Alternatively, you can build ROS 2 from scratch. Please select the platform you
### Install `Node.js`

**Notice:**
`rclnodejs` should only be used with node versions between 8.12 - 16.x. The lowest LTS Node.js we used to verify the unit tests is `8.12.0`. And there is a known issue installing rclnodejs with versions of node >= 17.0.
`rclnodejs` should only be used with node versions between 8.12 - 17.x. The lowest LTS Node.js we used to verify the unit tests is `8.12.0`. And there is a known issue installing rclnodejs with versions of node >= 18.0.

The `Node.js` version we selected is the LTS [`Gallium`](https://nodejs.org/download/release/latest-gallium/) (16.x). You can install it:

Expand Down
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

'use strict';

const DistroUtils = require('./lib/distro.js');
const { Clock, ROSClock } = require('./lib/clock.js');
const ClockType = require('./lib/clock_type.js');
const compareVersions = require('compare-versions');
Expand Down Expand Up @@ -104,6 +105,9 @@ let rcl = {
*/
DEFAULT_NUMERIC_RANGE_TOLERANCE: DEFAULT_NUMERIC_RANGE_TOLERANCE,

/** {@link DistroUtils} */
DistroUtils: DistroUtils,

/** {@link Duration} class */
Duration: Duration,

Expand Down
Loading