Giter Site home page Giter Site logo

lukeschmitt96 / solvempc Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 2.42 MB

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

CMake 0.02% C++ 99.18% C 0.80%
mpc-control serial-communication osqp-eigen

solvempc's Introduction

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

solvempc's People

Contributors

aasavinov avatar davidzhangqindong avatar eric-h2 avatar lukeschmitt96 avatar

Watchers

 avatar

Forkers

iemmessien

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.