Sign inSign up

morshedasif/robotic_arm_moveit2

By morshedasif

•Updated 5 months ago

Dockerized ROS 2 Humble + MoveIt 2 simulator for a 6-axis robotic arm with C++ commander node.

Image
0

50K+

morshedasif/robotic_arm_moveit2 repository overview

⁠🦾 6-Axis Manipulator — MoveIt 2 Simulator (Dockerized)

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.


⁠Tech Stack

ComponentDetails
Base OSUbuntu 22.04 LTS
MiddlewareROS 2 Humble Desktop Full
DDS LayerCycloneDDS (rmw_cyclonedds_cpp)
Motion PlanningMoveIt 2 (OMPL Pipelines)
Hardware InterfaceROS 2 Control — Mock Hardware Encoders
Commander NodeNative C++ MoveGroup Interface

⁠Prerequisites

  • Docker
  • Docker Compose
  • An X server for GUI rendering (RViz 2)
    • Linux: X11 is available natively
    • Windows: Install VcXsrv⁠ and run it with Disable access control checked

⁠Step 1 — Create the Compose File

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.


⁠Step 2 — Grant Display Access & Start the Container

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.


⁠Step 3 — Multi-Terminal Setup

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.


⁠Terminal 1 — Launch the Core Stack

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.


⁠Terminal 2 — Start the Commander Node

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.


⁠Terminal 3 — Send Commands

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}"

⁠Shutdown

  1. Press Ctrl+C in each terminal to stop active ROS 2 nodes.
  2. Type exit to close each terminal session.

The --rm flag ensures the container is removed on exit — your image remains intact.


⁠Source

GitHub: morshed-asif⁠

Tag summary

Content type

Image

Digest

sha256:812887860…

Size

1.1 GB

Last updated

5 months ago

docker pull morshedasif/robotic_arm_moveit2