Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to launch several ROS Docker terminals connected to the same container with all ROS commands working?

Tags:

docker

ros

I launched Docker ROS in the main window through

sudo docker run -it osrf/ros:noetic-desktop-full

and then tried to open secondary terminal:

sudo docker exec -it <container_id> bash

, but a lot of commmands, like e.g. rostopic and roscore , do not work in the second terminal that I opened through exec. It just shows command not found when I type them.

like image 905
XXX Avatar asked Oct 14 '25 09:10

XXX


1 Answers

You need to source your ROS environment once you have your shell in the container:

. /opt/ros/noetic/setup.bash

Afterwards your ros commands should work.

like image 142
Christian Fritz Avatar answered Oct 17 '25 01:10

Christian Fritz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!