Dockerized ROS 2 Humble + MoveIt 2 simulator for a 6-axis robotic arm with C++ commander node.
50K+
A fully containerized ROS 2 (Humble) environment for a custom 6-axis robotic arm with a parallel prismatic gripper. Motion planning is handled by MoveIt 2, hardware states are tracked via ROS 2 Control, and a custom C++ Commander node enables programmatic trajectory execution.
The entire stack — solver algorithms, desktop graphics, and workspace dependencies — is baked into the image. No native ROS 2 or MoveIt 2 installation required.
| Component | Details |
|---|---|
| Base OS | Ubuntu 22.04 LTS |
| Middleware | ROS 2 Humble Desktop Full |
| DDS Layer | CycloneDDS (rmw_cyclonedds_cpp) |
| Motion Planning | MoveIt 2 (OMPL Pipelines) |
| Hardware Interface | ROS 2 Control — Mock Hardware Encoders |
| Commander Node | Native C++ MoveGroup Interface |
In an empty directory on your host machine, create a docker-compose.yml file.
Linux:
services:
moveit2_arm:
image: morshedasif/robotic_arm_moveit2:latest
container_name: robotic_arm_container
network_mode: host
ipc: host
environment:
- DISPLAY=${DISPLAY}
- QT_X11_NO_MITSHM=1
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
stdin_open: true
tty: true
command: bash
Windows (WSL2 + VcXsrv):
services:
moveit2_arm:
image: morshedasif/robotic_arm_moveit2:latest
container_name: robotic_arm_container
network_mode: host
ipc: host
environment:
- DISPLAY=host.docker.internal:0.0
- QT_X11_NO_MITSHM=1
stdin_open: true
tty: true
command: bash
On Windows, VcXsrv must be running before you start the container. No X11 socket mount is needed — the display is forwarded over TCP instead.
Linux only — allow the container to access your X server:
xhost +local:docker
Then start the container (both platforms):
docker compose run --rm moveit2_arm
Your terminal prompt will change to indicate you are inside the containerized ROS 2 environment.
Running the full pipeline requires three concurrent processes. Open two additional terminal tabs on your host and connect each to the running container:
docker exec -it robotic_arm_container bash
You should now have 3 active terminals inside the container.
Starts the robot state publisher, controller manager, kinematics configuration, and RViz 2:
ros2 launch my_robot_bringup my_robot.launch.xml
Expected: RViz 2 opens with the 6-axis arm and gripper in the home pose, ready for planning.
Spins up the C++ Commander, which connects MoveGroup action clients for both the arm and gripper planning groups:
ros2 run my_robot_commander_cpp commander
Expected: Console logs confirm both planning groups have connected and are actively spinning.
Open / Close Gripper:
ros2 topic pub --once /open_gripper example_interfaces/msg/Bool "data: false"
Free-Space Pose Command (Joint Space):
ros2 topic pub --once /pose_command my_robot_interfaces/msg/PoseCommand \
"{x: 0.7, y: 0.0, z: 0.4, roll: 3.14, pitch: 0.0, yaw: 0.0, cartesian_path: false}"
Straight-Line Cartesian Path:
ros2 topic pub --once /pose_command my_robot_interfaces/msg/PoseCommand \
"{x: 0.7, y: 0.0, z: 0.2, roll: 3.14, pitch: 0.0, yaw: 0.0, cartesian_path: true}"
Ctrl+C in each terminal to stop active ROS 2 nodes.exit to close each terminal session.The --rm flag ensures the container is removed on exit — your image remains intact.
GitHub: morshed-asif
Content type
Image
Digest
sha256:812887860…
Size
1.1 GB
Last updated
5 months ago
docker pull morshedasif/robotic_arm_moveit2