๐ Related Blog Post: For behind-the-scenes details and the full development journey, check out the companion Medium article: ๐ ๐ How Iโm Building an Autonomous Pick-and-Place System with ROS 2 Jazzy and Gazebo Harmonic
The blog dives into simulation setup, robotic control, MoveIt Task Constructor, and lessons learnedโperfect if you're curious about the engineering side or want to replicate the project from scratch.
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.
Make sure you have ROS 2 Jazzy and Gazebo Harmonic installed.
git clone https://github.com/darshmenon/UR3_ROS2_PICK_AND_PLACE.git
cd UR3_ROS2_PICK_AND_PLACE
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
cd ~/your_ros2_ws # Replace with your workspace path
colcon build --symlink-install
source install/setup.bash
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!
ros2 launch ur_gazebo ur.gazebo.launch.py
ros2 launch ur_description view_ur.launch.py ur_type:=ur3
ros2 launch robotiq_2finger_grippers robotiq_2f_85_gripper_visualization/launch/test_2f_85_model.launch.py
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 a full pick-return-release loop:
python3 ~/UR3_ROS2_PICK_AND_PLACE/ur_system_tests/scripts/arm_gripper_loop_controller.py
To run the full MTC demo with the UR3 and Robotiq gripper, execute the following steps:
chmod +x ~/UR3_ROS2_PICK_AND_PLACE/ur_mtc_pick_place_demo/scripts/robot.sh
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.
Feel free to open pull requests or issues if you have improvements or bug reports.