Skip to content

Commit 341ed13

Browse files
qiuzhongMinggang Wang
authored and
Minggang Wang
committed
[Update] Use flexible bridge address and update README for the demo (#111)
When the user open the demo page remotely, it need to update the up-board IP to run the demo. This is inconvenient and not necessary. We can use window.location.hostname to fix it.
1 parent fa57972 commit 341ed13

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

demo/README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ $ npm install
3636
$ npm install -g http-server
3737
```
3838

39-
## Run demo
40-
### Update the web bridge up
41-
Get the Up-board Squared IP address, and update it in [index.html](./index.html) at line 84: replace `127.0.0.1` to the IP
42-
39+
## Run the demo
4340
### Start up MicroRTPSAgent
4441
New a terminal session, run
4542
```
@@ -64,8 +61,7 @@ $ http-server -c-1
6461
```
6562

6663
### Try to control the robot remotely
67-
Now you can put the TurtleBot3 robot on the ground. Let another PC at the same wireless network, then open the browser on this PC and enter:
68-
`http://<up-board ip>:8080`. After the page loaded, you can press the `Up/Left/Right/Down` buttons to control the robot remotely.
64+
Now you can put the TurtleBot3 robot on the ground. Let another PC be in the same wireless network, then launch the browser and enter: `http://<up-board ip>:8080`. After the page loaded, you can press the `Up/Left/Right/Down` buttons to control the robot remotely.
6965

7066
## Known limitation:
7167
If you shutdown the MicroRTPSAgent utility, you have to reset the OpenCR before you launch it again.

demo/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<script src="js/controller.js"></script>
8080
<script>
8181
let ros = new ROSLIB.Ros();
82-
let bridgeHost = '127.0.0.1';
82+
let bridgeHost = window.location.hostname;
8383
let bridgePort = 9090;
8484

8585
ros.on('connection', function() {

0 commit comments

Comments
 (0)