Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
79 changes: 79 additions & 0 deletions .github/workflows/prebuild-linux-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Prebuild Linux ARM64

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
prebuild:
runs-on: ubuntu-24.04-arm
container:
image: ${{ matrix.docker_image }}
strategy:
fail-fast: false
matrix:
node-version: [22.X]
architecture: [arm64]
ros_distribution:
- humble
- jazzy
- kilted
include:
# Humble Hawksbill (May 2022 - May 2027)
- docker_image: ubuntu:jammy
ros_distribution: humble
ubuntu_codename: jammy
# Jazzy Jalisco (May 2024 - May 2029)
- docker_image: ubuntu:noble
ros_distribution: jazzy
ubuntu_codename: noble
# Kilted Kaiju (May 2025 - Dec 2026)
- docker_image: ubuntu:noble
ros_distribution: kilted
ubuntu_codename: noble

steps:
- name: Setup Node.js ${{ matrix.node-version }} on ${{ matrix.architecture }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
architecture: ${{ matrix.architecture }}

- name: Setup ROS2
uses: ros-tooling/[email protected]
with:
required-ros-distributions: ${{ matrix.ros_distribution }}

- uses: actions/checkout@v5

- name: Install dependencies
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
npm i

- name: Generate prebuilt binary
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
npm run prebuild

- name: Upload prebuilt binary
uses: actions/upload-artifact@v4
with:
name: prebuilt-linux-arm64-node${{ matrix.node-version }}-${{ matrix.ubuntu_codename }}-${{ matrix.ros_distribution }}
path: prebuilds/linux-arm64/*.node
if-no-files-found: error

- name: Test loading prebuilt
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
node -e "
const rclnodejs = require('./index.js');
console.log('Successfully loaded rclnodejs with prebuilt binary');
console.log('Platform:', process.platform, 'Arch:', process.arch);
console.log('ROS_DISTRO:', process.env.ROS_DISTRO);
"
79 changes: 79 additions & 0 deletions .github/workflows/prebuild-linux-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Prebuild Linux x64

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
prebuild:
runs-on: ubuntu-latest
container:
image: ${{ matrix.docker_image }}
strategy:
fail-fast: false
matrix:
node-version: [22.X]
architecture: [x64]
ros_distribution:
- humble
- jazzy
- kilted
include:
# Humble Hawksbill (May 2022 - May 2027)
- docker_image: ubuntu:jammy
ros_distribution: humble
ubuntu_codename: jammy
# Jazzy Jalisco (May 2024 - May 2029)
- docker_image: ubuntu:noble
ros_distribution: jazzy
ubuntu_codename: noble
# Kilted Kaiju (May 2025 - Dec 2026)
- docker_image: ubuntu:noble
ros_distribution: kilted
ubuntu_codename: noble

steps:
- name: Setup Node.js ${{ matrix.node-version }} on ${{ matrix.architecture }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
architecture: ${{ matrix.architecture }}

- name: Setup ROS2
uses: ros-tooling/[email protected]
with:
required-ros-distributions: ${{ matrix.ros_distribution }}

- uses: actions/checkout@v5

- name: Install dependencies
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
npm i

- name: Generate prebuilt binary
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
npm run prebuild

- name: Upload prebuilt binary
uses: actions/upload-artifact@v4
with:
name: prebuilt-linux-x64-node${{ matrix.node-version }}-${{ matrix.ubuntu_codename }}-${{ matrix.ros_distribution }}
path: prebuilds/linux-x64/*.node
if-no-files-found: error

- name: Test loading prebuilt
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
node -e "
const rclnodejs = require('./index.js');
console.log('Successfully loaded rclnodejs with prebuilt binary');
console.log('Platform:', process.platform, 'Arch:', process.arch);
console.log('ROS_DISTRO:', process.env.ROS_DISTRO);
"
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,26 @@ npm i rclnodejs

See the [features](./docs/FEATURES.md) and try the [examples](https://github.com/RobotWebTools/rclnodejs/tree/develop/example) to get started.

### Prebuilt Binaries

rclnodejs ships with prebuilt native binaries for common Linux configurations since `v1.5.2`, eliminating the need for compilation during installation. This significantly speeds up installation and reduces dependencies.

**Supported Platforms:**

- **Ubuntu 22.04 (Jammy)** - ROS 2 Humble
- **Ubuntu 24.04 (Noble)** - ROS 2 Jazzy, Kilted, Rolling
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Corrected spelling of 'Kilted' to 'Kilted' - this appears to be the correct ROS 2 distribution name, but verify if this should be 'Kilted Kaiju' for clarity.

Copilot uses AI. Check for mistakes.
- **Architectures:** x64, arm64
- **Node.js:** >= 16.20.2 (N-API compatible)

**Force Building from Source:**

If you need to build from source even when a prebuilt binary is available, set the environment variable:

```bash
export RCLNODEJS_FORCE_BUILD=1
npm install rclnodejs
```

## rclnodejs-cli

[rclnodejs-cli](https://github.com/RobotWebTools/rclnodejs-cli/) is a companion project we recently launched to provide a commandline interface to a set of developer tools for working with this `rclnodejs`. You may find `rclnodejs-cli` particularly useful if you plan to create ROS 2 node(s) and launch files for working with multiple node orchestrations.
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const {
} = require('./lib/parameter.js');
const path = require('path');
const QoS = require('./lib/qos.js');
const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./lib/native_loader.js');
const tsdGenerator = require('./rostsd_gen/index.js');
const validator = require('./lib/validator.js');
const Time = require('./lib/time.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/action/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('../native_loader.js');
const ActionInterfaces = require('./interfaces.js');
const ActionUuid = require('./uuid.js');
const ClientGoalHandle = require('./client_goal_handle.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/action/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('../native_loader.js');

/**
* Get a list of action names and types for action clients associated with a node.
Expand Down
2 changes: 1 addition & 1 deletion lib/action/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('../native_loader.js');
const ActionInterfaces = require('./interfaces.js');
const ActionUuid = require('./uuid.js');
const DistroUtils = require('../distro.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/action/server_goal_handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('../native_loader.js');
const ActionInterfaces = require('./interfaces.js');
const Deferred = require('./deferred.js');
const { GoalEvent } = require('./response.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const DistroUtils = require('./distro.js');
const Entity = require('./entity.js');
const debug = require('debug')('rclnodejs:client');
Expand Down
2 changes: 1 addition & 1 deletion lib/clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const Time = require('./time.js');
const ClockType = require('./clock_type.js');

Expand Down
2 changes: 1 addition & 1 deletion lib/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');

let defaultContext = null;

Expand Down
2 changes: 1 addition & 1 deletion lib/duration.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const S_TO_NS = 10n ** 9n;

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/event_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const DistroUtils = require('./distro.js');
const Entity = require('./entity.js');

Expand Down
2 changes: 1 addition & 1 deletion lib/guard_condition.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const Entity = require('./entity.js');
const Context = require('./context.js');

Expand Down
2 changes: 1 addition & 1 deletion lib/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const LifecyclePublisher = require('./lifecycle_publisher.js');
const loader = require('./interface_loader.js');
const Context = require('./context.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/lifecycle_publisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');
const Logging = require('./logging.js');
const Publisher = require('./publisher.js');

Expand Down
2 changes: 1 addition & 1 deletion lib/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

const path = require('path');
const rclnodejs = require('bindings')('rclnodejs');
const rclnodejs = require('./native_loader.js');

/**
* Enum for LoggingSeverity
Expand Down
Loading
Loading