LearnRoboticsCpp
This repository contains my implementations of classical robotics algorithms in C++. Inspiration drawn from PythonRobotics and CppRobotics. The CppRobotics repo was very good, but it used OpenCV to plot 2D graphs. I found the process of converting 2D points to pixel coordinates in OpenCV very tedious and it seems like a bit of a hack. This repo uses gnuplot-iostream instead for plotting which makes much prettier graphs than OpenCV and allows for us to easily make 3D plots.
Table of Contents
Requirments
Tested on Ubuntu 18.04
- cmake
- opencv 3.3 (for KD tree in PRM)
- Eigen 3
- Boost 1.4 (for gnuplot-iostream)
- gnuplot
- ipoptd (this one is a pickle, install tips borrowed from Udacity )
- cppad
Dependencies Installation
- apt installs
sudo apt update
sudo apt install build-essential
sudo apt install cmake
sudo apt install gnuplot
sudo apt install libboost-all-dev
sudo apt install libopencv-dev python3-opencv
sudo apt install libeigen3-dev
sudo apt install cppad
- ipoptd install
sudo apt install gfortran
sudo apt install unzip
You probably want to cd into another directory like Downloads for this folder
wget https://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.7.zip && unzip Ipopt-3.12.7.zip && rm Ipopt-3.12.7.zip
Call install_ipopt.sh in this repo with sudo and the source directory as the first argument (e.g. sudo bash install_ipopt.sh ~/Ipopt-3.12.7)
Xming(for Windows Subsystem Linux users only) Need to install xming for gnuplot visualization: https://sourceforge.net/projects/xming/. Set display tognuplotwith:$ export DISPLAY=:0 gnuplot.
Build
$ git clone https://github.com/CtfChan/LearnRoboticsCpp.git
$ mkdir build
$ cd build
$ cmake ../
$ make -j4Path Planning
DWA
Dijkstra
A*
PRM
RRT
RRTStar
Potential Field
Quintic Polynomial
Cubic Spline
Model Predictive Trajectory Generation
State Lattice Planner
Left to right: uniform, biased, lane samplingPath Tracking
Move To Pose
Stanley Control
Model Predictive Control
Localization
Extended Kalman Filter
Unscented Kalman Filter
We can see error ellipse in this demo is a much better approximation of the true distribution. EKF can be biased and inconsistent.


















