Skip to content

About

UR7e robot learning and state estimation: simulated trajectory tracking, target reaching, obstacle avoidance, and a partial real-robot implementation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

UR7e Reinforcement Learning Suite

ROS2 Python RL License

Reinforcement learning for a Universal Robots UR7e cobot: line following (simulation and a partial hardware implementation), target reaching, and obstacle avoidance — with kinematic tools, sensor fusion (EKF), and a SAC-vs-PPO experiment.

UR7e Line Follower — watch the video on YouTube
▶️ Watch the full video on YouTube

And

UR7e Line Follower — watch the simulation on YouTube
▶️ Watch the full simulation on YouTube

Reusable policy and reproducible evaluation

The frozen simple-environment SAC checkpoint is now available as a Hugging Face model, with a portable NumPy actor, source provenance, environment files and measured CPU evaluation. Run actual browser-local inference or inspect the Kaggle benchmark notebook and evaluation dataset.

The 2026-11-18 experiment comprises 100 prespecified trajectories × 2 controllers × 3 noise conditions. With no added noise, strict endpoint completion is 93/100 for SAC and 90/100 for fixed DLS, while mean tracking RMS across acquired episodes is 5.21 mm and 2.38 mm respectively. The original episode-completed flag can be misleading; the evaluation audits endpoint tolerance separately. These results describe a kinematic benchmark, not hardware validation or a general superiority claim. Historical metrics elsewhere in this repository use different protocols.

Source, controller comparison, tests and reproduction instructions: evaluations/frozen-sac-2026-11-18.

Quick overview

This suite contains four independent projects. Simulations are functional, but the full transfer onto the real robot is not validated end-to-end: the vision/KLT chain loses the laser dot during motion, which currently blocks closed-loop control on hardware — see the real-implementation README for details.

# Folder Role Status
1 line-follower-simulation-simple Lightweight SAC trajectory-tracking demo (100% acquisition, 97% completion, 5.8mm RMS) Validated in simulation
2 line-follower-simulation-complete Full ROS 2/Gazebo pipeline: SAC+HER, Extended Kalman Filter, LQR singularity-adaptive control, Monte Carlo trajectories Validated in simulation (7/10 success on held-out episodes)
3 line-follower-real-implementation Real UR7e deployment: fixed camera + TCP-mounted laser, ROS 2 Jazzy Partial — sim-to-real not validated
4 target-reaching-obstacle-avoidance Reaching, SAC vs. PPO statistical comparison, HER, curriculum learning, obstacle avoidance, hybrid IK+RL — two independent frameworks (Stable-Baselines3 and tf-agents) Code complete; some analysis scripts require retraining (no included checkpoints)

Recommended reading order

  1. Start with line-follower-simulation-simple to see the lightest working SAC model end-to-end.
  2. Move to line-follower-simulation-complete for the full sensor-fusion pipeline (EKF, LQR, Monte Carlo) and the regenerated result plots.
  3. Read line-follower-real-implementation before connecting to real hardware, and always run its shadow test first.
  4. Explore target-reaching-obstacle-avoidance for the broader RL methodology: algorithm comparison, sparse-reward techniques, curriculum learning, and a hybrid classical/RL pipeline.

Time investment (130h)

pie showData
    title Project time breakdown — 130h total
    "Reinforcement Learning (SAC, HER, reward design)" : 35
    "Python Engineering (envs, wrappers, pipelines)" : 20
    "ROS2 / Gazebo Integration" : 20
    "Computer Vision (KLT, HSV, calibration)" : 15
    "Robust / Optimal Control (LQR)" : 13
    "State Estimation (EKF / Kalman)" : 12
    "Robotics Modeling & Kinematics (DH, IK/FK)" : 10
    "Real Robot Deployment & Debugging" : 5
Loading

Important notes

Sim-to-real gap

Line following works in simulation but is not yet robust on the real robot. The red laser dot is correctly detected at rest, but KLT tracking is lost during motion. Leading hypotheses: ambient light too strong, laser dot too thin / weakly saturated, red reflections or parasitic objects in frame, unstable camera auto-exposure.

Missing external dependency

The Target Reaching / Obstacle Avoidance batch requires an external ur7e_pybullet/ folder (robot URDF + meshes) that is not included here — see target-reaching-obstacle-avoidance/MISSING_PREREQUISITE.md for the recovery procedure.

Environments

  • ROS 2 Humble or Jazzy depending on the batch.
  • Python 3.10/3.12 depending on the ROS installation.
  • Stable-Baselines3, Gymnasium, PyTorch, NumPy, IKPy for RL simulations; tf-agents/TensorFlow for the alternative approach in batch 4.
  • OpenCV for the real vision pipeline.

Each subfolder keeps its own README and commands — this root README is orientation only.

Interactive notebooks on Kaggle

Reusable training data on Kaggle

  • UR7e Simulated Robot Line-Following Training Log — the original MIT-licensed Monitor log (520 training episodes), with field definitions and a runnable analysis. This single simulated training run is not a held-out or physical-robot evaluation.

Related projects

License

MIT — see LICENSE.

Interactive data explorer and Hugging Face distribution

The Engineering Workbench / Run explorer plots the original Monitor log with selectable fields, trailing windows, per-episode inspection and unchanged CSV/provenance downloads. The Hugging Face dataset preserves the raw file and provides a typed, viewer-friendly derivative with an episode index. It distributes the same 520-episode single simulation run already on Kaggle; it is not another experiment or a held-out evaluation. Original file SHA-256: ac08bd9bae19f6883adfe51203ce7a759d8cea39fd3fcbf0ec6f3ad290b99814. The upstream MIT notice is retained.

Full research report

Reinforcement Learning for UR7e Trajectory Following and UR5e Manipulation (PDF).

The complete manuscript is hosted on the portfolio. Author order and distribution terms are stated in the PDF. The code licence applies to the software; it does not relicense the manuscript.

About

UR7e robot learning and state estimation: simulated trajectory tracking, target reaching, obstacle avoidance, and a partial real-robot implementation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages