roscore is called even though it is already running
I am working with ROS in a container. On one terminal I call docker run
and the container with ROS gets executed and I got a bash. In that I call roscore
In another terminal I call docker exec
and I join the container and there I can rosrun my nodes without problem. I usually do it twice or thrice to have several terminal to run nodes. They all use the roscore that got executed in the first terminal (they don't run of course if roscore is not executed)
Today I am trying roslaunch. I put several nodes in my launch file but when I call the file with roslaunch teleopbot key_to_twistramp.launch
I can see that roscore is executed again in the terminal. So roslaunch completely ignores the roscore that is running in the other terminal
Why is this so? I thought it would skip the roscore since it is already running there. It is actually no much problem since my nodes get executed but I am wondering why
for reference the first roscore
roscore
... logging to /root/.ros/log/e453a93e-c416-11ea-9aad-0242ac110002/roslaunch-2205bc4dcd80-7257.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://2205bc4dcd80:34499/
ros_comm version 1.12.14
SUMMARY
========
PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.14
NODES
auto-starting new master
process[master]: started with pid [7267]
ROS_MASTER_URI=http://2205bc4dcd80:11311/
setting /run_id to e453a93e-c416-11ea-9aad-0242ac110002
process[rosout-1]: started with pid [7280]
started core service [/rosout]
^C[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
When I launch
roslaunch teleopbot key_to_twistramp.launch
... logging to /root/.ros/log/e453a93e-c416-11ea-9aad-0242ac110002/roslaunch-2205bc4dcd80-7297.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://2205bc4dcd80:46339/
SUMMARY
========
PARAMETERS
* /keys_to_twist/angular_accel: 1.1
* /keys_to_twist/angular_scale: 0.1
* /keys_to_twist/linear_accel: 1.1
* /keys_to_twist/linear_scale: 0.8
* /rosdistro: kinetic
* /rosversion: 1.12.14
NODES
/
key_publisher (teleopbot/key_publisher.py)
keys_to_twist (teleopbot/keys_to_twist_with_ramps.py)
ROS_MASTER_URI=http://localhost:11311
process[key_publisher-1]: started with pid [7314]
Publishing keystrokes. Press Ctrl-C to exit...
process[keys_to_twist-2]: started with pid [7315]
linear scale 0.8
angular scale 0.1
linear accel 1.1
angular accel 1.1
[keys_to_twist-2] killing on exit
[key_publisher-1] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done