Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dockers/manipulation_docker/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# List of packages to copy from humble_ws/src
PACKAGES=manipulation_demo topic_based_ros2_control panda_moveit_config panda_description
54 changes: 54 additions & 0 deletions dockers/manipulation_docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM moveit/moveit2:humble-release

ENV DEBIAN_FRONTEND=noninteractive

# Build argument for packages to copy (set via docker-compose)
ARG PACKAGES

WORKDIR /root/humble_ws

# Install apt dependencies and clone repos in one layer (rarely changes)
COPY dockers/manipulation_docker/apt-requirements.txt dockers/manipulation_docker/dependency.repos /tmp/
RUN apt-get update && \
xargs apt-get install -y < /tmp/apt-requirements.txt && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p src && \
vcs import src < /tmp/dependency.repos

# Copy only specific packages from humble_ws using a script
COPY humble_ws/src /tmp/humble_ws_src
RUN for pkg in $PACKAGES; do \
if [ -d "/tmp/humble_ws_src/$pkg" ]; then \
cp -r "/tmp/humble_ws_src/$pkg" /root/humble_ws/src/; \
else \
echo "Warning: Package $pkg not found in humble_ws/src"; \
fi \
done && \
rm -rf /tmp/humble_ws_src
Comment on lines +19 to +27
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The COPY humble_ws/src /tmp/humble_ws_src instruction copies the entire source directory. This can be inefficient for Docker's layer caching, as any change in humble_ws/src will invalidate this layer and trigger a rebuild of subsequent layers, even if the changed files are not part of the packages being used. For better build performance, consider copying only the necessary package directories explicitly.


