How to change IP to connect to ROS from a browser using ROSBRIDGE without changing the code [closed]
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
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.