Skip to content

Commit e30eedc

Browse files
committed
Address comments
1 parent 47d0b0b commit e30eedc

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ rclnodejs.init().then(() => {
3434
- [Electron-based Visualization](#electron-based-visualization)
3535
- [Using TypeScript](#using-rclnodejs-with-typescript)
3636
- [ROS2 Interface Message Generation](#ros2-interface-message-generation-important)
37-
- [Examples](https://github.com/RobotWebTools/rclnodejs/tree/develop/example)
38-
- [TypeScript Demo](https://github.com/RobotWebTools/rclnodejs/tree/develop/ts_demo)
3937
- [Efficient Usage Tips](./docs/EFFICIENCY.md)
4038
- [FAQ and Known Issues](./docs/FAQ.md)
4139
- [Building from Scratch](./docs/BUILDING.md)
@@ -70,17 +68,13 @@ npm i [email protected]
7068

7169
- **Note:** to install rclnodejs from GitHub: add `"rclnodejs":"RobotWebTools/rclnodejs#<branch>"` to your `package.json` dependency section.
7270

71+
Please try with [examples](https://github.com/RobotWebTools/rclnodejs/tree/develop/example) once you're good to go.
72+
7373
## rclnodejs-cli
7474

7575
[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.
7676

7777
```
78-
_ _ _
79-
_ __ ___| |_ __ ___ __| | ___ (_)___
80-
| '__/ __| | '_ \ / _ \ / _` |/ _ \| / __|
81-
| | | (__| | | | | (_) | (_| | __/| \__ \
82-
|_| \___|_|_| |_|\___/ \__,_|\___|/ |___/
83-
|__/
8478
Usage: rclnodejs [command] [options]
8579
8680
Options:
@@ -102,6 +96,8 @@ rclnodejs enables the creation of rich, interactive desktop visualization applic
10296

10397
To see this in action, try the `electron_demo/turtle_tf2` demo which demonstrates real-time coordinate frame visualization with dynamic transform broadcasting, interactive 3D navigation, and keyboard-controlled turtle movement - providing a hands-on way to understand ROS 2 TF2 concepts through visual feedback. You can find more Electron-based examples and demos in the [electron_demo](https://github.com/RobotWebTools/rclnodejs/tree/develop/electron_demo) directory.
10498

99+
![demo screenshot](./electron_demo/turtle_tf2/turtle-tf2-demo.png)
100+
105101
## Using rclnodejs with TypeScript
106102

107103
`rclnodejs` API can be used in TypeScript projects. You can find the TypeScript declaration files (\*.d.ts) in the `types/` folder.
@@ -113,7 +109,7 @@ Your `tsconfig.json` file should include the following compiler options:
113109
"compilerOptions": {
114110
"module": "commonjs",
115111
"moduleResolution": "node",
116-
"target": "es6",
112+
"target": "es2020",
117113
// your additional options here
118114
},
119115
}
@@ -131,7 +127,7 @@ rclnodejs.init().then(() => {
131127
});
132128
```
133129

134-
The benefits of using TypeScript become evident when working with more complex use-cases. ROS messages are defined in the `types/interfaces.d.ts` module. This module is updated as part of the `generate-ros-messages` process described in the next section.
130+
The benefits of using TypeScript become evident when working with more complex use-cases. ROS messages are defined in the `types/interfaces.d.ts` module. This module is updated as part of the `generate-ros-messages` process described in the next section, see more [demos](https://github.com/RobotWebTools/rclnodejs/tree/develop/ts_demo).
135131

136132
## ROS2 Interface Message Generation (important)
137133

electron_demo/turtle_tf2/README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ The turtle_tf2 demo showcases:
1313
- **3D Visualization**: WebGL-based rendering using Three.js for immersive coordinate frame visualization
1414
- **Interactive Controls**: Web interface for spawning turtles, controlling motion, and managing transforms
1515

16+
![demo screenshot](./turtle-tf2-demo.gif)
17+
1618
## Features
1719

1820
### TF2 Broadcasters
@@ -39,8 +41,8 @@ The turtle_tf2 demo showcases:
3941

4042
### Control Interface
4143

42-
- **Turtle Spawning**: Create turtle1 and turtle2 instances
43-
- **Motion Control**: Start/stop turtle movements
44+
- **Turtle Spawning**: Create turtle2 instance (turtle1 spawns automatically with turtlesim)
45+
- **Motion Control**: WASD keyboard controls for turtle1 movement
4446
- **Demo Management**: Initialize and reset demo state
4547
- **Transform Filtering**: Toggle visibility of different frame types
4648

@@ -49,7 +51,7 @@ The turtle_tf2 demo showcases:
4951
### System Requirements
5052

5153
- **ROS2**: Humble, Iron, or Rolling distribution
52-
- **Node.js**: Version 16 or higher
54+
- **Node.js**: Version 18 or higher (for compatibility with latest Electron)
5355
- **turtlesim**: ROS2 turtle simulation package
5456
- **Electron**: For desktop application framework
5557

@@ -142,13 +144,12 @@ npm start
142144

143145
4. **Use the web interface to**:
144146
- Click "Start Demo" to initialize all TF2 broadcasters
145-
- Click "Spawn Turtle1" to create turtle1 (required for dynamic frame)
146-
- Click "Spawn Turtle2" to create the second turtle
147+
- Click "Spawn Turtle2" to create the second turtle (turtle1 spawns automatically)
147148
- Use WASD keys to control turtle1 movement
148149
- Watch turtle2 automatically follow turtle1
149150
- Use frame toggle buttons to show/hide specific transforms
150151

151-
**⚠️ Important**: The dynamic frame (`carrot1_dynamic`) is only visible when turtle1 exists, as it orbits around turtle1's position in a circular pattern. Make sure to spawn turtle1 first before trying to see the dynamic frame.
152+
**⚠️ Important**: The dynamic frame (`carrot1_dynamic`) orbits around the static frame (`carrot1_static`) in a circular pattern with a 2-unit radius, regardless of turtle positions.
152153

153154
## Demo Components
154155

@@ -183,7 +184,7 @@ npm start
183184
- **world**: Global reference frame (origin)
184185
- **turtle1/turtle2**: Turtle body frames following turtlesim poses
185186
- **carrot1_static**: Static frame with fixed relationship to world
186-
- **carrot1_dynamic**: Dynamic frame with time-varying circular motion
187+
- **carrot1_dynamic**: Dynamic frame with circular motion around carrot1_static (2-unit radius)
187188
- **carrot1_fixed**: Fixed offset frame relative to turtle1
188189

189190
### Transform Chain
@@ -259,7 +260,7 @@ You can observe the following behavior by:
259260
### Frame Visibility
260261

261262
- **Toggle Static**: Show/hide carrot1_static frame (red sphere, fixed position)
262-
- **Toggle Dynamic**: Show/hide carrot1_dynamic frame (orange sphere, orbits around turtle1)
263+
- **Toggle Dynamic**: Show/hide carrot1_dynamic frame (orange sphere, orbits around carrot1_static)
263264
- **Toggle Fixed**: Show/hide carrot1_fixed frame (purple sphere, fixed offset from turtle1)
264265

265266
**Visual Guide**:
@@ -315,7 +316,7 @@ You can observe the following behavior by:
315316
6. **"electron: not found" or native module errors**
316317

317318
- Make sure you ran `npm run rebuild` after `npm install`
318-
- Ensure Node.js version is compatible (16 or higher)
319+
- Ensure Node.js version is compatible (18 or higher)
319320
- Try deleting `node_modules` and running `npm install && npm run rebuild` again
320321

321322
7. **"THREE is not defined" or script loading errors**
1.66 MB
Loading
113 KB
Loading

0 commit comments

Comments
 (0)