ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

ROS1 Docker container-container setup?

asked 2021-09-02 14:20:33 -0600

mkopack gravatar image

Hey all,

Fairly familiar with ROS1, but for the first time we're trying to use Docker containers to segment things up as some other stuff we're going to be interfacing with is being provided to us in a container already (with a ROS1 interface).

I have figured out how to pull one of the standard ROS melodic container images and get it stood up on my machine, map a volume on my host to a directory inside the container, then go into the container and get the environment setup and able to compile code and such.

What I'm struggling with is how do I set up 2 containers and do the simple talker/listener example between them (talking running on 1 container, listener inside another) ? I see an example that shows that for ROS2, but haven't been able to find anything for ROS1. Which container has to run MASTER? (Or do I put that in a container of it's own??)

Is this even doable without having to go to Kubernetes (which is another big black hole to me)?

Kind of stumped here, and being so new to Docker I need things pretty much step by step. I'm not even using Dockerfiles yet, I'm just doing: docker run -dt --name talkercontainer --restart unless-stopped -v pwd:/root/workspace amd64/ros:melodic

(and then similar to set up the listenercontainer)

Any help is appreciated.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2022-09-06 08:35:54 -0600

I do similar like this run roscore in docker container to make it become ros master other computer or docker container as ros node connect to the same ros master

edit flag offensive delete link more

answered 2021-09-05 10:59:41 -0600

ruffsl gravatar image

I'll link to an example docker compose file from an past reversion of the Docker Hub docs for ROS that demonstrates using multiple ROS1 nodes across multiple containers:

Also related to this topic:

edit flag offensive delete link more

Question Tools



Asked: 2021-09-02 14:20:33 -0600

Seen: 529 times

Last updated: Sep 05 '21