Containerized Xycar-ROS for Programmers Autonomous Drive Dev Course
- You need
docker-engine
installed in your machine - You need
docker-compose
installed in your machine
refer: https://docs.docker.com/engine/install/
If you installed
docker-desktop
, which includes both packages, you are good to go!
In order to run Xycar-ROS, you need to build docker image first.
example:
cd ~/kdt_practice
Change these values in Makefile
as you wish:
DOCKER_NAME
(name for your docker image)DOCKER_TAG
NETWORK_NAME
ROS_MASTER_URI
ROS_HOSTNAME
Choose ENTRYPOINT for master or slave
This might be changed in the future so that the container can choose its running mode according to the environmental variable
make build
This will take a couple of minutes; get some coffee β
At the end, if successful make
will ask your password to change ownership of ./xycar_ws/
.
β
During the build, an empty directory (./xycar_ws/
) will be created.
./xycar_ws/
will remain empty until you starts a container from the image.
β Make sure image has been created
docker image ls
The image size on my machine is 1.13GB
β Clean up dangling images
make clean
image
: image name inMakefile
networks
: network name inMakefile
- make sure you modify all of network names (hint: 2 places)
make
# or
make up
./xycar_ws/
automatically by catkin_make
inside
If you want to start multiple containers, modify docker-compose.yml
accordingly.
By starting multiple containers, you can emulate multiple machines connected to one network. You can practice for remote environment in this way.
Also, you can start a container with a specific command like roslaunch
by option command
.
If you want to start a master by roscore
or want to create ROS packages, or whatever, open interactive terminal for the live docker container which you started in step 2.
docker exec -it {image_name} /bin/bash
This directory is a bind-mounting volume for your container. You can put any files in this directory and can use it in your container like a virtual machine.
If you have access problem, change the permission of this directory.
make claim
You need to be able to use sudo
to do this.
If you are done with the container, you can stop it.
make down
- This will not remove docker-network.
- This will not remove any works done in
./xycar_ws/
.
Next time you start a container, you can continue from where you left off.
- June Kim : Creator - Github
This project is licensed under the MIT License
see the LICENSE file for details