Need to install osqp-eigen and some of its dependencies. Find information here.
The required dependencies are:
sudo apt-get install cmake -y
sudo apt-get install libeigen3-dev -y
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
cd ~
git clone https://github.com/robotology/osqp-eigen.git
cd osqp-eigen
mkdir build && cd build
cmake ../
make
sudo make install
Once all dependencies are installed, clone the repo using:
cd ~
git clone https://github.com/LukeSchmitt96/solveMPC.git
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
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