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

How to change IP to connect to ROS from a browser using ROSBRIDGE without changing the code [closed]

asked 2017-09-18 08:13:27 -0500

alberhhh gravatar image

updated 2017-10-03 06:20:38 -0500

Dear community,

I have tried to design a web page that allows me to connect to ROS via ROSBRIDGE. If I want to connect to master I have to change the IP in the code using roslibjs like:

var ros = new ROSLIB.Ros({ url : 'ws://192.168.1....:9090' });

But I want to allow the person that is using the browser to change the IP and connect to any computer using ROS without having to change the code. For example, having a text input to write the IP direction and after it just clicking a button connect to ROS. I have tried to use a function that changes the URL data (IP) and the problem is that the Java containing the functions to connect to ROS are executed at the beginning when I open the web and not when I want to execute it, after typing the IP address.

I have seen that in Robot Web Tools they have an web page named ROSWEB that allows you to make it but I don't understand how they can do it.

Is there any way to get this?

Thanks you for reading my question

edit retag flag offensive close merge delete



This is not an answer, but: what you describe is more a javascript / html(5) development issue than a ROS issue. Yes, Robot Web Tools interacts with ROS, but it's really just a javascript library, and should be treated that way. You might want to look at more javascript/webdev focused fora.

gvdhoorn gravatar image gvdhoorn  ( 2017-09-20 16:21:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-09-29 15:44:41 -0500

The best way is to instantiate the var ros = new ROSLIB.Ros({ url : 'ws://192.168.1....:9090' }); only when the user informs the IP and click Submit.

Not automatically instantiate when the page is loaded.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-09-18 08:13:27 -0500

Seen: 1,353 times

Last updated: Oct 03 '17