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
[Doc] Clarify README install and quick start guidance (#1453)
- separate npm installation from repo checkout quick start
- make ROS 2 environment sourcing explicit in prerequisites and examples
- add direct GitHub install instructions
- clarify that GitHub installs usually build from source
- limit prebuilt binary claims to the published npm package
- improve docs and message-generation wording
- align npmjs README with the updated package-consumer guidance
Fix: #1452
[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
+
```
53
+
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
+
GitHub installs normally build from source. The published npm package includes prebuilt binaries for supported Linux targets, but this repository does not track those prebuilt artifacts.
69
+
70
+
```bash
71
+
npm install RobotWebTools/rclnodejs#<branch>
72
+
```
73
+
74
+
Or add `"rclnodejs":"RobotWebTools/rclnodejs#<branch>"` to your `package.json` dependency section.
48
75
49
76
> **Docker:** For containerized development, see the included [Dockerfile](./Dockerfile) for building and testing with different ROS distributions and Node.js versions.
50
77
51
78
See the [features](./docs/FEATURES.md) and try the [examples](https://github.com/RobotWebTools/rclnodejs/tree/develop/example) to get started.
52
79
53
80
### Prebuilt Binaries
54
81
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.
82
+
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 the published npm package.
56
83
57
84
**Supported Platforms:**
58
85
@@ -74,25 +101,27 @@ npm install rclnodejs
74
101
75
102
## Quick Start
76
103
77
-
1. Source your ROS 2 environment.
104
+
Use these steps if you are working from this repository checkout and want to run one of the included examples.
78
105
79
-
```bash
80
-
source /opt/ros/<distro>/setup.bash
81
-
```
106
+
These steps assume the [installation prerequisites](#prerequisites) are already satisfied and your ROS 2 environment has been sourced.
82
107
83
-
2. Install the repository dependencies.
108
+
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/).
120
+
You should see messages being published once per second.
121
+
122
+
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.
123
+
124
+
Explore more runnable examples in [example/](https://github.com/RobotWebTools/rclnodejs/tree/develop/example) and step-by-step guides in [tutorials/](./tutorials/).
96
125
97
126
## rclnodejs-cli
98
127
@@ -102,7 +131,7 @@ See the rclnodejs-cli repository for installation instructions and the current c
102
131
103
132
## API Documentation
104
133
105
-
API documentation is available [online](https://robotwebtools.github.io/rclnodejs/docs/index.html) or generate locally with`npm run docs`.
134
+
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
135
107
136
## Electron-based Visualization
108
137
@@ -164,7 +193,7 @@ obsSub.observable
164
193
165
194
See the [Observable Subscriptions Tutorial](./tutorials/observable-subscriptions.md) for more details.
166
195
167
-
## ROS2 Interface Message Generation
196
+
## ROS 2 Interface Message Generation
168
197
169
198
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 the published npm package.
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