PTSC Eigen
PTSC Eigen

Prioritized Task-Space control solver using the Eigen linear algebra library, OSQP quadratic programming solver and the OsqpEigen wrapper for OSQP.

Implements both unconstrained and constrained version of the Prioritized Task Space Control algorithm by Martin de Lasa et al.

Notation

The quadratic cost function of the $i$-th priority has the following form:

$$E_i({x}) = ||{A}_i{x} - {b}_i||^2$$

and is defined by a matrix ${A}_i$ and a vector ${b}_i$.

Solution to the $i$-th priority of the PTSC problem is:

$${equation} {aligned} h_i = & \ {{x}}{{min}} & & E_i({x})\ & \ \ {s.t.} & & E_k({x}) = h_k, \ k < i\ & & & {A_{eq}}\ {x} + {b_{eq}} = 0\ & & & {A_{ieq}}\ {x} + {b_{ieq}} 0 {aligned} {equation}$$

where $h_i$ is the optimal cost of the $i$-th priority. Solution to the $i$-th priority is given by minimizing the $i$-th cost function $E_i({x})$, while the cost functions of higher priorities $E_k({x}), k < i$ remain in their respective minimums.

📄 Dependences

This project depends on Eigen3, osqp and osqp-eigen

It is recommended to build osqp-eigen from source, with:

-DOSQP_EIGEN_DEBUG_OUTPUT=OFF 

to suppress infeasibility warnings.

🛠️ Usage

⚙️ Build from source

git clone https://github.com/ivatavuk/ptsc_eigen.git
cd ptsc_eigen
mkdir build
cd build
cmake ..
make
make install

🖥️ Using the library

Including the library in your project

ptsc_eigen provides native CMake support which allows the library to be easily used in CMake projects. ptsc_eigen exports a CMake target called PtscEigen::PtscEigen which can be imported using the find_package CMake command and used by calling target_link_libraries as in the following example:

project(myproject)
find_package(PtscEigen REQUIRED)
add_executable(example example.cpp)
target_link_libraries(example PtscEigen::PtscEigen)

Minimal example

For minimal examples on different types of PTSC problems check the test folder

📝 License

Materials in this repository are distributed under the following license:

All software is licensed under the BSD 3-Clause License.