ROS1 Docker container-container setup?
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.
Asked by mkopack on 2021-09-02 14:20:33 UTC
Answers
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:
https://answers.ros.org/question/228292/exposing-ros-containers-to-host-machine/
Asked by ruffsl on 2021-09-05 10:59:41 UTC
Comments
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
https://github.com/badpaybad/rosmaster-dockerfile
Asked by badpaybad on 2022-09-06 08:35:54 UTC
Comments