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
`rclnodejs` is a Node.js client for the Robot Operating System (ROS 2). It provides a simple and easy JavaScript API for ROS 2 programming. TypeScript declarations are included to support use of rclnodejs in TypeScript projects.
3
+
`rclnodejs` is a Node.js client for the Robot Operating System (ROS 2). It provides a simple and easy JavaScript API for ROS 2 programming. TypeScript declarations are included to support use of rclnodejs in TypeScript projects.
4
4
5
-
Here's an example for how to create a ROS 2 node that publishes a string message in a few lines of JavaScript.
5
+
Here's an example for how to create a ROS 2 node that publishes a string message in a few lines of JavaScript.
*[Node.js](https://nodejs.org/en/) version between 8.12 - 12.x.
19
+
**Node.js**
20
+
21
+
-[Node.js](https://nodejs.org/en/) version between 8.12 - 12.x.
21
22
22
-
**ROS 2 SDK**
23
-
* See the ROS 2 SDK [Installation Guide](https://index.ros.org/doc/ros2/Installation/) for details.
24
-
**** DON'T FORGET TO [SOURCE THE ROS 2 STARTUP FILES](https://index.ros.org/doc/ros2/Tutorials/Configuring-ROS2-Environment/#source-the-setup-files)***
23
+
**ROS 2 SDK**
24
+
25
+
- See the ROS 2 SDK [Installation Guide](https://index.ros.org/doc/ros2/Installation/) for details.
26
+
-**DON'T FORGET TO [SOURCE THE ROS 2 STARTUP FILES](https://index.ros.org/doc/ros2/Tutorials/Configuring-ROS2-Environment/#source-the-setup-files)**
25
27
26
28
## Install rclnodejs
27
29
28
-
Install the rclnodejs version that is compatible with your installed version of ROS 2 (see table below).
29
-
30
+
Install the rclnodejs version that is compatible with your installed version of ROS 2 (see table below).
31
+
30
32
Run the following command for the most current version of rclnodejs
Type-aliases for the ROS2 messages can be found in the `types/interfaces.d.ts` file. To use a message type-alias follow the naming pattern <pkg_name>.[msg|srv].<type>, e.g., sensor_msgs.msg.LaserScan or the std_msgs.msg.String as shown below.
158
+
Type-aliases for the ROS2 messages can be found in the `types/interfaces.d.ts` file. To use a message type-alias follow the naming pattern <pkg_name>.[msg|srv].<type>, e.g., sensor_msgs.msg.LaserScan or the std_msgs.msg.String as shown below.
159
+
149
160
```
150
161
const msg: rclnodejs.std_msgs.msg.String = {
151
162
data: 'hello ROS2 from rclnodejs'
152
163
}
153
164
```
165
+
154
166
**Note** that the interface.d.ts file is updated each time the generate_messages.js script is run.
0 commit comments