This repository contains an implementation of kinematic computations and trajectory planning for the YouBot robot. The project is designed to solve forward and inverse kinematics, calculate Jacobians, detect singularities, and plan trajectories through checkpoints using predefined joint positions.
The key features of this project include:
- Forward and inverse kinematics computation for the Youbot arm.
- Shortest path calculation between multiple target positions using Cartesian coordinates.
- Smooth trajectory generation with intermediate transformations using cubic interpolation.
- Integration with ROS 2 for trajectory execution and visualization.
- Visualization of checkpoints using RViz markers.
- Kinematic Models: Uses a custom KUKA Youbot kinematics model to calculate joint positions.
- Shortest Path Optimization: Employs permutations to determine the most efficient checkpoint sequence.
- Trajectory Interpolation: Generates intermediate waypoints with decoupled rotation and translation transformations.
- Inverse Kinematics Solver: Computes joint positions iteratively for a smooth trajectory.
- ROS 2 Integration: Publishes trajectory messages for execution and visualization.
- Loading Targets: The program retrieves predefined target positions in both joint and Cartesian space.
- Shortest Path Calculation: It determines the most efficient sequence of checkpoints based on Cartesian distances.
- Intermediate Transformations: For smooth transitions, the algorithm interpolates between checkpoints using matrix exponential and logarithmic operations.
- Joint Angle Computation: The trajectory is converted to joint positions using an iterative inverse kinematics solver.
- Trajectory Execution: The planned trajectory is published to the ROS 2 trajectory controller for execution.
- ROS 2 (Humble): Ensure a functional ROS 2 setup.
- Python 3.8+
- Required Packages: Install necessary Python libraries.
pip install numpy scipy rclpy trajectory_msgs visualization_msgs
- Kinematics Model: Include the
YoubotKinematicStudentandTARGET_JOINT_POSITIONSfiles.
- The planned trajectory and checkpoints can be visualized in RViz using markers. Checkpoints are displayed as colored spheres, with colors representing the order of traversal (blue to green).

- This project was developed as part of the assessment for the COMP0246 - Modelling and Motion Planning module at University College London.
- It was a collaborative effort by myself, @ziyaruso, and @lorenzouttini.
- Special thanks to the teaching team for providing guidance and resources throughout the project.
