ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rosbridge - communicate with ros using another Laptop

asked 2016-04-28 06:13:59 -0500

richie gravatar image

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

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-04-29 07:15:57 -0500

richie gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-04-28 06:13:59 -0500

Seen: 2,062 times

Last updated: Apr 29 '16