Skip to content
AlecbossardPublic

About

UR3 kinematics and trajectory generation with forward/inverse models and Jacobian-based control.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

UR3 Kinematics & Trajectory Generation

Python robotics project focused on kinematic modeling, differential kinematics and trajectory generation for a 6-DOF UR3 manipulator.

The project implements the full pipeline from Cartesian motion specification to joint-space trajectory generation, including forward/inverse kinematics, Jacobian-based differential models and numerical validation of the reconstructed end-effector motion.

Highlights

  • Forward kinematics for the UR3 manipulator
  • Inverse kinematics
  • Jacobian and differential kinematic models
  • Parametric circular end-effector trajectory
  • Acceleration / constant-speed / deceleration motion law
  • Cartesian-to-joint trajectory conversion
  • Joint position, velocity and acceleration generation
  • Numerical validation of position and velocity tracking
  • Dedicated test scripts for the kinematic models
  • Additional PyBullet simulation utilities

Project Objective

The objective is to generate a complete motion for a UR3 robot from a simple Cartesian trajectory specification.

The user can define:

  • the center of the circular trajectory O,
  • its radius R,
  • the target tool velocity V.

The software then generates the corresponding Cartesian motion and converts it into joint-space trajectories for the six UR3 joints.

The main pipeline can be summarized as:

Trajectory parameters
      O, R, V
         │
         ▼
   Motion law s(t)
         │
         ▼
Cartesian trajectory
 X(t), Ẋ(t), Ẍ(t)
         │
         ▼
 Inverse kinematics
         │
         ▼
  Joint trajectories
 q(t), q̇(t), q̈(t)
         │
         ▼
 Forward-kinematics
     validation

Kinematic Modeling

Forward Kinematics

The forward geometric model computes the end-effector pose from the six joint variables.

The implementation is based on homogeneous transformation matrices and the UR3 geometric parameters.

This model is also used later to reconstruct the Cartesian trajectory from the generated joint configuration.

Inverse Kinematics

The inverse geometric model computes joint configurations corresponding to a desired end-effector pose.

The project includes a dedicated test script to validate the inverse-kinematics implementation against the forward model.

Jacobian & Differential Models

The Jacobian is used to relate joint velocities to end-effector velocities:

Ẋ = J(q) q̇

The project also contains direct and inverse differential models used for trajectory analysis and joint-space generation.


Motion Law

The trajectory uses a motion profile composed of:

  1. acceleration,
  2. constant velocity,
  3. deceleration.

The generated scalar motion law provides:

  • s(t) — curvilinear position,
  • ṡ(t) — velocity,
  • s̈(t) — acceleration.

Switching times such as t1, t2 and tf are computed and displayed in the generated plots.


Cartesian Trajectory

The end-effector follows a parameterized circular trajectory in the X-Z plane.

The trajectory is defined by:

O = [Ox, Oy, Oz]   # circle center
R                  # radius
V                  # target velocity

The Y coordinate remains constant.

The software generates:

  • position X(t),
  • velocity Ẋ(t),
  • acceleration Ẍ(t).

It also displays the 3D operational-space trajectory and the scalar tool velocity.


Joint-Space Trajectory Generation

The Cartesian trajectory is converted into trajectories for all six UR3 joints.

Generated quantities include:

  • joint positions q(t),
  • joint velocities q̇(t),
  • joint accelerations q̈(t).

This makes it possible to analyse how the Cartesian task translates into robot joint motion.


Validation

The generated joint trajectory is validated by reconstructing the robot motion.

Position Validation

The joint positions are passed back through the forward-kinematics model:

q(t)
  │
  ▼
Forward Kinematics
  │
  ▼
X_robot(t)

The position error is then computed as:

e_X(t) = X_reference(t) - X_robot(t)

Velocity Validation

The end-effector velocity is reconstructed using the Jacobian:

Ẋ_robot(t) = J(q) q̇(t)

and compared with the Cartesian velocity reference:

e_Ẋ(t) = Ẋ_reference(t) - Ẋ_robot(t)

The expected residual errors are primarily numerical.


Generated Outputs

