A ROS2 Foxy Docker container for mobile robotics labs in ELE207.
- Install [Docker Desktop] (https://docs.docker.com/desktop/). Alternatively if you are using Linux you can only instal Docker Engine as well.
- Clone this repository, and in a terminal window navigate to it using the
cd PATHcommand. Note:PATHhas to be replaced with an actual path, e.g.cd C:\Users\max\Desktop\ele207_ros2_docker. - Build the docker image:
docker build -t ele207/ros2_env .
- Run the docker container:
docker run -it --net=host --rm --name ele207_ros2_container ele207/ros2_envNote: This will automatically also start the rosboard node to visualize topics. The rosboard can be accessed in a browser window under the following URL:http://localhost:8888/ - Opening a terminal window in the docker container:
docker exec -it ele207_ros2_container bash
To change the ROS_DOMAIN_ID modify line 32 in the Dockerfile file. Afterwards you have to rebuild the docker image as described in Setup Process.
- SSH into the turtlebot and run
ros2 launch turtlebot3_manipulation_bringup hardware.launch.py. - Open a terminal window and run
docker run -it --net=host --rm --name ele207_ros2_container ele207/ros2_env - Open another terminal window and run
docker exec -it ele207_ros2_container bash. This will give you access to the terminal inside the Docker container. In the same terminal window runros2 run braitenberg_vehicle controller
- Ctrl+C the terminal window that is running the controller.
- Use the vscode Container extention to modify the controller file located in
ele207/ros2_env/Files/root/ros2_ws/src/braitenberg_vehicle/braitenberg_vehicle/controller.py. After modification save the file with Ctrl+S. - Run the controller using the
ros2 run braitenberg_vehicle controllercommand.