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
-**Note:** to install rclnodejs from GitHub: add `"rclnodejs":"RobotWebTools/rclnodejs#<branch>"` to your `package.json` depdendency section.
@@ -95,9 +95,9 @@ rclnodejs.init().then(() => {
95
95
The benefits of using TypeScript become evident when working with more complex use-cases. The ROS 2 messages are defined in the `types/interfaces.d.ts` module. This module is updated as part of the `generate_messages` process. Here's a trivial example of working with a String msg.
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
159
160
-
```
161
-
const msg: rclnodejs.std_msgs.msg.String = {
162
-
data: 'hello ROS2 from rclnodejs'
163
-
}
160
+
```typescript
161
+
const msg:rclnodejs.std_msgs.msg.String= {
162
+
data: 'hello ROS2 from rclnodejs',
163
+
};
164
164
```
165
165
166
166
**Note** that the interface.d.ts file is updated each time the generate_messages.js script is run.
0 commit comments