Running the complete trajectory pipeline produces several visualizations.

Motion Law

  • s(t)
  • ṡ(t)
  • s̈(t)
  • switching times t1, t2, tf

Cartesian Motion

  • x(t), ẋ(t), ẍ(t)
  • z(t), ż(t), z̈(t)
  • 3D circular trajectory
  • end-effector velocity magnitude

Joint Motion

For each of the six joints:

  • q(t)
  • q̇(t)
  • q̈(t)

Validation

  • Cartesian position error
  • Cartesian velocity error

PyBullet Simulation

The repository also contains additional PyBullet simulation utilities under:

src/pybullet/

These files provide an additional environment for robot visualization and control experiments.

Main files include:

src/pybullet/
├── affiche.py
├── control.py
├── intro-pybullet.ipynb
└── simulation_pybullet.py

PyBullet is not included in the main requirements.txt. Install it separately if you want to use these optional simulation utilities.

pip install pybullet

Tech Stack

  • Python
  • NumPy
  • Matplotlib
  • SymPy
  • Robot kinematics
  • Jacobian-based differential modeling
  • Trajectory generation
  • PyBullet (optional simulation)

Project Structure

UR3/
├── main.py
├── main_traj.py
├── requirements.txt
├── rapport-Equipe3.pdf
├── src/
│   ├── const_v.py
│   ├── matrice_tn.py
│   ├── modele_differentiel.py
│   ├── part1_loi_mouvement.py
│   ├── part2_trajectoire_operationnelle.py
│   ├── part3_analyse_tache.py
│   ├── part4_generation_articulaire.py
│   ├── utils.py
│   └── pybullet/
│       ├── affiche.py
│       ├── control.py
│       ├── intro-pybullet.ipynb
│       └── simulation_pybullet.py
├── test_mgd.py
├── test_mgi.py
├── test_mdd_mdi.py
├── test_jacobienne.py
└── README.md

Main Files

  • main_traj.py — complete trajectory-generation and validation pipeline
  • main.py — forward/inverse kinematics demonstration
  • matrice_tn.py — homogeneous transformations and forward kinematics
  • modele_differentiel.py — Jacobian and differential models
  • part1_loi_mouvement.py — motion law generation
  • part2_trajectoire_operationnelle.py — Cartesian trajectory
  • part3_analyse_tache.py — tool-velocity and tracking-error analysis
  • part4_generation_articulaire.py — Cartesian-to-joint trajectory generation

Getting Started

Prerequisites

  • Python 3.x
  • pip

Clone the Repository

git clone https://github.com/Alecbossard/UR3.git
cd UR3

Create a Virtual Environment

python -m venv .venv

Activate it:

# Linux / macOS
source .venv/bin/activate

# Windows PowerShell
.venv\Scripts\Activate.ps1

Install Dependencies

pip install -r requirements.txt

Run the Complete Trajectory Pipeline

python main_traj.py

The script generates the trajectory and opens the associated Matplotlib figures.


Configure the Trajectory

The trajectory parameters can be modified in main_traj.py.

O = [Ox, Oy, Oz]
R = ...
V = ...

Where:

  • O is the circle center in meters,
  • R is the circle radius in meters,
  • V is the target end-effector velocity in m/s.

Run the Validation Scripts

The repository contains separate scripts for validating the main mathematical components.

Forward Kinematics

python test_mgd.py

Inverse Kinematics

python test_mgi.py

Differential Models

python test_mdd_mdi.py

Jacobian

python test_jacobienne.py

Project Report

The complete academic report is available in the repository:

📄 View the project report


Context

This project was developed as an academic robotics project at UPSSITECH – University of Toulouse.

It focuses on the mathematical foundations required for robotic manipulation, including:

Forward Kinematics · Inverse Kinematics · Jacobians · Differential Kinematics · Trajectory Generation · Robot Simulation


Author

Alec Bossard
Engineering student in Robotics and Interactive Systems at UPSSITECH – University of Toulouse.

LinkedIn

About

UR3 kinematics and trajectory generation with forward/inverse models and Jacobian-based control.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages