Spaces:
Paused
Paused
Download test_node.js from jatin25027/robot-simulator: direct link, hf CLI and curl.
- Browser
- Download file 554 Bytes
-
https://huggingface.co/spaces/jatin25027/robot-simulator/resolve/main/test_node.js
- Command line
-
hf download hf://spaces/jatin25027/robot-simulator/test_node.js
-
curl -L -o test_node.js https://huggingface.co/spaces/jatin25027/robot-simulator/resolve/main/test_node.js
554 Bytes
| const { spawn } = require('child_process'); | |
| const child = spawn('bash', ['-c', 'source /opt/ros/humble/setup.bash && cd ros_2 && source install/setup.bash && ros2 run robot_proximity interactive_runner'], { | |
| env: { ...process.env, DISPLAY: '' } | |
| }); | |
| child.stdout.on('data', d => console.log('STDOUT:', d.toString())); | |
| child.stderr.on('data', d => console.log('STDERR:', d.toString())); | |
| child.on('close', c => console.log('EXIT:', c)); | |
| setTimeout(() => { | |
| child.stdin.write('1\n'); | |
| }, 2000); | |
| setTimeout(() => { | |
| child.stdin.write('3\n'); | |
| }, 4000); | |