SkillAgentSearch skills...

CppRobotics

cpp implementation of robotics algorithms including localization, mapping, SLAM, path planning and control

Install / Use

/learn @onlytailei/CppRobotics
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

CppRobotics

This is the cpp implementation of the PythonRobotics

Requirment

  • cmake
  • opencv 3.3
  • Eigen 3
  • CppAD / IPOPT (for MPC convex optimization) install tips
  • ~~ROS~~ (~~To make the repo lightweight :)~~. Yet, we may still need it for 3D visualization.)

Build

 $ mkdir build
 $ cd build
 $ cmake ../
 $ make -j 8

Find all the executable files in build/bin.

Table of Contents

Localization

Extended Kalman Filter Localization

  • green line: the groundtruth trajectory
  • black line: dead reckoning
  • red points: observations (e.g. GPS)
  • blue line: estimated positions
<!-- ![ekf_gif](./gif/ekf.gif) --> <img src="https://ram-lab.com/file/tailei/gif/ekf.gif" alt="ekf" width="400"/>

Probabilistic Robotics

Particle Filter Localization

  • green line: the groundtruth trajectory
  • black line: dead reckoning
  • red points: landmarks
  • blue line: estimated positions
<!-- ![pf_gif](./gif/pf.gif) --> <img src="https://ram-lab.com/file/tailei/gif/pf.gif" alt="pf" width="400"/>

Probabilistic Robotics

Path Planning

Dijkstra

  • blue point: the start point
  • red point: the goal point <img src="https://ram-lab.com/file/tailei/gif/dijkstra.gif" alt="dijkstra" width="400"/>

A star

  • blue point: the start point
  • red point: the goal point <img src="https://ram-lab.com/file/tailei/gif/a_star.gif" alt="a_star" width="400"/>

RRT

  • red circle: the start point
  • blue circle: the goal point
  • black circle: obstacles <img src="https://ram-lab.com/file/tailei/gif/rrt.gif" alt="rrt" width="400"/>

Dynamic Window Approach

  • blue circle: the target point
  • red circle: the robot
<!-- ![dwa_gif](./gif/dwa.gif) --> <img src="https://ram-lab.com/file/tailei/gif/dwa.gif" alt="dwa" width="400"/>

The dynamic window approach to collision avoidance

Model Predictive Trajectory Generator

This part is based on the bicycle motion model.

  • blue circle: the target point
  • red circle: the initial point
<!-- ![mptg_gif](./gif/mptg.gif) --> <img src="https://ram-lab.com/file/tailei/gif/mptg.gif" alt="mptg" width="400"/>

Cubic Spline Planner

<!-- ![mptg_gif](./gif/csp.png =500x) --> <img src="https://ram-lab.com/file/tailei/gif/csp.png" alt="csp" width="400"/>

State Lattice Planner

  • blue circle: the target point
  • red circle: the initial point
<!-- ![mptg_gif](./gif/slp.gif) --> <img src="https://ram-lab.com/file/tailei/gif/slp.gif" alt="slp" width="400"/>

State Space Sampling of Feasible Motions for High-Performance Mobile Robot Navigation in Complex Environments

Frenet Frame Trajectory

  • black line: the planned spline path
  • red circle: the obstacle
  • blue circle: the planned trajectory
  • green circle: the real-time position of robot
<img src="https://ram-lab.com/file/tailei/gif/frenet.gif" alt="frenet" width="400"/>

Optimal Trajectory Generation for Dynamic Street Scenarios in a Frenet Frame

Path Tracking Control

LQR Steering Control

  • black line: the planned spline path
  • red circle: the position under lqr control
<img src="https://ram-lab.com/file/tailei/gif/lqr_steering.gif" alt="lqr_steering" width="400"/>

LQR Speed and Steering Control

  • black line: the planned spline path
  • red circle: the position under lqr control
<img src="https://ram-lab.com/file/tailei/gif/lqr_full.gif" alt="lqr_full" width="400"/>

MPC Speed and Steering Control

  • black line: the planned spline path
  • blue line: the passed path
  • yellow cross: the reference trajectory for MPC
    (To compile this part, you need to uncomment the related lines in CMakeLists.txt and install CppAD and IPOPT.)
<img src="https://ram-lab.com/file/tailei/gif/mpc.gif" alt="mpc" width="400"/>
View on GitHub
GitHub Stars2.2k
CategoryDevelopment
Updated1d ago
Forks527

Languages

C++

Security Score

100/100

Audited on Mar 26, 2026

No findings