gramaziokohler / roslibpy

Python ROS Bridge library
MIT License
273 stars 56 forks source link

How to modify the listening port #104

Closed imitatorgkw closed 1 year ago

imitatorgkw commented 1 year ago

Port 9090 is occupied by other programs. Can I modify the listening port? If so, what should we do?

gonzalocasas commented 1 year ago

Port 9090 is not opened by roslibpy, it is opened by the rosbridge server. So, you can control that when you launch it. Are you launching it from a linux box or are you using some of the docker images?

gonzalocasas commented 1 year ago

Once you changed the port on the bridge's launch file, you can also select the correct port when you create the Ros instance of roslibpy. For example, if you launch ros bridge on port 9085, you can then connect using ros = roslibpy.Ros(host='localhost', port=9085) (localhost would mean you are running ROS on the same machine, if it's a different one, you'd replace that with the IP of the ros machine).

Since this does not require code changes on this repository, I'm going to close the issue, but please feel free to keep comment until it's clear how to change the ros bridge launch port.

imitatorgkw commented 1 year ago

Thank you. I changed the port through the following command. roslaunch rosbridge_server rosbridge_websocket.launch port:=9091