Dcoker + ROS
Using ROS images
Running ROS containers
In a new terminal on the host machine, find the name of your new container, last container started using:
Using the name of the container as the ID, in writing this tutorial docker happened to assign the string "nostalgic_morse", we can start additional bash session in the same container by running:
Once inside, we'll need to setup our environment. The best way to do this is to using the entrypoint script included in the docker image:
ROS + Docker Network
Using GUI's with Docker
First create a directory with a Dockerfile and entrypoint script inside.
Paste the following content into the Dockerfile.
Build the image. Don't forget the period at the end of that command.
Now create a script to run the image called run_my_image.bash
Make the script executable
Execute the script
Then inside the container launch RViz
Using GUI's with Docker
Using X server
X server is a windowing system for bitmap displays, common on linux operating systems. There are several ways one can connect a container to a host's X server for display. A brief description and tradeoffs for each method below:
The first listed is simple, but unsecure
The second is safer, but non-isolated
The third is isolated, but not as portable
The fourth is isolated, works remotely, but is slow.
The simple way
Troubleshoot
Authorization required, but no authorization protocol specified.
Build without cache
Copy File From Container To Host
The docker cp command allows you to copy files and directories from a container's file system to your local machine, whether the container is running or stopped.
Where:
src_path is the path on the container of the file you want to copy.
container is the name or the ID of the container you want to copy files from.
dest_path is the path on your local machine of the directory you want to copy files to.
To get the name or ID of the container you want to copy files from, you can use the docker ps -a command, which will output the list of all the running and stopped containers.
Last updated