Skip to content

Model predictive controller with serial port interface. Arduino <-> RPi serial communication. Developed for CMU's 24-774 ACSI course final project.

Notifications You must be signed in to change notification settings

LukeSchmitt96/solveMPC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Need to install osqp-eigen and some of its dependencies. Find information here.

The required dependencies are:

Get cmake:

sudo apt-get install cmake -y

Get Eigen:

sudo apt-get install libeigen3-dev -y

Get osqp:

cd ~
git clone --recursive https://github.com/oxfordcontrol/osqp
cd osqp
mkdir build
cd build
cmake -G "Unix Makefiles" ..
cmake --build .
sudo cmake --build . --target install

Get osqp-eigen:

cd ~
git clone https://github.com/robotology/osqp-eigen.git
cd osqp-eigen
mkdir build && cd build
cmake ../
make
sudo make install

Get solveMPC

Once all dependencies are installed, clone the repo using:

cd ~
git clone https://github.com/LukeSchmitt96/solveMPC.git

Building the solver

To build the project for the first time:

cd solveMPC
cmake .
cmake --build ./

For each subsequent build, run the following command in the project directory:

cmake --build ./

To start solver, run the following command in the project directory:

./solver.cpp

Note that you may need to run it once or twice before it 'takes'.

Note that you can set a verbose output by setting the command flag -v. Verbose output is turned off by default. A verbose output will output information like the QP problem matrices, the messages read from serial, the solution to the QP problem, etc.

./solver.cpp -v

Configuring the solver

To edit settings like position reference and serial port name, check the configuration files.

To check which serial port the Pi connects to Arduino through, run the following command and update the Serial Port config file accordingly.

dmesg | grep tty

About

Model predictive controller with serial port interface. Arduino <-> RPi serial communication. Developed for CMU's 24-774 ACSI course final project.

Topics

Resources

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages