- A Docker container for ROS2 and Gazebo.
- GUI is enabled if WSLg is installed.
- docker, docker-compose
- (Optional) WSLg
git clone {this-repository}
cd {this-repository}
docker compose build
docker compose up -d
docker compose exec ros2 bash
- If your user id is not 1000, add
--build-arg user_id=$(id -u)
todocker compose build
command.
From Introducing turtlesim and rqt — ROS 2 Documentation: Galactic documentation
ros2 run turtlesim turtlesim_node
From Testing Gazebo and ROS 2 integration | Gazebo : Tutorial
gazebo --verbose /opt/ros/galactic/share/gazebo_plugins/worlds/gazebo_ros_diff_drive_demo.world
Open another terminal
ros2 topic pub /demo/cmd_demo geometry_msgs/Twist '{linear: {x: 1.0}, angular: {z: 1.0}}' -1
You may better to follow this steps to set up your workspace. Creating a workspace — ROS 2 Documentation: Galactic documentation
docker compose stop
docker compose down
docker compose exec --user root ros2 bash