A ROS 2 and Gazebo-based simulation pipeline for automated robotic welding using a UR10 manipulator.
This project provides a clean, modular foundation for trajectory generation and execution. It uses MoveIt 2 for inverse kinematics and a custom unidirectional data pipeline to translate sparse waypoints into executable Cartesian weave patterns.
This repository follows a decoupled "Brain" and "Body" paradigm. This separation ensures that mathematical trajectory generation, safety validation, and physical robot execution remain completely isolated.
- The Body (
ur10_moveit_config&ur10_description): Handles the physical simulated environment (Gazebo), the Robot State Publisher, controller managers, and the MoveIt 2 backend. - The Brain (
ur10_planner): A custom three-node pipeline that reads data, generates complex paths, and commands the robot.
The ur10_planner package contains the core logic center, using three specialized, single-responsibility nodes:
-
Path Generator Node (
path_generator_node.cpp)- Role: Pure mathematics and file I/O.
- Function: Reads sparse XYZ coordinates from a YAML file, calculates a perpendicular trajectory vector, and applies a mathematical weave algorithm (amplitude and step length).
- Output: Publishes a dense
geometry_msgs::msg::PoseArrayof the final weld path.
-
Trajectory Supervisor Node (
trajectory_supervisor_node.cpp)- Role: Kinematics and execution control.
- Function: Subscribes to the Cartesian path and interfaces with MoveIt 2's
MoveGroupInterface. It executes movement in two phases:- Phase 1 (Approach): Uses joint-space planning to navigate the arm safely from its home position to the starting coordinate of the weld.
- Phase 2 (Weld): Uses
computeCartesianPathto trace the woven waypoints while maintaining strict end-effector orientation.
-
Safety Validator Node (
safety_validator_node.cpp)- Role: Independent watchdog.
- Function: Subscribes to the planned
RobotTrajectorygenerated by the supervisor. It iterates through every computed joint angle to ensure no hardware limits (e.g., ±2π radians) are violated before physical execution.
To run this simulation, ensure your system meets the following requirements:
- OS: Ubuntu 24.04 (Noble Numbat)
- ROS 2: Jazzy Jalisco
- Simulation: Gazebo Harmonic (
ros-jazzy-ros-gz) - Motion Planning: MoveIt 2 (
ros-jazzy-moveit)
-
Clone this repository into your ROS 2 workspace
srcdirectory:cd ~/your_ws/src git clone <your-repository-url> .
-
Install dependencies using
rosdep:cd ~/your_ws rosdep install --from-paths src --ignore-src -r -y
-
Build the workspace:
colcon build --symlink-install
-
Source your workspace:
source install/setup.bash
Due to the decoupled architecture, launching the project requires two separate terminals.
Note: The pipeline uses use_sim_time: True to ensure MoveIt synchronizes with the Gazebo simulation clock.
This script locates your package paths, exports the correct Gazebo resource variables, and launches the simulated world alongside MoveIt and RViz.
cd ~/your_ws
./launch_sim.shWait until the Gazebo simulation is fully loaded and the UR10 is stationary before proceeding.
This script triggers the modular pipeline. The nodes will generate the path, compute kinematics, validate safety, and execute the movement in Gazebo.
cd ~/your_ws
./launch_pipeline.shTo change the shape or location of the weld, modify the data file located at:
src/ur10_planner/config/weld_path.yaml
You can adjust parameters such as weave_amplitude and weave_step_length, and define the absolute path to your your_ws/data/selected_points.yaml file containing the raw spatial coordinates.
