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` dependency section.
72
70
71
+
Please try with [examples](https://github.com/RobotWebTools/rclnodejs/tree/develop/example) once you're good to go.
72
+
73
73
## rclnodejs-cli
74
74
75
75
[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.
76
76
77
77
```
78
-
_ _ _
79
-
_ __ ___| |_ __ ___ __| | ___ (_)___
80
-
| '__/ __| | '_ \ / _ \ / _` |/ _ \| / __|
81
-
| | | (__| | | | | (_) | (_| | __/| \__ \
82
-
|_| \___|_|_| |_|\___/ \__,_|\___|/ |___/
83
-
|__/
84
78
Usage: rclnodejs [command] [options]
85
79
86
80
Options:
@@ -102,6 +96,8 @@ rclnodejs enables the creation of rich, interactive desktop visualization applic
102
96
103
97
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.
`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:
113
109
"compilerOptions": {
114
110
"module":"commonjs",
115
111
"moduleResolution":"node",
116
-
"target":"es6",
112
+
"target":"es2020",
117
113
// your additional options here
118
114
},
119
115
}
@@ -131,7 +127,7 @@ rclnodejs.init().then(() => {
131
127
});
132
128
```
133
129
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).
Copy file name to clipboardExpand all lines: electron_demo/turtle_tf2/README.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@ The turtle_tf2 demo showcases:
13
13
-**3D Visualization**: WebGL-based rendering using Three.js for immersive coordinate frame visualization
14
14
-**Interactive Controls**: Web interface for spawning turtles, controlling motion, and managing transforms
15
15
16
+

17
+
16
18
## Features
17
19
18
20
### TF2 Broadcasters
@@ -39,8 +41,8 @@ The turtle_tf2 demo showcases:
39
41
40
42
### Control Interface
41
43
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
44
46
-**Demo Management**: Initialize and reset demo state
45
47
-**Transform Filtering**: Toggle visibility of different frame types
46
48
@@ -49,7 +51,7 @@ The turtle_tf2 demo showcases:
49
51
### System Requirements
50
52
51
53
-**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)
53
55
-**turtlesim**: ROS2 turtle simulation package
54
56
-**Electron**: For desktop application framework
55
57
@@ -142,13 +144,12 @@ npm start
142
144
143
145
4.**Use the web interface to**:
144
146
- 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)
147
148
- Use WASD keys to control turtle1 movement
148
149
- Watch turtle2 automatically follow turtle1
149
150
- Use frame toggle buttons to show/hide specific transforms
150
151
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.
152
153
153
154
## Demo Components
154
155
@@ -183,7 +184,7 @@ npm start
183
184
-**world**: Global reference frame (origin)
184
185
-**turtle1/turtle2**: Turtle body frames following turtlesim poses
185
186
-**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)
187
188
-**carrot1_fixed**: Fixed offset frame relative to turtle1
188
189
189
190
### Transform Chain
@@ -259,7 +260,7 @@ You can observe the following behavior by:
0 commit comments