# Install ROS dependencies
COPY dockers/manipulation_docker/ros-requirements.txt /tmp/ros-requirements.txt
RUN apt-get update && \
rosdep update && \
rosdep install -y --from-paths src --ignore-src --rosdistro humble && \
xargs apt-get install -y < /tmp/ros-requirements.txt && \
rm -rf /var/lib/apt/lists/*

# Build workspace
RUN rm -rf build install log && \
. /opt/ros/humble/setup.sh && \
colcon build --symlink-install

# Source workspace in bashrc
RUN echo 'source /opt/ros/humble/setup.bash' >> /root/.bashrc && \
echo 'source /root/humble_ws/install/setup.bash' >> /root/.bashrc

# Copy FastDDS config
COPY dockers/manipulation_docker/fastdds.xml /root/.ros/fastdds.xml

# Copy and setup entrypoint
COPY dockers/manipulation_docker/entrypoint.sh /root/entrypoint.sh
RUN chmod +x /root/entrypoint.sh

# Set entrypoint
ENTRYPOINT ["/root/entrypoint.sh"]
38 changes: 38 additions & 0 deletions dockers/manipulation_docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# MoveIt2 Manipulation Scenario (Panda Robot)

Docker container for running MoveIt2 manipulation stack with Franka Emika Panda robot connected to Isaac Sim.

```bash
cd dockers/manipulation_docker
./run_manipulation_example.sh --build
```

Container starts the launch file:
- `isaac_moveit.launch.py` — MoveIt2 stack with robot controllers

---

## Running Pick and Place Demo

Inside the running container:

```bash
ros2 run moveit_apps pick_and_place
```

This executes a complete pick-and-place sequence:
1. Move to pre-grasp position above the cube
2. Open gripper
3. Lower to grasp position (Cartesian path)
4. Close gripper
5. Lift to pre-grasp height (Cartesian path)
6. Lift to safe travel height
7. Move to drop position above basket
8. Open gripper to release cube
9. Return to home position

---

For detailed documentation, see:

[MoveIt2 Manipulation Tutorial](https://github.com/auraml/docs/blob/main/docs/tutorials/ros/moveit2_manipulation.md)
1 change: 1 addition & 0 deletions dockers/manipulation_docker/apt-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3-vcstool
2 changes: 2 additions & 0 deletions dockers/manipulation_docker/dependency.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
repositories:
# No external dependencies for now - Panda is self-contained
22 changes: 22 additions & 0 deletions dockers/manipulation_docker/docker-compose-manipulation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
services:
manipulation_scenario:
build:
context: ../..
dockerfile: dockers/manipulation_docker/Dockerfile
args:
PACKAGES: ${PACKAGES}
container_name: manipulation_scenario
network_mode: host
working_dir: /root/humble_ws
environment:
- DISPLAY=${DISPLAY}
- QT_X11_NO_MITSHM=1
- QT_QPA_PLATFORM=xcb
- XAUTHORITY=/tmp/.docker.xauth
- ROS_DISABLE_SHARED_MEMORY=1
- FASTRTPS_DEFAULT_PROFILES_FILE=/root/.ros/fastdds.xml
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- /tmp/.docker.xauth:/tmp/.docker.xauth
devices:
- /dev/dri:/dev/dri
21 changes: 21 additions & 0 deletions dockers/manipulation_docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -e

# Source ROS2 and workspace
source /opt/ros/humble/setup.bash
source /root/humble_ws/install/setup.bash

# Set FastDDS config
export FASTRTPS_DEFAULT_PROFILES_FILE=/root/.ros/fastdds.xml

echo "================================================"
echo "Manipulation Scenario Container Started"
echo "================================================"
echo "Starting Isaac Sim + MoveIt2 integration..."
echo "================================================"

# Start Isaac MoveIt integration
ros2 launch isaac_moveit isaac_moveit.launch.py ros2_control_hardware_type:=isaac
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To make ros2 launch the main process of the container and ensure proper signal handling (like Ctrl+C), it's good practice to use exec. This replaces the current shell process with the ros2 launch process.

Suggested change
ros2 launch isaac_moveit isaac_moveit.launch.py ros2_control_hardware_type:=isaac
exec ros2 launch isaac_moveit isaac_moveit.launch.py ros2_control_hardware_type:=isaac


# Keep container running
wait
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This wait command is ineffective as there are no background jobs to wait for. The script will block on the ros2 launch command running in the foreground. This line can be safely removed.

18 changes: 18 additions & 0 deletions dockers/manipulation_docker/fastdds.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<transport_descriptors>
<transport_descriptor>
<transport_id>udp_transport</transport_id>
<type>UDPv4</type>
</transport_descriptor>
</transport_descriptors>

<participant profile_name="udp_only" is_default_profile="true">
<rtps>
<userTransports>
<transport_id>udp_transport</transport_id>
</userTransports>
<useBuiltinTransports>false</useBuiltinTransports>
</rtps>
</participant>
</profiles>
14 changes: 14 additions & 0 deletions dockers/manipulation_docker/ros-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ros-humble-moveit
ros-humble-moveit-ros-move-group
ros-humble-moveit-ros-planning-interface
ros-humble-moveit-ros-perception
ros-humble-moveit-configs-utils
ros-humble-rviz2
ros-humble-rviz-common
ros-humble-rviz-default-plugins
ros-humble-ros2-control
ros-humble-ros2-controllers
ros-humble-controller-manager
ros-humble-joint-state-publisher
ros-humble-robot-state-publisher
ros-humble-rclcpp-action
34 changes: 34 additions & 0 deletions dockers/manipulation_docker/run_manipulation_example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

declare SCRIPT_NAME=$(readlink -f ${BASH_SOURCE[0]})
cd $(dirname $SCRIPT_NAME)

BUILD_ARGS=""
NO_CACHE=""

while (( "$#" )); do
case "$1" in
-b|--build)
BUILD_ARGS="--build"
shift
;;
-n|--no-cache)
BUILD_ARGS="--build"
NO_CACHE="--no-cache"
shift
;;
*)
echo "Unknown argument $1"
echo "Usage: $0 [--build|-b] [--no-cache|-n]"
exit 1
;;
esac
done

# Combine flags
BUILD="$BUILD_ARGS $NO_CACHE"

# Allow X11 forwarding for GUI applications
xhost +local:docker

docker compose -f docker-compose-manipulation.yml run ${BUILD} --rm manipulation_scenario
17 changes: 17 additions & 0 deletions humble_ws/src/manipulation_demo/isaac_moveit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.5)
project(isaac_moveit)

find_package(ament_cmake REQUIRED)
find_package(rclpy REQUIRED)
find_package(moveit REQUIRED)

install(DIRECTORY
rviz2
launch
DESTINATION share/${PROJECT_NAME})

# Install Python executables
install(PROGRAMS
DESTINATION lib/${PROJECT_NAME}
)
Comment on lines +13 to +16
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The install(PROGRAMS ...) directive is empty. This can cause build warnings and is unnecessary code. Since this package does not appear to have any Python executables to install, this entire block should be removed.

ament_package()
Loading