You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Efficient Usage Tips](./docs/EFFICIENCY.md), [FAQ and Known Issues](./docs/FAQ.md), [Building from Scratch](./docs/BUILDING.md), [Contributing](./docs/CONTRIBUTING.md)
33
35
34
36
## Installation
35
37
38
+
Choose the path that matches how you plan to use rclnodejs:
39
+
40
+
- Install from npm: add rclnodejs to your own application.
41
+
- Quick Start: run the examples from this repository checkout.
42
+
36
43
### Prerequisites
37
44
38
45
-[Node.js](https://nodejs.org/en/) version >= 16.13.0
39
-
-[ROS 2 SDK](https://docs.ros.org/en/jazzy/Installation.html) - **Don't forget to [source the setup file](https://docs.ros.org/en/jazzy/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#source-the-setup-files)**
Before installing, building, or running rclnodejs, source your ROS 2 environment:
49
+
50
+
```bash
51
+
source /opt/ros/<distro>/setup.bash
52
+
```
40
53
41
-
### Install rclnodejs
54
+
### Install from npm
55
+
56
+
Use this path if you want to depend on rclnodejs from your own ROS 2 Node.js application.
42
57
43
58
```bash
44
59
npm i rclnodejs
45
60
```
46
61
47
-
> **Note:** To install rclnodejs from GitHub: add `"rclnodejs":"RobotWebTools/rclnodejs#<branch>"` to your `package.json` dependency section.
62
+
After installation, use the example at the top of this README as a minimal publisher, or continue with [Quick Start](#quick-start) to run the examples in this repository.
63
+
64
+
### Install from GitHub
65
+
66
+
Use this path only if you need a branch or commit that is not yet published to npm.
67
+
68
+
```bash
69
+
npm install RobotWebTools/rclnodejs#<branch>
70
+
```
71
+
72
+
Or add `"rclnodejs":"RobotWebTools/rclnodejs#<branch>"` to your `package.json` dependency section.
48
73
49
74
> **Docker:** For containerized development, see the included [Dockerfile](./Dockerfile) for building and testing with different ROS distributions and Node.js versions.
50
75
51
76
See the [features](./docs/FEATURES.md) and try the [examples](https://github.com/RobotWebTools/rclnodejs/tree/develop/example) to get started.
52
77
53
78
### Prebuilt Binaries
54
79
55
-
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.
80
+
rclnodejs ships with prebuilt native binaries for common Linux configurations since `v1.5.2`, eliminating the need for compilation during installation. This applies to supported Linux environments when installing from npm or GitHub.
56
81
57
82
**Supported Platforms:**
58
83
@@ -74,25 +99,27 @@ npm install rclnodejs
74
99
75
100
## Quick Start
76
101
77
-
1. Source your ROS 2 environment.
102
+
Use these steps if you are working from this repository checkout and want to run one of the included examples.
78
103
79
-
```bash
80
-
source /opt/ros/<distro>/setup.bash
81
-
```
104
+
These steps assume the [installation prerequisites](#prerequisites) are already satisfied and your ROS 2 environment has been sourced.
82
105
83
-
2. Install the repository dependencies.
106
+
1. Install the repository dependencies from the project root.
You should see messages being published once per second. Explore more runnable examples in [example/](https://github.com/RobotWebTools/rclnodejs/tree/develop/example) and step-by-step guides in [tutorials/](./tutorials/).
118
+
You should see messages being published once per second.
119
+
120
+
If you want to build an application instead of running the repository examples, install rclnodejs into your own project with [Install from npm](#install-from-npm) and start from the sample code near the top of this README.
121
+
122
+
Explore more runnable examples in [example/](https://github.com/RobotWebTools/rclnodejs/tree/develop/example) and step-by-step guides in [tutorials/](./tutorials/).
96
123
97
124
## rclnodejs-cli
98
125
@@ -102,7 +129,7 @@ See the rclnodejs-cli repository for installation instructions and the current c
102
129
103
130
## API Documentation
104
131
105
-
API documentation is available [online](https://robotwebtools.github.io/rclnodejs/docs/index.html) or generate locally with`npm run docs`.
132
+
API documentation is available [online](https://robotwebtools.github.io/rclnodejs/docs/index.html). To generate it locally from this repository checkout, run`npm run docs`.
106
133
107
134
## Electron-based Visualization
108
135
@@ -164,7 +191,7 @@ obsSub.observable
164
191
165
192
See the [Observable Subscriptions Tutorial](./tutorials/observable-subscriptions.md) for more details.
166
193
167
-
## ROS2 Interface Message Generation
194
+
## ROS 2 Interface Message Generation
168
195
169
196
ROS client libraries convert IDL message descriptions into target language source code. rclnodejs provides the `generate-ros-messages` script to generate JavaScript message interface files and TypeScript declarations.
Before installing or running rclnodejs, source your ROS 2 environment:
27
+
28
+
```bash
29
+
source /opt/ros/<distro>/setup.bash
30
+
```
23
31
24
32
### Install rclnodejs
25
33
26
34
```bash
27
35
npm i rclnodejs
28
36
```
29
37
30
-
-**Note:** To install rclnodejs from GitHub, add `"rclnodejs":"RobotWebTools/rclnodejs#<branch>"` to your `package.json` dependencies.
38
+
To install from GitHub instead of npm, run:
39
+
40
+
```bash
41
+
npm install RobotWebTools/rclnodejs#<branch>
42
+
```
43
+
44
+
Or add `"rclnodejs":"RobotWebTools/rclnodejs#<branch>"` to your `package.json` dependencies.
31
45
32
46
### Prebuilt Binaries
33
47
34
-
rclnodejs ships with prebuilt native binaries for common Linux configurations since `v1.5.2`, eliminating the need for compilation during installation.
48
+
rclnodejs ships with prebuilt native binaries for common Linux configurations since `v1.5.2`, eliminating the need for compilation during installation. This applies to supported Linux environments when installing from npm or GitHub.
35
49
36
50
**Supported Platforms:**
37
51
@@ -52,21 +66,24 @@ npm install rclnodejs
52
66
## Documentation and Examples
53
67
54
68
- API documentation: [robotwebtools.github.io/rclnodejs/docs](https://robotwebtools.github.io/rclnodejs/docs/index.html)
rclnodejs generates JavaScript message interfaces and TypeScript declarations during installation for `rclnodejs > 1.5.0`. If you install additional ROS packages later, rerun:
77
+
rclnodejs generates JavaScript message interfaces and TypeScript declarations during installation for `rclnodejs > 1.5.0`. If you install additional ROS packages later, rerun the generator in your project:
63
78
64
79
```bash
65
80
npx generate-ros-messages
66
81
```
67
82
68
83
Generated files are written to `<your-project>/node_modules/rclnodejs/generated/`.
69
84
85
+
This step is only needed after adding ROS packages that were not present when rclnodejs was installed.
86
+
70
87
## Using rclnodejs with TypeScript
71
88
72
89
TypeScript declaration files are included in the package. In most projects, configuring your `tsconfig.json` is sufficient:
0 commit comments