0
$\begingroup$

Rosanswers logo

I am following this example: http://wiki.ros.org/roslibjs/Tutorials/BasicRosFunctionality

I have two laptops, one is running Ubuntu with ROS; the other is running Windows. What I want to do is to control ROS using a non-ROS platform and I chose to use webpages running on browsers.

Experiment 1: Both browser(client) and rosbridge-server on a same computer

It works! And green "connected" showed up. Actually, both

ros.connect('ws://192.168.1.109:9090/');

and

ros.connect('ws://localhost:9090/');

works. Successful message of connected shows.

Experiment 2: Browser is running on another PC in the same LAN

I tried to use the following code in html. "192.168.1.109" is the IP address of the computer which is hosting the rosbridge-server in LAN. The LAN is setup through a TPLINK wireless router.

ros.connect('ws://192.168.1.109:9090/');

I could not get successful connected message.

When I typed http://192.168.1.109:9090/ in my browser in Windows, the following info showed up:

Can "Upgrade" only to "WebSocket".

There is some information showed up! So I guess there is some sort of connection!

However, I just cannot get the simple.html run right with successful message of "Connected".

Why is that?


Originally posted by richie on ROS Answers with karma: 16 on 2016-04-28

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I was using html code from github. It shall be a whole folder but I only used the html file in my PC.

The 6th line of simple.html is:

<script src="../build/roslib.js"></script>

The solution is to replaced it with

<script src="http://cdn.robotwebtools.org/roslibjs/current/roslib.min.js"></script>

I found the bug using debug tool provided by Chrome. Apparently I am not familiar with web programming at all.


Originally posted by richie with karma: 16 on 2016-04-29

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.