@@ -85,35 +85,54 @@ The demo uses the following key dependencies:
8585 This step is crucial for ensuring that rclnodejs and other native dependencies are properly compiled for your system.
8686
87874 . ** Source ROS2 environment** :
88+
8889 ``` bash
8990 source /opt/ros/$ROS_DISTRO /setup.bash
9091 ```
9192
93+ ** Important** : The ROS2 environment must be sourced in the same terminal session where you run ` npm start ` .
94+
9295## Running the Demo
9396
97+ ** ⚠️ Important Setup Note** : Before running the demo, make sure to:
98+
99+ 1 . Source the ROS2 environment in your terminal: ` source /opt/ros/$ROS_DISTRO/setup.bash `
100+ 2 . Keep this terminal session active for the entire demo run
101+
94102### Method 1: Complete Demo
95103
96104Start the full demo with all components (ensure you have run ` npm install && npm run rebuild ` first):
97105
98106``` bash
107+ # Source ROS2 first
108+ source /opt/ros/$ROS_DISTRO /setup.bash
109+
110+ # Then start the demo
99111npm start
100112```
101113
102114### Method 2: Step-by-Step Launch
103115
104- 1 . ** Start turtlesim (in separate terminal) ** :
116+ 1 . ** Source ROS2 environment ** :
105117
106118 ``` bash
119+ source /opt/ros/$ROS_DISTRO /setup.bash
120+ ```
121+
122+ 2 . ** Start turtlesim (in separate terminal, also sourced)** :
123+
124+ ``` bash
125+ source /opt/ros/$ROS_DISTRO /setup.bash
107126 ros2 run turtlesim turtlesim_node
108127 ```
109128
110- 2 . ** Launch the Electron application** :
129+ 3 . ** Launch the Electron application** :
111130
112131 ``` bash
113132 npm start
114133 ```
115134
116- 3 . ** Use the web interface to** :
135+ 4 . ** Use the web interface to** :
117136 - Click "Spawn Turtle1" to create the first turtle
118137 - Click "Spawn Turtle2" to create the second turtle
119138 - Click "Start Demo" to initialize all TF2 broadcasters
@@ -200,10 +219,12 @@ world → turtle2
200219
201220### Common Issues
202221
203- 1 . ** "Cannot connect to ROS2"**
222+ 1 . ** "Cannot connect to ROS2" or "librcl.so: cannot open shared object file" **
204223
205224 - Ensure ROS2 is sourced: ` source /opt/ros/$ROS_DISTRO/setup.bash `
225+ - ** Critical** : Source ROS2 in the SAME terminal where you run ` npm start `
206226 - Check if ROS2 daemon is running: ` ros2 daemon status `
227+ - Verify ROS2 installation: ` ros2 --version `
207228
2082292 . ** "Turtlesim not responding"**
209230
@@ -228,9 +249,15 @@ world → turtle2
228249 - Try deleting ` node_modules ` and running ` npm install && npm run rebuild ` again
229250
2302516 . ** "THREE is not defined" or script loading errors**
231- - The demo uses CDN versions of Three.js which require internet connection
232- - If you see CSP (Content Security Policy) errors, ensure the CSP in index.html allows CDN domains
233- - For offline use, you can install Three.js locally:
` npm install [email protected] ` and update script paths in index.html
252+
253+ - Ensure Three.js is properly installed:
` npm install [email protected] ` 254+ - Check that ` node_modules/three/build/three.min.js ` exists
255+ - If issues persist, try reinstalling: ` rm -rf node_modules && npm install && npm run rebuild `
256+
257+ 7 . ** WSL (Windows Subsystem for Linux) specific issues**
258+ - Install audio libraries: ` sudo apt install libasound2t64 libasound2-dev `
259+ - Enable X11 forwarding for GUI: Install VcXsrv or similar X server
260+ - Some GUI features may be limited in WSL environment
234261
235262### Debugging Commands
236263
0 commit comments