Digital Twin & CPS Development for UR5e Robotic Arm | ROS2 + Unity 3D GitHub Link YouTube Link
Developed a real-time digital twin framework for the UR5e 6-axis robotic arm using ROS2 Humble, Gazebo, RViz, MoveIt2, and Unity 3D. The Unity scene mirrors live joint states from Gazebo via ROS-TCP-Connector, with a custom UI overlay for live joint angles and machine status. Key achievements include bidirectional control from Unity UI sliders to Gazebo, MoveIt2-based collision-aware motion planning with Unity draggable target control, a synchronized multi-machine virtual lab with UR5e arm and conveyor belt, ML-based anomaly detection with live Unity alerts, latency measurement and analysis, and rosbag2 motion recording with verified replay. Advanced motion planning by MoveIt2 and Reinforcement learning-based control using Unity ML-Agents is currently under development.
Tech Stack: ROS2 Humble, Ubuntu 22.04, Unity 2022, MoveIt2, Python, C#, URDF, Gazebo, RViz, ROS-TCP-Connector, scikit-learn, Unity ML Agents
System Architecture: Base
System Architecture: Extended
UR5e 6-axis arm in RViz with live joint states .
UR5e spawned in Gazebo physics simulation
UR5e 3D model in Unity scene and ROS-TCP Bridge Connection
Digital Twin Demo: ROS2 → Unity real-time sync
Unity Inspector — Full System Components
Multi-Machine Gazebo Simulation — UR5e Arm and Conveyor Belt
Complete Digital Twin — Gazebo + Unity Real-time Sync
Unity→ROS2 Bidirectional Control — Joint Commands via Terminal
Bidirectional Control — Unity Sliders Controlling Gazebo Robot Arm
Conveyor Belt Speed Control from Unity UI
Multi-Machine Virtual Lab — Robot Arm + Conveyor Belt
ML-Based Anomaly Detection — Normal vs Abnormal Joint Motion
Anomaly Detector — Joint Deviation Warning in ROS2 Terminal
ML Anomaly Detection — Live Red Alert in Unity UI
ROS2–Unity Latency Analysis — Message Interval Distribution (Avg: 104.3ms)
Unity Console — Live Latency Measurement
ROS2–Unity TCP Bridge — All Topics Successfully Registered