Skip to content

darshmenon/UR3_ROS2_PICK_AND_PLACE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

72 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

UR Robotic Arm with Robotiq 2-Finger Gripper for ROS 2

This project integrates the Robotiq 2-Finger Gripper with a Universal Robots UR3 arm using ROS 2 Jazzy and Gazebo Harmonic. It includes URDF models, ROS 2 control configuration, simulation launch files, and control scripts.

βœ… Note: This setup uses fixed mimic joint configuration for the Robotiq gripper to support simulation in newer Gazebo (Harmonic). Only the primary finger_joint receives commandsβ€”mimic joints automatically follow.


Demo

alt text

alt text

πŸ“¦ Installation

Make sure you have ROS 2 Jazzy and Gazebo Harmonic installed.

1. Clone the Repository

git clone https://github.com/darshmenon/UR3_ROS2_PICK_AND_PLACE.git
cd UR3_ROS2_PICK_AND_PLACE

2. Install Dependencies

sudo apt install ros-jazzy-rviz2 \
                 ros-jazzy-joint-state-publisher \
                 ros-jazzy-robot-state-publisher \
                 ros-jazzy-ros2-control \
                 ros-jazzy-ros2-controllers \
                 ros-jazzy-controller-manager \
                 ros-jazzy-joint-trajectory-controller \
                 ros-jazzy-position-controllers \
                 ros-jazzy-gz-ros2-control \
                 ros-jazzy-ros2controlcli \
                 ros-jazzy-gz-sim

3. Build the Workspace

cd ~/your_ros2_ws  # Replace with your workspace path
colcon build --symlink-install
source install/setup.bash

🧩 MoveIt Task Constructor Setup

To enable advanced pick-and-place planning with MoveIt 2, this project supports MoveIt Task Constructor (MTC).
Instead of duplicating the full setup process, we've included a detailed guide in a separate submodule:

πŸ“„ Follow the MTC installation and patching guide here:
ur_mtc_pick_place_demo/README.md

This includes:

  • Cloning the correct MTC branch and commit
  • Installing dependencies
  • Fixes for planning scene execution issues
  • Rebuild instructions

Once complete, you'll be ready to run scripted and interactive pick-and-place pipelines using MTC!


πŸš€ Launch Instructions

Launch Full Simulation in Gazebo

ros2 launch ur_gazebo ur.gazebo.launch.py

Launch RViz Visualization (UR3 + Gripper)

ros2 launch ur_description view_ur.launch.py ur_type:=ur3

Launch Gripper Visualization Alone

ros2 launch robotiq_2finger_grippers robotiq_2f_85_gripper_visualization/launch/test_2f_85_model.launch.py

πŸ€– Move the Arm from CLI

Send a simple trajectory:

ros2 action send_goal /arm_controller/follow_joint_trajectory control_msgs/action/FollowJointTrajectory \
'{
  "trajectory": {
    "joint_names": [
      "shoulder_pan_joint",
      "shoulder_lift_joint",
      "elbow_joint",
      "wrist_1_joint",
      "wrist_2_joint",
      "wrist_3_joint"
    ],
    "points": [
      {
        "positions": [0.0, -1.57, 1.57, 0.0, 1.57, 0.0],
        "time_from_start": { "sec": 2, "nanosec": 0 }
      }
    ]
  }
}'

πŸ” Run Arm-Gripper Automation Script

Run a full pick-return-release loop:

python3 ~/UR3_ROS2_PICK_AND_PLACE/ur_system_tests/scripts/arm_gripper_loop_controller.py

πŸ“ MTC Demo Script

To run the full MTC demo with the UR3 and Robotiq gripper, execute the following steps:

1. Make the Bash Script Executable

chmod +x ~/UR3_ROS2_PICK_AND_PLACE/ur_mtc_pick_place_demo/scripts/robot.sh

2. Run the Script

Execute the script to launch the complete simulation:

~/UR3_ROS2_PICK_AND_PLACE/ur_mtc_pick_place_demo/scripts/robot.sh

This script will:

  • Launch the Gazebo simulation with the UR3 robot and gripper.
  • Launch MoveIt 2 with the necessary configurations for pick-and-place tasks.
  • Adjust the camera position in the simulation.
  • Start the Pick-and-Place demo with MTC.

πŸ“Έ Screenshots

UR3 with Robotiq Gripper in RViz

Arm with Gripper

Robotiq Gripper Close-up

Gripper

Simulation in Gazebo

Gazebo View

RViz Overview

RViz 1

mtc Overview

MC

mtc Overview

pick error

mtc Pipline

alt text

loop

alt text

🀝 Contributing

Feel free to open pull requests or issues if you have improvements or bug reports.