-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/manipulation scenario #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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 | ||
|
|
||
| # 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"] | ||
| 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) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| python3-vcstool |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| repositories: | ||
| # No external dependencies for now - Panda is self-contained |
| 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 |
| 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 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To make
Suggested change
|
||||||
|
|
||||||
| # Keep container running | ||||||
| wait | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| 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> |
| 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 |
| 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 |
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ament_package() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
COPY humble_ws/src /tmp/humble_ws_srcinstruction copies the entire source directory. This can be inefficient for Docker's layer caching, as any change inhumble_ws/srcwill 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.