How to set a fix port to roslaunch?

asked 2020-10-28 10:48:13 -0500

wiyogo gravatar image

updated 2020-10-28 10:50:47 -0500

I work in a company network with a strict firewall setting. I start the roscore and the roslaunch on the robot and the RViz is started on my desktop PC. The roscore has the port 11311. The port was block so that I couldn't start the RViz on my PC. Now, the port 11311 is open, and RViz can be started. However, the rostopics are blocked.

If I see on the console of my robot, I can see these messages for instance:

started roslaunch server http://x.x.x.x:45287/
SUMMARY
.....
auto-starting new master
process[master]: started with pid [16014]
ROS_MASTER_URI=http://x.x.x.x:11311/

On the robot console I can see the rostopic output with rostopic echo mytopic. However, on my PC the rostopic echo mytopic doesn't print anything. Thus, my observation is that the rostopics are transfered through the blocked port 45287. Is my observation correct? If yes, how can I start the roslaunch with a fix port? The port of the roslaunch is always random.

Running roslaunch -p 45287 mynode mylaunch.launch set the port of the roscore master. I can request a certain port to be opened to the network admin, but not a range of ports.

edit retag flag offensive close merge delete