├── LICENSE ├── README.md ├── path_planning ├── forces │ ├── C │ │ ├── car_dynamics.c │ │ └── myfevals.c │ ├── NLPexample_autoFevals.m │ ├── NLPexample_autoFevals_termCost.m │ ├── NLPexample_ownFevals.m │ └── NLPexample_usingParameters.m └── ipopt │ ├── pathplanning.py │ └── pathplanning_code_generation.py ├── quadcopter ├── acado │ ├── dynamics.m │ ├── dynamics_ss.m │ ├── export_MPC │ │ ├── forces │ │ │ ├── forces.m │ │ │ ├── forces_info.txt │ │ │ ├── include │ │ │ │ └── forces.h │ │ │ ├── interface │ │ │ │ ├── COPYING.m │ │ │ │ ├── forces.m │ │ │ │ ├── forces_build.py │ │ │ │ ├── forces_lib.mdl │ │ │ │ ├── forces_mex.c │ │ │ │ ├── forces_py.py │ │ │ │ ├── forces_simulinkBlock.c │ │ │ │ ├── forces_simulinkBlockcompact.c │ │ │ │ ├── forcescompact_lib.mdl │ │ │ │ └── forcesprologo.jpg │ │ │ ├── lib │ │ │ │ └── forces.so │ │ │ └── obj │ │ │ │ └── forces.o │ │ ├── qpoases │ │ │ ├── EXAMPLES │ │ │ │ ├── example1.cpp │ │ │ │ └── example1b.cpp │ │ │ ├── INCLUDE │ │ │ │ ├── Bounds.hpp │ │ │ │ ├── Constants.hpp │ │ │ │ ├── Constraints.hpp │ │ │ │ ├── CyclingManager.hpp │ │ │ │ ├── EXTRAS │ │ │ │ │ └── SolutionAnalysis.hpp │ │ │ │ ├── Indexlist.hpp │ │ │ │ ├── MessageHandling.hpp │ │ │ │ ├── QProblem.hpp │ │ │ │ ├── QProblemB.hpp │ │ │ │ ├── SubjectTo.hpp │ │ │ │ ├── Types.hpp │ │ │ │ └── Utils.hpp │ │ │ ├── LICENSE.txt │ │ │ ├── README.txt │ │ │ ├── SRC │ │ │ │ ├── Bounds.cpp │ │ │ │ ├── Bounds.ipp │ │ │ │ ├── Constraints.cpp │ │ │ │ ├── Constraints.ipp │ │ │ │ ├── CyclingManager.cpp │ │ │ │ ├── CyclingManager.ipp │ │ │ │ ├── EXTRAS │ │ │ │ │ └── SolutionAnalysis.cpp │ │ │ │ ├── Indexlist.cpp │ │ │ │ ├── Indexlist.ipp │ │ │ │ ├── MessageHandling.cpp │ │ │ │ ├── MessageHandling.ipp │ │ │ │ ├── QProblem.cpp │ │ │ │ ├── QProblem.ipp │ │ │ │ ├── QProblemB.cpp │ │ │ │ ├── QProblemB.ipp │ │ │ │ ├── SubjectTo.cpp │ │ │ │ ├── SubjectTo.ipp │ │ │ │ ├── Utils.cpp │ │ │ │ └── Utils.ipp │ │ │ └── VERSIONS.txt │ │ └── qpoases3 │ │ │ ├── AUTHORS │ │ │ ├── AUTHORS.txt │ │ │ ├── INSTALL │ │ │ ├── INSTALL.txt │ │ │ ├── LICENSE.txt │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── README.txt │ │ │ ├── VERSIONS │ │ │ ├── VERSIONS.txt │ │ │ ├── bin │ │ │ └── empty.txt │ │ │ ├── doc │ │ │ ├── Makefile │ │ │ ├── doxygen.config │ │ │ └── mainpage.dox │ │ │ ├── examples │ │ │ ├── Makefile │ │ │ ├── example1.c │ │ │ ├── example1b.c │ │ │ ├── example3.c │ │ │ └── exampleLP.c │ │ │ ├── include │ │ │ ├── qpOASES_e.h │ │ │ └── qpOASES_e │ │ │ │ ├── Bounds.h │ │ │ │ ├── Constants.h │ │ │ │ ├── ConstraintProduct.h │ │ │ │ ├── Constraints.h │ │ │ │ ├── Flipper.h │ │ │ │ ├── Indexlist.h │ │ │ │ ├── Matrices.h │ │ │ │ ├── MessageHandling.h │ │ │ │ ├── Options.h │ │ │ │ ├── QProblem.h │ │ │ │ ├── QProblemB.h │ │ │ │ ├── Types.h │ │ │ │ ├── UnitTesting.h │ │ │ │ ├── Utils.h │ │ │ │ └── extras │ │ │ │ └── OQPinterface.h │ │ │ ├── interfaces │ │ │ ├── matlab │ │ │ │ ├── example1.mat │ │ │ │ ├── example1a.mat │ │ │ │ ├── example1b.mat │ │ │ │ ├── make.m │ │ │ │ ├── qpOASES_e.c │ │ │ │ ├── qpOASES_e.m │ │ │ │ ├── qpOASES_e.mexa64 │ │ │ │ ├── qpOASES_e_auxInput.m │ │ │ │ ├── qpOASES_e_matlab_utils.c │ │ │ │ ├── qpOASES_e_matlab_utils.h │ │ │ │ ├── qpOASES_e_options.m │ │ │ │ ├── qpOASES_e_sequence.c │ │ │ │ ├── qpOASES_e_sequence.m │ │ │ │ └── qpOASES_e_sequence.mexa64 │ │ │ └── simulink │ │ │ │ ├── example_QProblem.mdl │ │ │ │ ├── example_QProblemB.mdl │ │ │ │ ├── load_example_QProblem.m │ │ │ │ ├── load_example_QProblemB.m │ │ │ │ ├── make.m │ │ │ │ ├── qpOASES_e_QProblem.c │ │ │ │ ├── qpOASES_e_QProblemB.c │ │ │ │ └── qpOASES_e_simulink_utils.c │ │ │ ├── make.mk │ │ │ ├── make_cygwin.mk │ │ │ ├── make_linux.mk │ │ │ ├── make_osx.mk │ │ │ ├── make_windows.mk │ │ │ ├── src │ │ │ ├── Bounds.c │ │ │ ├── Constraints.c │ │ │ ├── Flipper.c │ │ │ ├── Indexlist.c │ │ │ ├── Makefile │ │ │ ├── Matrices.c │ │ │ ├── MessageHandling.c │ │ │ ├── OQPinterface.c │ │ │ ├── Options.c │ │ │ ├── QProblem.c │ │ │ ├── QProblemB.c │ │ │ └── Utils.c │ │ │ └── testing │ │ │ └── c │ │ │ ├── Makefile │ │ │ ├── data │ │ │ └── fetch_cpp_data │ │ │ ├── test_bench.c │ │ │ └── test_matrices.c │ ├── find_steady_state.m │ ├── myeul2quat.m │ ├── myquat2eul.m │ ├── quadcopter_sim_acado.m │ └── quadcopter_sim_acado_refinement.m ├── forces │ ├── dynamics.m │ ├── myquat2eul.m │ └── quadcopter_sim_forces.m └── ipopt │ ├── quadcopter.py │ └── quadcopter_bfgs.py └── robot ├── acado ├── dynamics.m ├── export_MPC │ ├── forces │ │ ├── forces.m │ │ ├── forces_info.txt │ │ ├── include │ │ │ └── forces.h │ │ ├── interface │ │ │ ├── COPYING.m │ │ │ ├── forces.m │ │ │ ├── forces_build.py │ │ │ ├── forces_lib.mdl │ │ │ ├── forces_mex.c │ │ │ ├── forces_py.py │ │ │ ├── forces_simulinkBlock.c │ │ │ ├── forces_simulinkBlockcompact.c │ │ │ ├── forcescompact_lib.mdl │ │ │ └── forcesprologo.jpg │ │ ├── lib │ │ │ └── forces.so │ │ └── obj │ │ │ └── forces.o │ └── qpoases │ │ ├── EXAMPLES │ │ ├── example1.cpp │ │ └── example1b.cpp │ │ ├── INCLUDE │ │ ├── Bounds.hpp │ │ ├── Constants.hpp │ │ ├── Constraints.hpp │ │ ├── CyclingManager.hpp │ │ ├── EXTRAS │ │ │ └── SolutionAnalysis.hpp │ │ ├── Indexlist.hpp │ │ ├── MessageHandling.hpp │ │ ├── QProblem.hpp │ │ ├── QProblemB.hpp │ │ ├── SubjectTo.hpp │ │ ├── Types.hpp │ │ └── Utils.hpp │ │ ├── LICENSE.txt │ │ ├── README.txt │ │ ├── SRC │ │ ├── Bounds.cpp │ │ ├── Bounds.ipp │ │ ├── Constraints.cpp │ │ ├── Constraints.ipp │ │ ├── CyclingManager.cpp │ │ ├── CyclingManager.ipp │ │ ├── EXTRAS │ │ │ └── SolutionAnalysis.cpp │ │ ├── Indexlist.cpp │ │ ├── Indexlist.ipp │ │ ├── MessageHandling.cpp │ │ ├── MessageHandling.ipp │ │ ├── QProblem.cpp │ │ ├── QProblem.ipp │ │ ├── QProblemB.cpp │ │ ├── QProblemB.ipp │ │ ├── SubjectTo.cpp │ │ ├── SubjectTo.ipp │ │ ├── Utils.cpp │ │ └── Utils.ipp │ │ └── VERSIONS.txt └── robot_sim.m ├── forces ├── dynamics.m └── robot_sim.m └── ipopt ├── robot.py └── robot_bfgs.py /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 embotech 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # forcesnlp-examples 2 | Public examples for FORCES NLP 3 | -------------------------------------------------------------------------------- /path_planning/forces/C/car_dynamics.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void car_dyanmics(double *x, double *c) 4 | { 5 | c[0] = x[2] + (x[4]*cos(x[5]))/60 + (cos(x[1]/10 + x[5])*(x[0]/10 + x[4]))/60 + (cos(x[1]/20 + x[5])*(x[0]/20 + x[4]))/15; 6 | c[1] = x[3] + (x[4]*sin(x[5]))/60 + (sin(x[1]/10 + x[5])*(x[0]/10 + x[4]))/60 + (sin(x[1]/20 + x[5])*(x[0]/20 + x[4]))/15; 7 | c[2] = x[0]/10 + x[4]; 8 | c[3] = x[1]/10 + x[5]; 9 | } 10 | 11 | void car_dyanmics_jacobian(double *x, double *J) 12 | { 13 | /* NOTE: only non-zero values in dense matrix (column major) filled in */ 14 | 15 | /* 1st column: indices 0..3 */ 16 | J[0] = cos(x[1]/10 + x[5])/600 + cos(x[1]/20 + x[5])/300; 17 | J[1] = sin(x[1]/10 + x[5])/600 + sin(x[1]/20 + x[5])/300; 18 | J[2] = 0.1; 19 | 20 | /* 2nd column: indices 4..7 */ 21 | J[4] = - (sin(x[1]/10 + x[5])*(x[0]/10 + x[4]))/600 - (sin(x[1]/20 + x[5])*(x[0]/20 + x[4]))/300; 22 | J[5] = (cos(x[1]/10 + x[5])*(x[0]/10 + x[4]))/600 + (cos(x[1]/20 + x[5])*(x[0]/20 + x[4]))/300; 23 | J[7] = 0.1; 24 | 25 | /* 3rd column: indices 8..11 */ 26 | J[8] = 1; 27 | 28 | /* 4th column: indices 12..15 */ 29 | J[13] = 1; 30 | 31 | /* 5th column: indices 16..19 */ 32 | J[16] = cos(x[1]/10 + x[5])/60 + cos(x[1]/20 + x[5])/15 + cos(x[5])/60; 33 | J[17] = sin(x[1]/10 + x[5])/60 + sin(x[1]/20 + x[5])/15 + sin(x[5])/60; 34 | J[18] = 1; 35 | 36 | /* 6th column: indices 20..23 */ 37 | J[20] = - (x[4]*sin(x[5]))/60 - (sin(x[1]/10 + x[5])*(x[0]/10 + x[4]))/60 - (sin(x[1]/20 + x[5])*(x[0]/20 + x[4]))/15; 38 | J[21] = (x[4]*cos(x[5]))/60 + (cos(x[1]/10 + x[5])*(x[0]/10 + x[4]))/60 + (cos(x[1]/20 + x[5])*(x[0]/20 + x[4]))/15; 39 | J[23] = 1; 40 | } 41 | -------------------------------------------------------------------------------- /path_planning/forces/C/myfevals.c: -------------------------------------------------------------------------------- 1 | extern void car_dyanmics(double *x, double *c); 2 | extern void car_dyanmics_jacobian(double *x, double *J); 3 | 4 | void myfevals( double *x, /* primal vars */ 5 | double *y, /* eq. constraint multiplers */ 6 | double *l, /* ineq. constraint multipliers */ 7 | double *p, /* parameters */ 8 | double *f, /* objective function (incremented in this function) */ 9 | double *nabla_f, /* gradient of objective function */ 10 | double *c, /* dynamics */ 11 | double *nabla_c, /* Jacobian of the dynamics (column major) */ 12 | double *h, /* inequality constraints */ 13 | double *nabla_h, /* Jacobian of inequality constraints (column major) */ 14 | double *H, /* Hessian (column major) */ 15 | int stage /* stage number (0 indexed) */ 16 | ) 17 | { 18 | /* cost */ 19 | if (f) 20 | { /* notice the increment of f */ 21 | (*f) += -100*x[3] + 0.1*x[0]*x[0] + 0.01*x[1]*x[1]; 22 | } 23 | 24 | /* gradient - only nonzero elements have to be filled in */ 25 | if (nabla_f) 26 | { 27 | nabla_f[0] = 0.2*x[0]; 28 | nabla_f[1] = 0.02*x[1]; 29 | nabla_f[3] = -100; 30 | } 31 | 32 | /* eq constr */ 33 | if (c) 34 | { 35 | car_dyanmics(x, c); 36 | } 37 | 38 | /* jacobian equalities (column major) */ 39 | if (nabla_c) 40 | { 41 | car_dyanmics_jacobian(x, nabla_c); 42 | } 43 | 44 | /* ineq constr */ 45 | if (h) 46 | { 47 | h[0] = x[2]*x[2] + x[3]*x[3]; 48 | h[1] = (x[2]+2)*(x[2]+2) + (x[3]-2.5)*(x[3]-2.5); 49 | } 50 | 51 | /* jacobian inequalities (column major) - only non-zero elements to be filled in */ 52 | if (nabla_h) 53 | { 54 | /* column 3 */ 55 | nabla_h[4] = 2*x[2]; 56 | nabla_h[5] = 2*x[2] + 4; 57 | 58 | /* column 4 */ 59 | nabla_h[6] = 2*x[3]; 60 | nabla_h[7] = 2*x[3] - 5; 61 | } 62 | } -------------------------------------------------------------------------------- /quadcopter/acado/dynamics.m: -------------------------------------------------------------------------------- 1 | function [ dx ] = dynamics( x,u ) 2 | rho = 1.23; 3 | A = 0.1; 4 | Cl = 0.25; 5 | Cd = 0.3*Cl; 6 | m = 10; 7 | g = 9.81; 8 | L = 0.5; 9 | L2 = 1; 10 | J1 = 0.25; 11 | J2 = 0.25; 12 | J3 = 1; 13 | 14 | V1 = x(4); 15 | V2 = x(5); 16 | V3 = x(6); 17 | 18 | q1 = x(7); 19 | q2 = x(8); 20 | q3 = x(9); 21 | q4 = x(10); 22 | 23 | Omega1 = x(11); 24 | Omega2 = x(12); 25 | Omega3 = x(13); 26 | 27 | W1 = x(14); 28 | W2 = x(15); 29 | W3 = x(16); 30 | W4 = x(17); 31 | 32 | alpha = 0.0; 33 | rW1 = u(1); 34 | rW2 = u(2); 35 | rW3 = u(3); 36 | rW4 = u(4); 37 | 38 | dx = ... 39 | [ 40 | V1; 41 | V2; 42 | V3; 43 | (A*Cl*rho*(2*q1*q3 + 2*q2*q4)*(W1*W1 + W2*W2 + W3*W3 + W4*W4))/(2*m); 44 | -(A*Cl*rho*(2*q1*q2 - 2*q3*q4)*(W1*W1 + W2*W2 + W3*W3 + W4*W4))/(2*m); 45 | (A*Cl*rho*(W1*W1 + W2*W2 + W3*W3 + W4*W4)*(q1*q1 - q2*q2 - q3*q3 + q4*q4))/(2*m) - g; 46 | - (Omega1*q2)/2 - (Omega2*q3)/2 - (Omega3*q4)/2 - (alpha*q1*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 47 | (Omega1*q1)/2 - (Omega3*q3)/2 + (Omega2*q4)/2 - (alpha*q2*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 48 | (Omega2*q1)/2 + (Omega3*q2)/2 - (Omega1*q4)/2 - (alpha*q3*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 49 | (Omega3*q1)/2 - (Omega2*q2)/2 + (Omega1*q3)/2 - (alpha*q4*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 50 | (J3*Omega2*Omega3 - J2*Omega2*Omega3 + (A*Cl*L*rho*(W2*W2 - W4*W4))/2)/J1; 51 | -(J3*Omega1*Omega3 - J1*Omega1*Omega3 + (A*Cl*L*rho*(W1*W1 - W3*W3))/2)/J2; 52 | (J2*Omega1*Omega2 - J1*Omega1*Omega2 + (A*Cd*L2*rho*(W1*W1 - W2*W2 + W3*W3 - W4*W4))/2)/J3; 53 | rW1; 54 | rW2; 55 | rW3; 56 | rW4]; 57 | end 58 | 59 | -------------------------------------------------------------------------------- /quadcopter/acado/dynamics_ss.m: -------------------------------------------------------------------------------- 1 | function [ dx ] = dynamics_ss( input ) 2 | rho = 1.23; 3 | A = 0.1; 4 | Cl = 0.25; 5 | Cd = 0.3*Cl; 6 | m = 10; 7 | g = 9.81; 8 | L = 0.5; 9 | L2 = 1; 10 | J1 = 0.25; 11 | J2 = 0.25; 12 | J3 = 1; 13 | 14 | V1 = 0; 15 | V2 = 0; 16 | V3 = 0; 17 | 18 | q1 = 1; 19 | q2 = 0; 20 | q3 = 0; 21 | q4 = 0; 22 | 23 | Omega1 = 0; 24 | Omega2 = 0; 25 | Omega3 = 0; 26 | 27 | W1 = input(1); 28 | W2 = input(2); 29 | W3 = input(3); 30 | W4 = input(4); 31 | 32 | alpha = 0.0; 33 | rW1 = 0.0; 34 | rW2 = 0.0; 35 | rW3 = 0.0; 36 | rW4 = 0.0; 37 | 38 | dx = ... 39 | [ 40 | V1; 41 | V2; 42 | V3; 43 | (A*Cl*rho*(2*q1*q3 + 2*q2*q4)*(W1*W1 + W2*W2 + W3*W3 + W4*W4))/(2*m); 44 | -(A*Cl*rho*(2*q1*q2 - 2*q3*q4)*(W1*W1 + W2*W2 + W3*W3 + W4*W4))/(2*m); 45 | (A*Cl*rho*(W1*W1 + W2*W2 + W3*W3 + W4*W4)*(q1*q1 - q2*q2 - q3*q3 + q4*q4))/(2*m) - g; 46 | - (Omega1*q2)/2 - (Omega2*q3)/2 - (Omega3*q4)/2 - (alpha*q1*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 47 | (Omega1*q1)/2 - (Omega3*q3)/2 + (Omega2*q4)/2 - (alpha*q2*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 48 | (Omega2*q1)/2 + (Omega3*q2)/2 - (Omega1*q4)/2 - (alpha*q3*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 49 | (Omega3*q1)/2 - (Omega2*q2)/2 + (Omega1*q3)/2 - (alpha*q4*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 50 | (J3*Omega2*Omega3 - J2*Omega2*Omega3 + (A*Cl*L*rho*(W2*W2 - W4*W4))/2)/J1; 51 | -(J3*Omega1*Omega3 - J1*Omega1*Omega3 + (A*Cl*L*rho*(W1*W1 - W3*W3))/2)/J2; 52 | (J2*Omega1*Omega2 - J1*Omega1*Omega2 + (A*Cd*L2*rho*(W1*W1 - W2*W2 + W3*W3 - W4*W4))/2)/J3; 53 | rW1; 54 | rW2; 55 | rW3; 56 | rW4]; 57 | end 58 | 59 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/forces/forces_info.txt: -------------------------------------------------------------------------------- 1 | The approximate properties of the solver code are: 2 | - Data memory consumption : 767648 Bytes (statically allocated) 3 | - Code memory consumption : ~ 35000 Bytes 4 | - Computation count : 2754474 FLOPS per interior-point iteration -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/forces/interface/COPYING.m: -------------------------------------------------------------------------------- 1 | % forces : A fast customized optimization solver. 2 | % 3 | % Copyright (C) 2013-2016 EMBOTECH GMBH [info@embotech.com]. All rights reserved. 4 | % 5 | % 6 | % This software is intended for simulation and testing purposes only. 7 | % Use of this software for any commercial purpose is prohibited. 8 | % 9 | % This program is distributed in the hope that it will be useful. 10 | % EMBOTECH makes NO WARRANTIES with respect to the use of the software 11 | % without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | % PARTICULAR PURPOSE. 13 | % 14 | % EMBOTECH shall not have any liability for any damage arising from the use 15 | % of the software. 16 | % 17 | % This Agreement shall exclusively be governed by and interpreted in 18 | % accordance with the laws of Switzerland, excluding its principles 19 | % of conflict of laws. The Courts of Zurich-City shall have exclusive 20 | % jurisdiction in case of any dispute. 21 | % 22 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/forces/interface/forces_build.py: -------------------------------------------------------------------------------- 1 | #forces : A fast customized optimization solver. 2 | # 3 | #Copyright (C) 2013-2016 EMBOTECH GMBH [info@embotech.com]. All rights reserved. 4 | # 5 | # 6 | #This software is intended for simulation and testing purposes only. 7 | #Use of this software for any commercial purpose is prohibited. 8 | # 9 | #This program is distributed in the hope that it will be useful. 10 | #EMBOTECH makes NO WARRANTIES with respect to the use of the software 11 | #without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | #PARTICULAR PURPOSE. 13 | # 14 | #EMBOTECH shall not have any liability for any damage arising from the use 15 | #of the software. 16 | # 17 | #This Agreement shall exclusively be governed by and interpreted in 18 | #accordance with the laws of Switzerland, excluding its principles 19 | #of conflict of laws. The Courts of Zurich-City shall have exclusive 20 | #jurisdiction in case of any dispute. 21 | # 22 | from distutils.ccompiler import new_compiler 23 | c = new_compiler() 24 | #from numpy.distutils.intelccompiler import IntelCCompiler 25 | #c = IntelCCompiler() 26 | 27 | 28 | import os 29 | import sys 30 | import distutils 31 | 32 | # determine source file 33 | sourcefile = os.path.join(os.getcwd(),"forces","src","forces"+".c") 34 | 35 | # determine lib file 36 | if sys.platform.startswith('win'): 37 | libfile = os.path.join(os.getcwd(),"forces","lib","forces"+".lib") 38 | else: 39 | libfile = os.path.join(os.getcwd(),"forces","lib","forces"+".so") 40 | 41 | # create lib dir if it does not exist yet 42 | if not os.path.exists(os.path.join(os.getcwd(),"forces","lib")): 43 | os.makedirs(os.path.join(os.getcwd(),"forces","lib")) 44 | 45 | 46 | 47 | # compile into object file 48 | objdir = os.path.join(os.getcwd(),"forces","obj") 49 | if isinstance(c,distutils.unixccompiler.UnixCCompiler): 50 | objects = c.compile([sourcefile], output_dir=objdir, extra_preargs=['-O3','-fPIC','-fopenmp','-mavx']) 51 | if sys.platform.startswith('linux'): 52 | c.set_libraries(['rt','gomp']) 53 | else: 54 | objects = c.compile([sourcefile], output_dir=objdir) 55 | 56 | 57 | # create libraries 58 | libdir = os.path.join(os.getcwd(),"forces","lib") 59 | exportsymbols = ["%s_solve" % "forces"] 60 | c.create_static_lib(objects, "forces", output_dir=libdir) 61 | c.link_shared_lib(objects, "forces", output_dir=libdir, export_symbols=exportsymbols) -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/forces/interface/forcesprologo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/quadcopter/acado/export_MPC/forces/interface/forcesprologo.jpg -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/forces/lib/forces.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/quadcopter/acado/export_MPC/forces/lib/forces.so -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/forces/obj/forces.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/quadcopter/acado/export_MPC/forces/obj/forces.o -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/EXAMPLES/example1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file EXAMPLES/example1.cpp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Very simple example for testing qpOASES (using QProblem class). 31 | */ 32 | 33 | 34 | #include 35 | 36 | 37 | /** Example for qpOASES main function using the QProblem class. */ 38 | int main( ) 39 | { 40 | /* Setup data of first QP. */ 41 | real_t H[2*2] = { 1.0, 0.0, 0.0, 0.5 }; 42 | real_t A[1*2] = { 1.0, 1.0 }; 43 | real_t g[2] = { 1.5, 1.0 }; 44 | real_t lb[2] = { 0.5, -2.0 }; 45 | real_t ub[2] = { 5.0, 2.0 }; 46 | real_t lbA[1] = { -1.0 }; 47 | real_t ubA[1] = { 2.0 }; 48 | 49 | /* Setup data of second QP. */ 50 | real_t g_new[2] = { 1.0, 1.5 }; 51 | real_t lb_new[2] = { 0.0, -1.0 }; 52 | real_t ub_new[2] = { 5.0, -0.5 }; 53 | real_t lbA_new[1] = { -2.0 }; 54 | real_t ubA_new[1] = { 1.0 }; 55 | 56 | 57 | /* Setting up QProblem object. */ 58 | QProblem example( 2,1 ); 59 | 60 | /* Solve first QP. */ 61 | int nWSR = 10; 62 | example.init( H,g,A,lb,ub,lbA,ubA, nWSR,0 ); 63 | 64 | /* Solve second QP. */ 65 | nWSR = 10; 66 | example.hotstart( g_new,lb_new,ub_new,lbA_new,ubA_new, nWSR,0 ); 67 | 68 | return 0; 69 | } 70 | 71 | 72 | /* 73 | * end of file 74 | */ 75 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/EXAMPLES/example1b.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file EXAMPLES/example1b.cpp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3 28 | * \date 2007-2008 29 | * 30 | * Very simple example for testing qpOASES using the QProblemB class. 31 | */ 32 | 33 | 34 | #include 35 | 36 | 37 | /** Example for qpOASES main function using the QProblemB class. */ 38 | int main( ) 39 | { 40 | /* Setup data of first QP. */ 41 | real_t H[2*2] = { 1.0, 0.0, 0.0, 0.5 }; 42 | real_t g[2] = { 1.5, 1.0 }; 43 | real_t lb[2] = { 0.5, -2.0 }; 44 | real_t ub[2] = { 5.0, 2.0 }; 45 | 46 | /* Setup data of second QP. */ 47 | real_t g_new[2] = { 1.0, 1.5 }; 48 | real_t lb_new[2] = { 0.0, -1.0 }; 49 | real_t ub_new[2] = { 5.0, -0.5 }; 50 | 51 | 52 | /* Setting up QProblemB object. */ 53 | QProblemB example( 2 ); 54 | 55 | /* Solve first QP. */ 56 | int nWSR = 10; 57 | example.init( H,g,lb,ub, nWSR,0 ); 58 | 59 | /* Solve second QP. */ 60 | nWSR = 10; 61 | example.hotstart( g_new,lb_new,ub_new, nWSR,0 ); 62 | 63 | return 0; 64 | } 65 | 66 | 67 | /* 68 | * end of file 69 | */ 70 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/INCLUDE/Constants.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file INCLUDE/Constants.hpp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2008 29 | * 30 | * Definition of all global constants. 31 | */ 32 | 33 | 34 | #ifndef QPOASES_CONSTANTS_HPP 35 | #define QPOASES_CONSTANTS_HPP 36 | 37 | #ifndef QPOASES_CUSTOM_INTERFACE 38 | #include "acado_qpoases_interface.hpp" 39 | #else 40 | #define XSTR(x) #x 41 | #define STR(x) XSTR(x) 42 | #include STR(QPOASES_CUSTOM_INTERFACE) 43 | #endif 44 | 45 | /** Maximum number of variables within a QP formulation. 46 | Note: this value has to be positive! */ 47 | const int NVMAX = QPOASES_NVMAX; 48 | 49 | /** Maximum number of constraints within a QP formulation. 50 | Note: this value has to be positive! */ 51 | const int NCMAX = QPOASES_NCMAX; 52 | 53 | /** Redefinition of NCMAX used for memory allocation, to avoid zero sized arrays 54 | and compiler errors. */ 55 | const int NCMAX_ALLOC = (NCMAX == 0) ? 1 : NCMAX; 56 | 57 | /**< Maximum number of working set recalculations. 58 | Note: this value has to be positive! */ 59 | const int NWSRMAX = QPOASES_NWSRMAX; 60 | 61 | /** Desired KKT tolerance of QP solution; a warning RET_INACCURATE_SOLUTION is 62 | * issued if this tolerance is not met. 63 | * Note: this value has to be positive! */ 64 | const real_t DESIREDACCURACY = (real_t) 1.0e-3; 65 | 66 | /** Critical KKT tolerance of QP solution; an error is issued if this 67 | * tolerance is not met. 68 | * Note: this value has to be positive! */ 69 | const real_t CRITICALACCURACY = (real_t) 1.0e-2; 70 | 71 | 72 | 73 | /** Numerical value of machine precision (min eps, s.t. 1+eps > 1). 74 | Note: this value has to be positive! */ 75 | const real_t EPS = (real_t) QPOASES_EPS; 76 | 77 | /** Numerical value of zero (for situations in which it would be 78 | * unreasonable to compare with 0.0). 79 | * Note: this value has to be positive! */ 80 | const real_t ZERO = (real_t) 1.0e-50; 81 | 82 | /** Numerical value of infinity (e.g. for non-existing bounds). 83 | * Note: this value has to be positive! */ 84 | const real_t INFTY = (real_t) 1.0e12; 85 | 86 | 87 | /** Lower/upper (constraints') bound tolerance (an inequality constraint 88 | * whose lower and upper bound differ by less than BOUNDTOL is regarded 89 | * to be an equality constraint). 90 | * Note: this value has to be positive! */ 91 | const real_t BOUNDTOL = (real_t) 1.0e-10; 92 | 93 | /** Offset for relaxing (constraints') bounds at beginning of an initial homotopy. 94 | * Note: this value has to be positive! */ 95 | const real_t BOUNDRELAXATION = (real_t) 1.0e3; 96 | 97 | 98 | /** Factor that determines physical lengths of index lists. 99 | * Note: this value has to be greater than 1! */ 100 | const int INDEXLISTFACTOR = 5; 101 | 102 | 103 | #endif /* QPOASES_CONSTANTS_HPP */ 104 | 105 | 106 | /* 107 | * end of file 108 | */ 109 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/INCLUDE/CyclingManager.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file INCLUDE/CyclingManager.hpp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Declaration of the CyclingManager class designed to detect 31 | * and handle possible cycling during QP iterations. 32 | */ 33 | 34 | 35 | #ifndef QPOASES_CYCLINGMANAGER_HPP 36 | #define QPOASES_CYCLINGMANAGER_HPP 37 | 38 | 39 | #include 40 | 41 | 42 | 43 | /** This class is intended to detect and handle possible cycling during QP iterations. 44 | * As cycling seems to occur quite rarely, this class is NOT FULLY IMPLEMENTED YET! 45 | * 46 | * \author Hans Joachim Ferreau 47 | * \version 1.3embedded 48 | * \date 2007-2008 49 | */ 50 | class CyclingManager 51 | { 52 | /* 53 | * PUBLIC MEMBER FUNCTIONS 54 | */ 55 | public: 56 | /** Default constructor. */ 57 | CyclingManager( ); 58 | 59 | /** Copy constructor (deep copy). */ 60 | CyclingManager( const CyclingManager& rhs /**< Rhs object. */ 61 | ); 62 | 63 | /** Destructor. */ 64 | ~CyclingManager( ); 65 | 66 | /** Copy asingment operator (deep copy). */ 67 | CyclingManager& operator=( const CyclingManager& rhs /**< Rhs object. */ 68 | ); 69 | 70 | 71 | /** Pseudo-constructor which takes the number of bounds/constraints. 72 | * \return SUCCESSFUL_RETURN */ 73 | returnValue init( int _nV, /**< Number of bounds to be managed. */ 74 | int _nC /**< Number of constraints to be managed. */ 75 | ); 76 | 77 | 78 | /** Stores index of a bound/constraint that might cause cycling. 79 | * \return SUCCESSFUL_RETURN \n 80 | RET_INDEX_OUT_OF_BOUNDS */ 81 | returnValue setCyclingStatus( int number, /**< Number of bound/constraint. */ 82 | BooleanType isBound, /**< Flag that indicates if given number corresponds to a 83 | * bound (BT_TRUE) or a constraint (BT_FALSE). */ 84 | CyclingStatus _status /**< Cycling status of bound/constraint. */ 85 | ); 86 | 87 | /** Returns if bound/constraint might cause cycling. 88 | * \return BT_TRUE: bound/constraint might cause cycling \n 89 | BT_FALSE: otherwise */ 90 | CyclingStatus getCyclingStatus( int number, /**< Number of bound/constraint. */ 91 | BooleanType isBound /**< Flag that indicates if given number corresponds to 92 | * a bound (BT_TRUE) or a constraint (BT_FALSE). */ 93 | ) const; 94 | 95 | 96 | /** Clears all previous cycling information. 97 | * \return SUCCESSFUL_RETURN */ 98 | returnValue clearCyclingData( ); 99 | 100 | 101 | /** Returns if cycling was detected. 102 | * \return BT_TRUE iff cycling was detected. */ 103 | inline BooleanType isCyclingDetected( ) const; 104 | 105 | 106 | /* 107 | * PROTECTED MEMBER VARIABLES 108 | */ 109 | protected: 110 | int nV; /**< Number of managed bounds. */ 111 | int nC; /**< Number of managed constraints. */ 112 | 113 | CyclingStatus status[NVMAX+NCMAX]; /**< Array to store cycling status of all bounds/constraints. */ 114 | 115 | BooleanType cyclingDetected; /**< Flag if cycling was detected. */ 116 | }; 117 | 118 | 119 | #include 120 | 121 | #endif /* QPOASES_CYCLINGMANAGER_HPP */ 122 | 123 | 124 | /* 125 | * end of file 126 | */ 127 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/INCLUDE/EXTRAS/SolutionAnalysis.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file INCLUDE/EXTRAS/SolutionAnalysis.hpp 26 | * \author Milan Vukov, Boris Houska, Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2012 29 | * 30 | * Solution analysis class, based on a class in the standard version of the qpOASES 31 | */ 32 | 33 | 34 | // 35 | 36 | #ifndef QPOASES_SOLUTIONANALYSIS_HPP 37 | #define QPOASES_SOLUTIONANALYSIS_HPP 38 | 39 | #include 40 | 41 | /** Enables the computation of variance as is in the standard version of qpOASES */ 42 | #define QPOASES_USE_OLD_VERSION 0 43 | 44 | #if QPOASES_USE_OLD_VERSION 45 | #define KKT_DIM (2 * NVMAX + NCMAX) 46 | #endif 47 | 48 | class SolutionAnalysis 49 | { 50 | public: 51 | 52 | /** Default constructor. */ 53 | SolutionAnalysis( ); 54 | 55 | /** Copy constructor (deep copy). */ 56 | SolutionAnalysis( const SolutionAnalysis& rhs /**< Rhs object. */ 57 | ); 58 | 59 | /** Destructor. */ 60 | ~SolutionAnalysis( ); 61 | 62 | /** Copy asingment operator (deep copy). */ 63 | SolutionAnalysis& operator=( const SolutionAnalysis& rhs /**< Rhs object. */ 64 | ); 65 | 66 | /** A routine for computation of inverse of the Hessian matrix. */ 67 | returnValue getHessianInverse( 68 | QProblem* qp, /** QP */ 69 | real_t* hessianInverse /** Inverse of the Hessian matrix*/ 70 | ); 71 | 72 | /** A routine for computation of inverse of the Hessian matrix. */ 73 | returnValue getHessianInverse( QProblemB* qp, /** QP */ 74 | real_t* hessianInverse /** Inverse of the Hessian matrix*/ 75 | ); 76 | 77 | #if QPOASES_USE_OLD_VERSION 78 | returnValue getVarianceCovariance( 79 | QProblem* qp, 80 | real_t* g_b_bA_VAR, 81 | real_t* Primal_Dual_VAR 82 | ); 83 | #endif 84 | 85 | private: 86 | 87 | real_t delta_g_cov[ NVMAX ]; /** A covariance-vector of g */ 88 | real_t delta_lb_cov[ NVMAX ]; /** A covariance-vector of lb */ 89 | real_t delta_ub_cov[ NVMAX ]; /** A covariance-vector of ub */ 90 | real_t delta_lbA_cov[ NCMAX_ALLOC ]; /** A covariance-vector of lbA */ 91 | real_t delta_ubA_cov[ NCMAX_ALLOC ]; /** A covariance-vector of ubA */ 92 | 93 | #if QPOASES_USE_OLD_VERSION 94 | real_t K[KKT_DIM * KKT_DIM]; /** A matrix to store an intermediate result */ 95 | #endif 96 | 97 | int FR_idx[ NVMAX ]; /** Index array for free variables */ 98 | int FX_idx[ NVMAX ]; /** Index array for fixed variables */ 99 | int AC_idx[ NCMAX_ALLOC ]; /** Index array for active constraints */ 100 | 101 | real_t delta_xFR[ NVMAX ]; /** QP reaction, primal, w.r.t. free */ 102 | real_t delta_xFX[ NVMAX ]; /** QP reaction, primal, w.r.t. fixed */ 103 | real_t delta_yAC[ NVMAX ]; /** QP reaction, dual, w.r.t. active */ 104 | real_t delta_yFX[ NVMAX ]; /** QP reaction, dual, w.r.t. fixed*/ 105 | }; 106 | 107 | #endif // QPOASES_SOLUTIONANALYSIS_HPP 108 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/README.txt: -------------------------------------------------------------------------------- 1 | ## 2 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 3 | ## Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 4 | ## 5 | ## qpOASES is free software; you can redistribute it and/or 6 | ## modify it under the terms of the GNU Lesser General Public 7 | ## License as published by the Free Software Foundation; either 8 | ## version 2.1 of the License, or (at your option) any later version. 9 | ## 10 | ## qpOASES is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | ## Lesser General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Lesser General Public 16 | ## License along with qpOASES; if not, write to the Free Software 17 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | ## 19 | 20 | 21 | 22 | INTRODUCTION 23 | ============= 24 | 25 | qpOASES is an open-source C++ implementation of the recently proposed 26 | online active set strategy (see [1], [2]), which was inspired by important 27 | observations from the field of parametric quadratic programming. It has 28 | several theoretical features that make it particularly suited for model 29 | predictive control (MPC) applications. 30 | 31 | The software package qpOASES implements these ideas and has already been 32 | successfully used for closed-loop control of a real-world Diesel engine [3]. 33 | 34 | 35 | References: 36 | 37 | [1] H.J. Ferreau. An Online Active Set Strategy for Fast Solution of 38 | Parametric Quadratic Programs with Applications to Predictive Engine Control. 39 | Diplom thesis, University of Heidelberg, 2006. 40 | 41 | [2] H.J. Ferreau, H.G. Bock, M. Diehl. An online active set strategy to 42 | overcome the limitations of explicit MPC. International Journal of Robust 43 | and Nonlinear Control, 18 (8), pp. 816-830, 2008. 44 | 45 | [3] H.J. Ferreau, P. Ortner, P. Langthaler, L. del Re, M. Diehl. Predictive 46 | Control of a Real-World Diesel Engine using an Extended Online Active Set 47 | Strategy. Annual Reviews in Control, 31 (2), pp. 293-301, 2007. 48 | 49 | 50 | 51 | GETTING STARTED 52 | ================ 53 | 54 | 1. For installation, usage and additional information on this software package 55 | see the qpOASES User's Manual located at ./DOC/manual.pdf! 56 | 57 | 58 | 2. The file ./LICENSE.txt contains a copy of the GNU Lesser General Public 59 | License. Please read it carefully before using qpOASES! 60 | 61 | 62 | 3. The whole software package can be downloaded from 63 | 64 | http://homes.esat.kuleuven.be/~optec/software/qpOASES/ 65 | 66 | On this webpage you will also find a list of frequently asked questions. 67 | 68 | 69 | 70 | CONTACT THE AUTHORS 71 | ==================== 72 | 73 | If you have got questions, remarks or comments on qpOASES 74 | please contact the main author: 75 | 76 | Hans Joachim Ferreau 77 | Katholieke Universiteit Leuven 78 | Department of Electrical Engineering (ESAT) 79 | Kasteelpark Arenberg 10, bus 2446 80 | B-3001 Leuven-Heverlee, Belgium 81 | 82 | Phone: +32 16 32 03 63 83 | E-mail: joachim.ferreau@esat.kuleuven.be 84 | qpOASES@esat.kuleuven.be 85 | 86 | Also bug reports and source code extensions are most welcome! 87 | 88 | 89 | 90 | ## 91 | ## end of file 92 | ## 93 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/SRC/Bounds.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/Bounds.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Implementation of inlined member functions of the Bounds class designed 31 | * to manage working sets of bounds within a QProblem. 32 | */ 33 | 34 | 35 | /***************************************************************************** 36 | * P U B L I C * 37 | *****************************************************************************/ 38 | 39 | /* 40 | * g e t N V 41 | */ 42 | inline int Bounds::getNV( ) const 43 | { 44 | return nV; 45 | } 46 | 47 | 48 | /* 49 | * g e t N F X 50 | */ 51 | inline int Bounds::getNFV( ) const 52 | { 53 | return nFV; 54 | } 55 | 56 | 57 | /* 58 | * g e t N B V 59 | */ 60 | inline int Bounds::getNBV( ) const 61 | { 62 | return nBV; 63 | } 64 | 65 | 66 | /* 67 | * g e t N U V 68 | */ 69 | inline int Bounds::getNUV( ) const 70 | { 71 | return nUV; 72 | } 73 | 74 | 75 | 76 | /* 77 | * s e t N F X 78 | */ 79 | inline returnValue Bounds::setNFV( int n ) 80 | { 81 | nFV = n; 82 | return SUCCESSFUL_RETURN; 83 | } 84 | 85 | 86 | /* 87 | * s e t N B V 88 | */ 89 | inline returnValue Bounds::setNBV( int n ) 90 | { 91 | nBV = n; 92 | return SUCCESSFUL_RETURN; 93 | } 94 | 95 | 96 | /* 97 | * s e t N U V 98 | */ 99 | inline returnValue Bounds::setNUV( int n ) 100 | { 101 | nUV = n; 102 | return SUCCESSFUL_RETURN; 103 | } 104 | 105 | 106 | /* 107 | * g e t N F R 108 | */ 109 | inline int Bounds::getNFR( ) 110 | { 111 | return free.getLength( ); 112 | } 113 | 114 | 115 | /* 116 | * g e t N F X 117 | */ 118 | inline int Bounds::getNFX( ) 119 | { 120 | return fixed.getLength( ); 121 | } 122 | 123 | 124 | /* 125 | * g e t F r e e 126 | */ 127 | inline Indexlist* Bounds::getFree( ) 128 | { 129 | return &free; 130 | } 131 | 132 | 133 | /* 134 | * g e t F i x e d 135 | */ 136 | inline Indexlist* Bounds::getFixed( ) 137 | { 138 | return &fixed; 139 | } 140 | 141 | 142 | /* 143 | * end of file 144 | */ 145 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/SRC/Constraints.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/Constraints.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Declaration of inlined member functions of the Constraints class designed 31 | * to manage working sets of constraints within a QProblem. 32 | */ 33 | 34 | 35 | 36 | /***************************************************************************** 37 | * P U B L I C * 38 | *****************************************************************************/ 39 | 40 | /* 41 | * g e t N C 42 | */ 43 | inline int Constraints::getNC( ) const 44 | { 45 | return nC; 46 | } 47 | 48 | 49 | /* 50 | * g e t N E C 51 | */ 52 | inline int Constraints::getNEC( ) const 53 | { 54 | return nEC; 55 | } 56 | 57 | 58 | /* 59 | * g e t N I C 60 | */ 61 | inline int Constraints::getNIC( ) const 62 | { 63 | return nIC; 64 | } 65 | 66 | 67 | /* 68 | * g e t N U C 69 | */ 70 | inline int Constraints::getNUC( ) const 71 | { 72 | return nUC; 73 | } 74 | 75 | 76 | /* 77 | * s e t N E C 78 | */ 79 | inline returnValue Constraints::setNEC( int n ) 80 | { 81 | nEC = n; 82 | return SUCCESSFUL_RETURN; 83 | } 84 | 85 | 86 | /* 87 | * s e t N I C 88 | */ 89 | inline returnValue Constraints::setNIC( int n ) 90 | { 91 | nIC = n; 92 | return SUCCESSFUL_RETURN; 93 | } 94 | 95 | 96 | /* 97 | * s e t N U C 98 | */ 99 | inline returnValue Constraints::setNUC( int n ) 100 | { 101 | nUC = n; 102 | return SUCCESSFUL_RETURN; 103 | } 104 | 105 | 106 | /* 107 | * g e t N A C 108 | */ 109 | inline int Constraints::getNAC( ) 110 | { 111 | return active.getLength( ); 112 | } 113 | 114 | 115 | /* 116 | * g e t N I A C 117 | */ 118 | inline int Constraints::getNIAC( ) 119 | { 120 | return inactive.getLength( ); 121 | } 122 | 123 | 124 | /* 125 | * g e t A c t i v e 126 | */ 127 | inline Indexlist* Constraints::getActive( ) 128 | { 129 | return &active; 130 | } 131 | 132 | 133 | /* 134 | * g e t I n a c t i v e 135 | */ 136 | inline Indexlist* Constraints::getInactive( ) 137 | { 138 | return &inactive; 139 | } 140 | 141 | 142 | /* 143 | * end of file 144 | */ 145 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/SRC/CyclingManager.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/CyclingManager.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Implementation of inlined member functions of the CyclingManager class 31 | * designed to detect and handle possible cycling during QP iterations. 32 | * 33 | */ 34 | 35 | 36 | /***************************************************************************** 37 | * P U B L I C * 38 | *****************************************************************************/ 39 | 40 | /* 41 | * i s C y c l i n g D e t e c t e d 42 | */ 43 | inline BooleanType CyclingManager::isCyclingDetected( ) const 44 | { 45 | return cyclingDetected; 46 | } 47 | 48 | 49 | /* 50 | * end of file 51 | */ 52 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/SRC/Indexlist.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/Indexlist.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Implementation of inlined member functions of the Indexlist class designed 31 | * to manage index lists of constraints and bounds within a QProblem_SubjectTo. 32 | */ 33 | 34 | 35 | 36 | /***************************************************************************** 37 | * P U B L I C * 38 | *****************************************************************************/ 39 | 40 | /* 41 | * g e t N u m b e r 42 | */ 43 | inline int Indexlist::getNumber( int physicalindex ) const 44 | { 45 | /* consistency check */ 46 | if ( ( physicalindex < 0 ) || ( physicalindex > length ) ) 47 | return -RET_INDEXLIST_OUTOFBOUNDS; 48 | 49 | return number[physicalindex]; 50 | } 51 | 52 | 53 | /* 54 | * g e t L e n g t h 55 | */ 56 | inline int Indexlist::getLength( ) 57 | { 58 | return length; 59 | } 60 | 61 | 62 | /* 63 | * g e t L a s t N u m b e r 64 | */ 65 | inline int Indexlist::getLastNumber( ) const 66 | { 67 | return number[last]; 68 | } 69 | 70 | 71 | /* 72 | * g e t L a s t N u m b e r 73 | */ 74 | inline BooleanType Indexlist::isMember( int _number ) const 75 | { 76 | if ( getIndex( _number ) >= 0 ) 77 | return BT_TRUE; 78 | else 79 | return BT_FALSE; 80 | } 81 | 82 | 83 | /* 84 | * end of file 85 | */ 86 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/SRC/MessageHandling.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/MessageHandling.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Implementation of inlined member functions of the MessageHandling class. 31 | */ 32 | 33 | 34 | 35 | /***************************************************************************** 36 | * P U B L I C * 37 | *****************************************************************************/ 38 | 39 | /* 40 | * g e t E r r o r V i s i b i l i t y S t a t u s 41 | */ 42 | inline VisibilityStatus MessageHandling::getErrorVisibilityStatus( ) const 43 | { 44 | return errorVisibility; 45 | } 46 | 47 | 48 | /* 49 | * g e t W a r n i n g V i s i b i l i t y S t a t u s 50 | */ 51 | inline VisibilityStatus MessageHandling::getWarningVisibilityStatus( ) const 52 | { 53 | return warningVisibility; 54 | } 55 | 56 | 57 | /* 58 | * g e t I n f o V i s i b i l i t y S t a t u s 59 | */ 60 | inline VisibilityStatus MessageHandling::getInfoVisibilityStatus( ) const 61 | { 62 | return infoVisibility; 63 | } 64 | 65 | 66 | /* 67 | * g e t O u t p u t F i l e 68 | */ 69 | inline myFILE* MessageHandling::getOutputFile( ) const 70 | { 71 | return outputFile; 72 | } 73 | 74 | 75 | /* 76 | * g e t E r r o r C o u n t 77 | */ 78 | inline int MessageHandling::getErrorCount( ) const 79 | { 80 | return errorCount; 81 | } 82 | 83 | 84 | /* 85 | * s e t E r r o r V i s i b i l i t y S t a t u s 86 | */ 87 | inline void MessageHandling::setErrorVisibilityStatus( VisibilityStatus _errorVisibility ) 88 | { 89 | errorVisibility = _errorVisibility; 90 | } 91 | 92 | 93 | /* 94 | * s e t W a r n i n g V i s i b i l i t y S t a t u s 95 | */ 96 | inline void MessageHandling::setWarningVisibilityStatus( VisibilityStatus _warningVisibility ) 97 | { 98 | warningVisibility = _warningVisibility; 99 | } 100 | 101 | 102 | /* 103 | * s e t I n f o V i s i b i l i t y S t a t u s 104 | */ 105 | inline void MessageHandling::setInfoVisibilityStatus( VisibilityStatus _infoVisibility ) 106 | { 107 | infoVisibility = _infoVisibility; 108 | } 109 | 110 | 111 | /* 112 | * s e t O u t p u t F i l e 113 | */ 114 | inline void MessageHandling::setOutputFile( myFILE* _outputFile ) 115 | { 116 | outputFile = _outputFile; 117 | } 118 | 119 | 120 | /* 121 | * s e t E r r o r C o u n t 122 | */ 123 | inline returnValue MessageHandling::setErrorCount( int _errorCount ) 124 | { 125 | if ( _errorCount >= 0 ) 126 | { 127 | errorCount = _errorCount; 128 | return SUCCESSFUL_RETURN; 129 | } 130 | else 131 | return RET_INVALID_ARGUMENTS; 132 | } 133 | 134 | 135 | /* 136 | * end of file 137 | */ 138 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/SRC/SubjectTo.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/SubjectTo.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Implementation of the inlined member functions of the SubjectTo class 31 | * designed to manage working sets of constraints and bounds within a QProblem. 32 | */ 33 | 34 | 35 | /***************************************************************************** 36 | * P U B L I C * 37 | *****************************************************************************/ 38 | 39 | 40 | /* 41 | * g e t T y p e 42 | */ 43 | inline SubjectToType SubjectTo::getType( int i ) const 44 | { 45 | if ( ( i >= 0 ) && ( i < size ) ) 46 | return type[i]; 47 | else 48 | return ST_UNKNOWN; 49 | } 50 | 51 | 52 | /* 53 | * g e t S t a t u s 54 | */ 55 | inline SubjectToStatus SubjectTo::getStatus( int i ) const 56 | { 57 | if ( ( i >= 0 ) && ( i < size ) ) 58 | return status[i]; 59 | else 60 | return ST_UNDEFINED; 61 | } 62 | 63 | 64 | /* 65 | * s e t T y p e 66 | */ 67 | inline returnValue SubjectTo::setType( int i, SubjectToType value ) 68 | { 69 | if ( ( i >= 0 ) && ( i < size ) ) 70 | { 71 | type[i] = value; 72 | return SUCCESSFUL_RETURN; 73 | } 74 | else 75 | return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); 76 | } 77 | 78 | 79 | /* 80 | * s e t S t a t u s 81 | */ 82 | inline returnValue SubjectTo::setStatus( int i, SubjectToStatus value ) 83 | { 84 | if ( ( i >= 0 ) && ( i < size ) ) 85 | { 86 | status[i] = value; 87 | return SUCCESSFUL_RETURN; 88 | } 89 | else 90 | return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); 91 | } 92 | 93 | 94 | /* 95 | * s e t N o L o w e r 96 | */ 97 | inline void SubjectTo::setNoLower( BooleanType _status ) 98 | { 99 | noLower = _status; 100 | } 101 | 102 | 103 | /* 104 | * s e t N o U p p e r 105 | */ 106 | inline void SubjectTo::setNoUpper( BooleanType _status ) 107 | { 108 | noUpper = _status; 109 | } 110 | 111 | 112 | /* 113 | * i s N o L o w e r 114 | */ 115 | inline BooleanType SubjectTo::isNoLower( ) const 116 | { 117 | return noLower; 118 | } 119 | 120 | 121 | /* 122 | * i s N o L o w e r 123 | */ 124 | inline BooleanType SubjectTo::isNoUpper( ) const 125 | { 126 | return noUpper; 127 | } 128 | 129 | 130 | /* 131 | * end of file 132 | */ 133 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/SRC/Utils.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | 25 | /** 26 | * \file SRC/Utils.ipp 27 | * \author Hans Joachim Ferreau 28 | * \version 1.3embedded 29 | * \date 2007-2008 30 | * 31 | * Implementation of some inlined utilities for working with the different QProblem 32 | * classes. 33 | */ 34 | 35 | 36 | 37 | /* 38 | * g e t A b s 39 | */ 40 | inline real_t getAbs( real_t x ) 41 | { 42 | if ( x < 0.0 ) 43 | return -x; 44 | else 45 | return x; 46 | } 47 | 48 | 49 | /* 50 | * end of file 51 | */ 52 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases/VERSIONS.txt: -------------------------------------------------------------------------------- 1 | ## 2 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 3 | ## Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 4 | ## 5 | ## qpOASES is free software; you can redistribute it and/or 6 | ## modify it under the terms of the GNU Lesser General Public 7 | ## License as published by the Free Software Foundation; either 8 | ## version 2.1 of the License, or (at your option) any later version. 9 | ## 10 | ## qpOASES is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | ## Lesser General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Lesser General Public 16 | ## License along with qpOASES; if not, write to the Free Software 17 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | ## 19 | 20 | 21 | 22 | VERSION HISTORY 23 | =============== 24 | 25 | 1.3embedded (last updated on 30th April 2009): 26 | ----------------------------------------------------------------------- 27 | 28 | + Re-programming of internal memory management to avoid dynamic memory allocations 29 | + Most #ifdef directives removed 30 | + Almost all type definitions gathered within INCLUDE/Types.hpp 31 | + Irrelevant functionality removed (like the SQProblem class, functionality 32 | for loading data from files or the SCILAB interface) 33 | + Replacement of all doubles by real_t 34 | + Introduction of define "PC_DEBUG" for switching off all print functions 35 | + stdio.h was made optional, string.h is no longer needed 36 | + relative paths removed from #include directives 37 | + made auxiliary objects locally static within solveInitialQP() 38 | + Matlab interface fixed for single precision 39 | + New return value -2 from Legacy wrapper added to Matlab/Simulink interfaces 40 | + KKT optimality check moved into QProblem(B) class, SolutionAnalysis class removed 41 | 42 | 43 | 1.3 (released on 2nd June 2008, last updated on 19th June 2008): 44 | ----------------------------------------------------------------------- 45 | 46 | + Implementation of "initialised homotopy" concept 47 | + Addition of the SolutionAnalysis class 48 | + Utility functions for solving test problems in OQP format added 49 | + Flexibility of Matlab(R) interface enhanced 50 | + Major source code cleanup 51 | (Attention: a few class names and calling interfaces have changed!) 52 | 53 | 54 | 55 | 1.2 (released on 9th October 2007): 56 | ----------------------------------------------------------------------- 57 | 58 | + Special treatment of diagonal Hessians 59 | + Improved infeasibility detection 60 | + Further improved Matlab(R) interface 61 | + Extended Simulink(R) interface 62 | + scilab interface added 63 | + Code cleanup and several bugfixes 64 | 65 | 66 | 67 | 1.1 (released on 8th July 2007): 68 | -------------------------------- 69 | 70 | + Implementation of the QProblemB class 71 | + Basic implementation of the SQProblem class 72 | + Improved Matlab(R) interface 73 | + Enabling/Disabling of constraints introduced 74 | + Several bugfixes 75 | 76 | 77 | 78 | 1.0 (released on 17th April 2007): 79 | ---------------------------------- 80 | 81 | Initial release. 82 | 83 | 84 | 85 | ## 86 | ## end of file 87 | ## 88 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/AUTHORS: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | MAIN AUTHORS 26 | ============ 27 | 28 | qpOASES's core functionality and software design have been developed by the 29 | following main developers (in alphabetical order): 30 | 31 | Hans Joachim Ferreau 32 | Christian Kirches 33 | Andreas Potschka 34 | 35 | 36 | 37 | FURTHER AUTHORS 38 | =============== 39 | 40 | Moreover, the following developers have contributed code to qpOASES's 41 | third-party interfaces (in alphabetical order): 42 | 43 | Alexander Buchner 44 | Holger Diedam 45 | Manuel Kudruss 46 | Sebastian F. Walter 47 | 48 | 49 | 50 | CONTRIBUTORS 51 | ============ 52 | 53 | Finally, the following people have not contributed to the source code, 54 | but have helped making qpOASES even more useful by testing, reporting 55 | bugs or proposing algorithmic improvements (in alphabetical order): 56 | 57 | Eckhard Arnold 58 | Boris Houska 59 | D. Kwame Minde Kufoalor 60 | Aude Perrin 61 | Milan Vukov 62 | Thomas Wiese 63 | Leonard Wirsching 64 | 65 | 66 | 67 | SCIENTIFIC MENTORS 68 | ================== 69 | 70 | We also would like to thank two persons who had a major share in making 71 | qpOASES a success. Not by writing even a single line of code, but by 72 | establishing the idea of using a homotopy-based approach for high-speed 73 | QP solutions and by excellent scientific guidance during the development 74 | process: 75 | 76 | Hans Georg Bock 77 | Moritz Diehl 78 | 79 | 80 | 81 | All users are invited to further improve qpOASES by providing comments, 82 | code enhancements, bug reports, additional documentation or whatever you 83 | feel is missing. 84 | 85 | 86 | 87 | ## 88 | ## end of file 89 | ## 90 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/AUTHORS.txt: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | MAIN AUTHORS 26 | ============ 27 | 28 | qpOASES's core functionality and software design have been developed by the 29 | following main developers (in alphabetical order): 30 | 31 | Hans Joachim Ferreau 32 | Christian Kirches 33 | Andreas Potschka 34 | 35 | 36 | 37 | FURTHER AUTHORS 38 | =============== 39 | 40 | Moreover, the following developers have contributed code to qpOASES's 41 | third-party interfaces (in alphabetical order): 42 | 43 | Alexander Buchner 44 | Holger Diedam 45 | Manuel Kudruss 46 | Sebastian F. Walter 47 | 48 | 49 | 50 | CONTRIBUTORS 51 | ============ 52 | 53 | Finally, the following people have not contributed to the source code, 54 | but have helped making qpOASES even more useful by testing, reporting 55 | bugs or proposing algorithmic improvements (in alphabetical order): 56 | 57 | Eckhard Arnold 58 | Boris Houska 59 | D. Kwame Minde Kufoalor 60 | Aude Perrin 61 | Milan Vukov 62 | Thomas Wiese 63 | Leonard Wirsching 64 | 65 | 66 | 67 | SCIENTIFIC MENTORS 68 | ================== 69 | 70 | We also would like to thank two persons who had a major share in making 71 | qpOASES a success. Not by writing even a single line of code, but by 72 | establishing the idea of using a homotopy-based approach for high-speed 73 | QP solutions and by excellent scientific guidance during the development 74 | process: 75 | 76 | Hans Georg Bock 77 | Moritz Diehl 78 | 79 | 80 | 81 | All users are invited to further improve qpOASES by providing comments, 82 | code enhancements, bug reports, additional documentation or whatever you 83 | feel is missing. 84 | 85 | 86 | 87 | ## 88 | ## end of file 89 | ## 90 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/INSTALL: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | INSTALLATION UNDER LINUX 26 | ======================== 27 | 28 | 0. Obtain qpOASES_e 29 | 30 | 31 | 1. Compilation of the qpOASES_e library libqpOASES_e.a (or .so) and test examples: 32 | 33 | cd 34 | make 35 | 36 | The library libqpOASES_e.a (or .so) provides the complete functionality of the 37 | qpOASES_e software package. It can be used by, e.g., linking it against a main 38 | function from the examples folder. The make also compiles a couple of test 39 | examples; executables are stored within the directory /bin. 40 | 41 | 42 | 2. Running a simple test example: 43 | 44 | Among others, an executable called example1 should have been created; run 45 | it in order to test your installation: 46 | 47 | cd /bin 48 | ./example1 49 | 50 | If it terminates after successfully solving two QP problems, qpOASES_e has been 51 | successfully installed! 52 | 53 | 54 | 3. Optional, create source code documentation (using doxygen): 55 | 56 | cd /doc 57 | doxygen doxygen.config 58 | 59 | Afterwards, you can open the file /doc/html/index.html with 60 | your favorite browser in order to view qpOASES_e's source code documentation. 61 | 62 | 63 | NOTE: More detailed installation instructions, including information on how 64 | to run unit tests can be found in the qpOASES User's Manual located 65 | at /doc/manual.pdf! 66 | 67 | 68 | 69 | ## 70 | ## end of file 71 | ## 72 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/INSTALL.txt: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | INSTALLATION UNDER LINUX 26 | ======================== 27 | 28 | 0. Obtain qpOASES_e 29 | 30 | 31 | 1. Compilation of the qpOASES_e library libqpOASES_e.a (or .so) and test examples: 32 | 33 | cd 34 | make 35 | 36 | The library libqpOASES_e.a (or .so) provides the complete functionality of the 37 | qpOASES_e software package. It can be used by, e.g., linking it against a main 38 | function from the examples folder. The make also compiles a couple of test 39 | examples; executables are stored within the directory /bin. 40 | 41 | 42 | 2. Running a simple test example: 43 | 44 | Among others, an executable called example1 should have been created; run 45 | it in order to test your installation: 46 | 47 | cd /bin 48 | ./example1 49 | 50 | If it terminates after successfully solving two QP problems, qpOASES_e has been 51 | successfully installed! 52 | 53 | 54 | 3. Optional, create source code documentation (using doxygen): 55 | 56 | cd /doc 57 | doxygen doxygen.config 58 | 59 | Afterwards, you can open the file /doc/html/index.html with 60 | your favorite browser in order to view qpOASES_e's source code documentation. 61 | 62 | 63 | NOTE: More detailed installation instructions, including information on how 64 | to run unit tests can be found in the qpOASES User's Manual located 65 | at /doc/manual.pdf! 66 | 67 | 68 | 69 | ## 70 | ## end of file 71 | ## 72 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/Makefile: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | ## 26 | ## Filename: Makefile 27 | ## Author: Hans Joachim Ferreau 28 | ## Version: 3.1embedded 29 | ## Date: 2007-2015 30 | ## 31 | 32 | include make.mk 33 | 34 | ## 35 | ## targets 36 | ## 37 | 38 | 39 | all: src examples 40 | 41 | src: 42 | @cd $@; ${MAKE} -s 43 | 44 | examples: src 45 | @cd $@; ${MAKE} -s 46 | 47 | doc: 48 | @cd $@; ${MAKE} -s 49 | 50 | testing: src 51 | @cd testing/c; ${MAKE} -s 52 | 53 | clean: 54 | @cd src && ${MAKE} -s clean 55 | @cd examples && ${MAKE} -s clean 56 | @cd bin && ${RM} -f *.* *{EXE} 57 | @cd testing/c && ${MAKE} -s clean 58 | 59 | clobber: clean 60 | 61 | .PHONY : all src examples doc testing clean clobber 62 | 63 | 64 | ## 65 | ## end of file 66 | ## 67 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/README: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | IMPORTANT NOTE 26 | ============== 27 | 28 | This is an almost complete plain C, static memory translation of qpOASES (v3.1), 29 | called qpOASES_e (v3.1)! Please consult the additional notes in 30 | 31 | doc/additionalNotes.pdf 32 | 33 | before getting started. 34 | 35 | 36 | 37 | INTRODUCTION 38 | ============ 39 | 40 | qpOASES is an open-source C++ implementation of the recently proposed 41 | online active set strategy, which was inspired by important observations 42 | from the field of parametric quadratic programming (QP). It has several 43 | theoretical features that make it particularly suited for model predictive 44 | control (MPC) applications. Further numerical modifications have made 45 | qpOASES a reliable QP solver, even when tackling semi-definite, ill-posed or 46 | degenerated QP problems. Moreover, several interfaces to third-party software 47 | like Matlab or Simulink are provided that make qpOASES easy-to-use even for 48 | users without knowledge of C/C++. 49 | 50 | 51 | 52 | GETTING STARTED 53 | =============== 54 | 55 | 1. For installation, usage and additional information on this software package 56 | see the qpOASES User's Manual located at doc/manual.pdf or check its 57 | source code documentation! 58 | 59 | 60 | 2. The file LICENSE.txt contains a copy of the GNU Lesser General Public 61 | License (v2.1). Please read it carefully before using qpOASES! 62 | 63 | 64 | 65 | CONTACT THE AUTHORS 66 | =================== 67 | 68 | If you have got questions, remarks or comments on qpOASES, it is strongly 69 | encouraged to report them by creating a new ticket at the qpOASES webpage. 70 | In case you do not want to disclose your feedback to the public, you may 71 | send an e-mail to 72 | 73 | support@qpOASES.org 74 | 75 | Finally, you may contact one of the main authors directly: 76 | 77 | Hans Joachim Ferreau, joachim.ferreau@ch.abb.com 78 | Andreas Potschka, potschka@iwr.uni-heidelberg.de 79 | Christian Kirches, christian.kirches@iwr.uni-heidelberg.de 80 | 81 | Also bug reports, source code enhancements or success stories are most welcome! 82 | 83 | 84 | 85 | ## 86 | ## end of file 87 | ## 88 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/README.txt: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | IMPORTANT NOTE 26 | ============== 27 | 28 | This is an almost complete plain C, static memory translation of qpOASES (v3.1), 29 | called qpOASES_e (v3.1)! Please consult the additional notes in 30 | 31 | doc/additionalNotes.pdf 32 | 33 | before getting started. 34 | 35 | 36 | 37 | INTRODUCTION 38 | ============ 39 | 40 | qpOASES is an open-source C++ implementation of the recently proposed 41 | online active set strategy, which was inspired by important observations 42 | from the field of parametric quadratic programming (QP). It has several 43 | theoretical features that make it particularly suited for model predictive 44 | control (MPC) applications. Further numerical modifications have made 45 | qpOASES a reliable QP solver, even when tackling semi-definite, ill-posed or 46 | degenerated QP problems. Moreover, several interfaces to third-party software 47 | like Matlab or Simulink are provided that make qpOASES easy-to-use even for 48 | users without knowledge of C/C++. 49 | 50 | 51 | 52 | GETTING STARTED 53 | =============== 54 | 55 | 1. For installation, usage and additional information on this software package 56 | see the qpOASES User's Manual located at doc/manual.pdf or check its 57 | source code documentation! 58 | 59 | 60 | 2. The file LICENSE.txt contains a copy of the GNU Lesser General Public 61 | License (v2.1). Please read it carefully before using qpOASES! 62 | 63 | 64 | 65 | CONTACT THE AUTHORS 66 | =================== 67 | 68 | If you have got questions, remarks or comments on qpOASES, it is strongly 69 | encouraged to report them by creating a new ticket at the qpOASES webpage. 70 | In case you do not want to disclose your feedback to the public, you may 71 | send an e-mail to 72 | 73 | support@qpOASES.org 74 | 75 | Finally, you may contact one of the main authors directly: 76 | 77 | Hans Joachim Ferreau, joachim.ferreau@ch.abb.com 78 | Andreas Potschka, potschka@iwr.uni-heidelberg.de 79 | Christian Kirches, christian.kirches@iwr.uni-heidelberg.de 80 | 81 | Also bug reports, source code enhancements or success stories are most welcome! 82 | 83 | 84 | 85 | ## 86 | ## end of file 87 | ## 88 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/VERSIONS: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | VERSION HISTORY OF ORIGINAL C++ VERSION 26 | ======================================= 27 | 28 | 29 | 3.1 (released on 11th February 2015): 30 | ------------------------------------- 31 | 32 | + Addition of C interface 33 | + Further improved Matlab, Simulink, octave and Python interfaces 34 | + Possibility to provide pre-computed Cholesky factor of Hessian matrix 35 | + Source code clean-up and bugfixes 36 | 37 | 38 | 3.0 (released on 29th July 2014, last updated on 17th December 2014): 39 | --------------------------------------------------------------------- 40 | 41 | + Addition of unit testing 42 | + Several bugfixes 43 | 44 | 45 | 3.0beta (released on 16th August 2011, last updated on 4th April 2014): 46 | ----------------------------------------------------------------------- 47 | 48 | + Improved ratio tests and termination check for increased reliabilty 49 | + Introduction of iterative refinement in step determination and 50 | drift correction to handle ill-conditioned QPs 51 | + Introduction of ramping strategy to handle degenerated QPs 52 | + Addition of far bounds and flipping bounds strategy to handle 53 | semi-definite and unbounded QPs more reliably 54 | + Limited support of sparse QP matrices (also in Matlab interface) 55 | + Optional linking of LAPACK/BLAS for linear algebra operations 56 | + Addition of a number of algorithmic options, summarised in an option struct 57 | + Improved Matlab interface 58 | + Python interface added 59 | + Several bugfixes 60 | 61 | 62 | 2.0 (released on 10th February 2009, last updated on 7th December 2009): 63 | ------------------------------------------------------------------------ 64 | 65 | + Implementation of regularisation scheme for treating QPs with 66 | semi-definite Hessians 67 | + Addition of convenience functionality for Bounds and Constraints 68 | objects for specifying guessed active sets 69 | + Allows to specify a CPU time in addition to an iteration limit 70 | + Improved efficiency for QPs comprising many constraints 71 | + Source code cleanup and bugfixing 72 | 73 | 74 | 1.3 (released on 2nd June 2008, last updated on 13th August 2008): 75 | ------------------------------------------------------------------ 76 | 77 | + Implementation of "initialised homotopy" concept 78 | + Addition of the SolutionAnalysis class 79 | + Utility functions for solving test problems in OQP format added 80 | + Flexibility of Matlab(R) interface enhanced 81 | + Major source code cleanup 82 | (Attention: a few class names and calling interfaces have changed!) 83 | 84 | 85 | 1.2 (released on 9th October 2007): 86 | ----------------------------------- 87 | 88 | + Special treatment of diagonal Hessians 89 | + Improved infeasibility detection 90 | + Further improved Matlab(R) interface 91 | + Extended Simulink(R) interface 92 | + scilab interface added 93 | + Code cleanup and several bugfixes 94 | 95 | 96 | 1.1 (released on 8th July 2007): 97 | -------------------------------- 98 | 99 | + Implementation of the QProblemB class 100 | + Basic implementation of the SQProblem class 101 | + Improved Matlab(R) interface 102 | + Enabling/Disabling of constraints introduced 103 | + Several bugfixes 104 | 105 | 106 | 1.0 (released on 17th April 2007): 107 | ---------------------------------- 108 | 109 | Initial release. 110 | 111 | 112 | 113 | ## 114 | ## end of file 115 | ## 116 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/VERSIONS.txt: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | VERSION HISTORY OF ORIGINAL C++ VERSION 26 | ======================================= 27 | 28 | 29 | 3.1 (released on 11th February 2015): 30 | ------------------------------------- 31 | 32 | + Addition of C interface 33 | + Further improved Matlab, Simulink, octave and Python interfaces 34 | + Possibility to provide pre-computed Cholesky factor of Hessian matrix 35 | + Source code clean-up and bugfixes 36 | 37 | 38 | 3.0 (released on 29th July 2014, last updated on 17th December 2014): 39 | --------------------------------------------------------------------- 40 | 41 | + Addition of unit testing 42 | + Several bugfixes 43 | 44 | 45 | 3.0beta (released on 16th August 2011, last updated on 4th April 2014): 46 | ----------------------------------------------------------------------- 47 | 48 | + Improved ratio tests and termination check for increased reliabilty 49 | + Introduction of iterative refinement in step determination and 50 | drift correction to handle ill-conditioned QPs 51 | + Introduction of ramping strategy to handle degenerated QPs 52 | + Addition of far bounds and flipping bounds strategy to handle 53 | semi-definite and unbounded QPs more reliably 54 | + Limited support of sparse QP matrices (also in Matlab interface) 55 | + Optional linking of LAPACK/BLAS for linear algebra operations 56 | + Addition of a number of algorithmic options, summarised in an option struct 57 | + Improved Matlab interface 58 | + Python interface added 59 | + Several bugfixes 60 | 61 | 62 | 2.0 (released on 10th February 2009, last updated on 7th December 2009): 63 | ------------------------------------------------------------------------ 64 | 65 | + Implementation of regularisation scheme for treating QPs with 66 | semi-definite Hessians 67 | + Addition of convenience functionality for Bounds and Constraints 68 | objects for specifying guessed active sets 69 | + Allows to specify a CPU time in addition to an iteration limit 70 | + Improved efficiency for QPs comprising many constraints 71 | + Source code cleanup and bugfixing 72 | 73 | 74 | 1.3 (released on 2nd June 2008, last updated on 13th August 2008): 75 | ------------------------------------------------------------------ 76 | 77 | + Implementation of "initialised homotopy" concept 78 | + Addition of the SolutionAnalysis class 79 | + Utility functions for solving test problems in OQP format added 80 | + Flexibility of Matlab(R) interface enhanced 81 | + Major source code cleanup 82 | (Attention: a few class names and calling interfaces have changed!) 83 | 84 | 85 | 1.2 (released on 9th October 2007): 86 | ----------------------------------- 87 | 88 | + Special treatment of diagonal Hessians 89 | + Improved infeasibility detection 90 | + Further improved Matlab(R) interface 91 | + Extended Simulink(R) interface 92 | + scilab interface added 93 | + Code cleanup and several bugfixes 94 | 95 | 96 | 1.1 (released on 8th July 2007): 97 | -------------------------------- 98 | 99 | + Implementation of the QProblemB class 100 | + Basic implementation of the SQProblem class 101 | + Improved Matlab(R) interface 102 | + Enabling/Disabling of constraints introduced 103 | + Several bugfixes 104 | 105 | 106 | 1.0 (released on 17th April 2007): 107 | ---------------------------------- 108 | 109 | Initial release. 110 | 111 | 112 | 113 | ## 114 | ## end of file 115 | ## 116 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/bin/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/quadcopter/acado/export_MPC/qpoases3/bin/empty.txt -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/doc/Makefile: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | ## 26 | ## Filename: doc/Makefile 27 | ## Author: Hans Joachim Ferreau 28 | ## Version: 3.1embedded 29 | ## Date: 2007-2015 30 | ## 31 | 32 | 33 | 34 | ## 35 | ## settings 36 | ## 37 | 38 | MAKEPDF = pdflatex 39 | LATEX = latex 40 | 41 | 42 | ## 43 | ## targets 44 | ## 45 | 46 | all: doc 47 | 48 | 49 | .PHONY: doc 50 | doc: 51 | @ echo "Creating doxygen documentation " 52 | @ doxygen doxygen.config 53 | 54 | 55 | .PHONY: clean 56 | clean: 57 | @ ${RM} -rf ./html 58 | 59 | 60 | .PHONY: clobber 61 | clobber: clean 62 | 63 | 64 | ## 65 | ## end of file 66 | ## 67 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/examples/Makefile: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | ## 26 | ## Filename: examples/Makefile 27 | ## Author: Hans Joachim Ferreau 28 | ## Version: 3.1embedded 29 | ## Date: 2007-2015 30 | ## 31 | 32 | include ../make.mk 33 | 34 | ## 35 | ## flags 36 | ## 37 | 38 | IFLAGS = -I. \ 39 | -I${IDIR} 40 | 41 | QPOASES_EXES = \ 42 | ${BINDIR}/example1${EXE} \ 43 | ${BINDIR}/example1b${EXE} \ 44 | ${BINDIR}/example3${EXE} \ 45 | ${BINDIR}/exampleLP${EXE} 46 | 47 | 48 | 49 | ## 50 | ## targets 51 | ## 52 | 53 | all: ${QPOASES_EXES} 54 | 55 | ${BINDIR}/%${EXE}: %.${OBJEXT} ${LINK_DEPENDS} 56 | @${ECHO} "Creating" $@ 57 | @${CC} ${DEF_TARGET} ${CFLAGS} $< ${QPOASES_LINK} ${LINK_LIBRARIES} 58 | 59 | clean: 60 | @${ECHO} "Cleaning up (examples)" 61 | @${RM} -f *.${OBJEXT} ${QPOASES_EXES} 62 | 63 | clobber: clean 64 | 65 | 66 | ${LINK_DEPENDS}: 67 | @cd ..; ${MAKE} -s src 68 | 69 | %.${OBJEXT}: %.c 70 | @${ECHO} "Creating" $@ 71 | @${CC} ${DEF_TARGET} -c ${IFLAGS} ${CFLAGS} $< 72 | 73 | 74 | ## 75 | ## end of file 76 | ## 77 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/examples/example1.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * \file examples/example1.c 27 | * \author Hans Joachim Ferreau 28 | * \version 3.1embedded 29 | * \date 2007-2015 30 | * 31 | * Very simple example for testing qpOASES (using QProblem class). 32 | */ 33 | 34 | 35 | #include 36 | 37 | 38 | /** Example for qpOASES main function using the QProblem class. */ 39 | int main( ) 40 | { 41 | USING_NAMESPACE_QPOASES 42 | 43 | /* Setup data of first QP. */ 44 | real_t H[2*2] = { 1.0, 0.0, 0.0, 0.5 }; 45 | real_t A[1*2] = { 1.0, 1.0 }; 46 | real_t g[2] = { 1.5, 1.0 }; 47 | real_t lb[2] = { 0.5, -2.0 }; 48 | real_t ub[2] = { 5.0, 2.0 }; 49 | real_t lbA[1] = { -1.0 }; 50 | real_t ubA[1] = { 2.0 }; 51 | 52 | /* Setup data of second QP. */ 53 | real_t g_new[2] = { 1.0, 1.5 }; 54 | real_t lb_new[2] = { 0.0, -1.0 }; 55 | real_t ub_new[2] = { 5.0, -0.5 }; 56 | real_t lbA_new[1] = { -2.0 }; 57 | real_t ubA_new[1] = { 1.0 }; 58 | 59 | 60 | /* Setting up QProblem object. */ 61 | static Options options; 62 | static QProblem example; 63 | 64 | int nWSR; 65 | real_t xOpt[2]; 66 | real_t yOpt[2+1]; 67 | 68 | QProblemCON( &example,2,1,HST_UNKNOWN ); 69 | Options_setToDefault( &options ); 70 | QProblem_setOptions( &example,options ); 71 | 72 | /* Solve first QP. */ 73 | nWSR = 10; 74 | QProblem_init( &example,H,g,A,lb,ub,lbA,ubA, &nWSR,0 ); 75 | 76 | /* Get and print solution of first QP. */ 77 | QProblem_getPrimalSolution( &example,xOpt ); 78 | QProblem_getDualSolution( &example,yOpt ); 79 | printf( "\nxOpt = [ %e, %e ]; yOpt = [ %e, %e, %e ]; objVal = %e\n\n", 80 | xOpt[0],xOpt[1],yOpt[0],yOpt[1],yOpt[2], QProblem_getObjVal( &example ) ); 81 | 82 | /* Solve second QP. */ 83 | nWSR = 10; 84 | QProblem_hotstart( &example,g_new,lb_new,ub_new,lbA_new,ubA_new, &nWSR,0 ); 85 | 86 | /* Get and print solution of second QP. */ 87 | QProblem_getPrimalSolution( &example,xOpt ); 88 | QProblem_getDualSolution( &example,yOpt ); 89 | printf( "\nxOpt = [ %e, %e ]; yOpt = [ %e, %e, %e ]; objVal = %e\n\n", 90 | xOpt[0],xOpt[1],yOpt[0],yOpt[1],yOpt[2], QProblem_getObjVal( &example ) ); 91 | 92 | QProblem_printOptions( &example ); 93 | /*QProblem_printProperties( &example );*/ 94 | 95 | return 0; 96 | } 97 | 98 | 99 | /* 100 | * end of file 101 | */ 102 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/examples/example1b.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * \file examples/example1b.c 27 | * \author Hans Joachim Ferreau 28 | * \version 3.1embedded 29 | * \date 2007-2015 30 | * 31 | * Very simple example for testing qpOASES using the QProblemB class. 32 | */ 33 | 34 | 35 | #include 36 | 37 | 38 | /** Example for qpOASES main function using the QProblemB class. */ 39 | int main( ) 40 | { 41 | USING_NAMESPACE_QPOASES 42 | 43 | /* Setup data of first QP. */ 44 | real_t H[2*2] = { 1.0, 0.0, 0.0, 0.5 }; 45 | real_t g[2] = { 1.5, 1.0 }; 46 | real_t lb[2] = { 0.5, -2.0 }; 47 | real_t ub[2] = { 5.0, 2.0 }; 48 | 49 | /* Setup data of second QP. */ 50 | real_t g_new[2] = { 1.0, 1.5 }; 51 | real_t lb_new[2] = { 0.0, -1.0 }; 52 | real_t ub_new[2] = { 5.0, -0.5 }; 53 | 54 | 55 | /* Setting up QProblemB object. */ 56 | static QProblemB example; 57 | static Options options; 58 | 59 | int nWSR = 10; 60 | real_t xOpt[2]; 61 | 62 | QProblemBCON( &example,2,HST_UNKNOWN ); 63 | Options_setToDefault( &options ); 64 | /* options.enableFlippingBounds = BT_FALSE; */ 65 | options.initialStatusBounds = ST_INACTIVE; 66 | options.numRefinementSteps = 1; 67 | /* options.enableCholeskyRefactorisation = 1; */ 68 | QProblemB_setOptions( &example,options ); 69 | 70 | 71 | /* Solve first QP. */ 72 | nWSR = 10; 73 | QProblemB_init( &example,H,g,lb,ub, &nWSR,0 ); 74 | 75 | /* Get and print solution of second QP. */ 76 | QProblemB_getPrimalSolution( &example,xOpt ); 77 | printf( "\nxOpt = [ %e, %e ]; objVal = %e\n\n", xOpt[0],xOpt[1],QProblemB_getObjVal(&example) ); 78 | 79 | /* Solve second QP. */ 80 | nWSR = 10; 81 | QProblemB_hotstart( &example,g_new,lb_new,ub_new, &nWSR,0 ); 82 | 83 | /* Get and print solution of second QP. */ 84 | QProblemB_getPrimalSolution( &example,xOpt ); 85 | printf( "\nxOpt = [ %e, %e ]; objVal = %e\n\n", xOpt[0],xOpt[1],QProblemB_getObjVal(&example) ); 86 | 87 | return 0; 88 | } 89 | 90 | 91 | /* 92 | * end of file 93 | */ 94 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/examples/example3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * \file examples/example3.c 27 | * \author Hans Joachim Ferreau 28 | * \version 3.1embedded 29 | * \date 2008-2015 30 | * 31 | * Example demonstrating usage of qpOASES for solving a QP sequence of the 32 | * Online QP Benchmark Collection. In order to run it, you have to download 33 | * "Example 02" from from http://www.qpOASES.org/onlineQP/ and store it into 34 | * the directory bin/chain80w/. 35 | */ 36 | 37 | 38 | 39 | #include 40 | 41 | 42 | /** Example for qpOASES main function using the OQP interface. */ 43 | int main( ) 44 | { 45 | USING_NAMESPACE_QPOASES 46 | 47 | /* 1) Define benchmark arguments. */ 48 | BooleanType isSparse = BT_FALSE; 49 | BooleanType useHotstarts = BT_TRUE; 50 | 51 | int maxAllowedNWSR = 600; 52 | real_t maxNWSR, avgNWSR, maxCPUtime, avgCPUtime; 53 | real_t maxStationarity, maxFeasibility, maxComplementarity; 54 | 55 | static Options options; 56 | Options_setToMPC( &options ); 57 | options.printLevel = PL_LOW; 58 | 59 | /* 2) Run benchmark. */ 60 | if ( runOQPbenchmark( "./chain80w/", 61 | isSparse,useHotstarts, 62 | &options,maxAllowedNWSR, 63 | &maxNWSR,&avgNWSR,&maxCPUtime,&avgCPUtime, 64 | &maxStationarity,&maxFeasibility,&maxComplementarity 65 | ) != SUCCESSFUL_RETURN ) 66 | { 67 | qpOASES_myPrintf( "In order to run this example, you need to download example no. 02\nfrom the Online QP Benchmark Collection website first!\n" ); 68 | fprintf( stderr,"error\n" ); 69 | return -1; 70 | } 71 | 72 | /* 3) Print results. */ 73 | fprintf( stderr,"\n\n" ); 74 | fprintf( stderr,"OQP Benchmark Results:\n" ); 75 | fprintf( stderr,"======================\n\n" ); 76 | fprintf( stderr,"maximum stationary error: %.3e\n",maxStationarity ); 77 | fprintf( stderr,"maximum feasibility error: %.3e\n",maxFeasibility ); 78 | fprintf( stderr,"maximum complementary error: %.3e\n",maxComplementarity ); 79 | fprintf( stderr,"\n" ); 80 | fprintf( stderr,"maximum CPU time: %.3f milliseconds\n\n",1000.0*maxCPUtime ); 81 | 82 | return 0; 83 | } 84 | 85 | 86 | /* 87 | * end of file 88 | */ 89 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/examples/exampleLP.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * \file examples/exampleLP.c 27 | * \author Hans Joachim Ferreau 28 | * \version 3.1embedded 29 | * \date 2008-2015 30 | * 31 | * Very simple example for solving a LP sequence using qpOASES. 32 | */ 33 | 34 | 35 | #include 36 | 37 | 38 | /** Example for qpOASES main function solving LPs. */ 39 | int main( ) 40 | { 41 | USING_NAMESPACE_QPOASES 42 | 43 | /* Setup data of first LP. */ 44 | real_t A[1*2] = { 1.0, 1.0 }; 45 | real_t g[2] = { 1.5, 1.0 }; 46 | real_t lb[2] = { 0.5, -2.0 }; 47 | real_t ub[2] = { 5.0, 2.0 }; 48 | real_t lbA[1] = { -1.0 }; 49 | real_t ubA[1] = { 2.0 }; 50 | 51 | /* Setup data of second LP. */ 52 | real_t g_new[2] = { 1.0, 1.5 }; 53 | real_t lb_new[2] = { 0.0, -1.0 }; 54 | real_t ub_new[2] = { 5.0, -0.5 }; 55 | real_t lbA_new[1] = { -2.0 }; 56 | real_t ubA_new[1] = { 1.0 }; 57 | 58 | 59 | /* Setting up QProblem object with zero Hessian matrix. */ 60 | static QProblem example; 61 | static Options options; 62 | 63 | int nWSR; 64 | real_t xOpt[2]; 65 | 66 | QProblemCON( &example,2,1,HST_ZERO ); 67 | Options_setToDefault( &options ); 68 | QProblem_setOptions( &example,options ); 69 | 70 | /* Solve first LP. */ 71 | nWSR = 10; 72 | QProblem_init( &example, 0,g,A,lb,ub,lbA,ubA, &nWSR,0 ); 73 | 74 | /* Solve second LP. */ 75 | nWSR = 10; 76 | QProblem_hotstart( &example,g_new,lb_new,ub_new,lbA_new,ubA_new, &nWSR,0 ); 77 | 78 | /* Get and print solution of second LP. */ 79 | QProblem_getPrimalSolution( &example,xOpt ); 80 | printf( "\nxOpt = [ %e, %e ]; objVal = %e\n\n", xOpt[0],xOpt[1],QProblem_getObjVal(&example) ); 81 | 82 | return 0; 83 | } 84 | 85 | 86 | /* 87 | * end of file 88 | */ 89 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/include/qpOASES_e.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * \file include/qpOASES_e.h 27 | * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches 28 | * \version 3.1embedded 29 | * \date 2007-2015 30 | */ 31 | 32 | 33 | #if defined(__SINGLE_OBJECT__) 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | /*#if (QPOASES_NCMAX == 0)*/ 45 | #include 46 | /*#else*/ 47 | #include 48 | /*#endif*/ 49 | 50 | /*#include */ 51 | 52 | #else 53 | 54 | /*#if (QPOASES_NCMAX == 0)*/ 55 | #include 56 | /*#else*/ 57 | #include 58 | /*#endif*/ 59 | 60 | #include 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/include/qpOASES_e/Constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * \file include/qpOASES_e/Constants.h 27 | * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches 28 | * \version 3.1embedded 29 | * \date 2007-2015 30 | * 31 | * Definition of all global constants. 32 | */ 33 | 34 | 35 | #ifndef QPOASES_CONSTANTS_H 36 | #define QPOASES_CONSTANTS_H 37 | 38 | 39 | #include 40 | 41 | #ifdef __CODE_GENERATION__ 42 | 43 | #define CONVERTTOSTRINGAUX(x) #x 44 | #define CONVERTTOSTRING(x) CONVERTTOSTRINGAUX(x) 45 | 46 | #ifndef QPOASES_CUSTOM_INTERFACE 47 | #include "acado_qpoases3_interface.h" 48 | #else 49 | #include CONVERTTOSTRING(QPOASES_CUSTOM_INTERFACE) 50 | #endif 51 | 52 | #endif 53 | 54 | 55 | BEGIN_NAMESPACE_QPOASES 56 | 57 | 58 | #ifndef __EXTERNAL_DIMENSIONS__ 59 | 60 | #define QPOASES_NVMAX 50 61 | #define QPOASES_NCMAX 100 62 | /*#define QPOASES_NVMAX 287 63 | #define QPOASES_NCMAX 709*/ 64 | 65 | #endif /* __EXTERNAL_DIMENSIONS__ */ 66 | 67 | 68 | /** Maximum number of variables within a QP formulation. 69 | * Note: this value has to be positive! */ 70 | #define NVMAX QPOASES_NVMAX 71 | 72 | /** Maximum number of constraints within a QP formulation. 73 | * Note: this value has to be positive! */ 74 | #define NCMAX QPOASES_NCMAX 75 | 76 | #if ( QPOASES_NVMAX > QPOASES_NCMAX ) 77 | #define NVCMAX QPOASES_NVMAX 78 | #else 79 | #define NVCMAX QPOASES_NCMAX 80 | #endif 81 | 82 | #if ( QPOASES_NVMAX > QPOASES_NCMAX ) 83 | #define NVCMIN QPOASES_NCMAX 84 | #else 85 | #define NVCMIN QPOASES_NVMAX 86 | #endif 87 | 88 | 89 | /** Maximum number of QPs in a sequence solved by means of the OQP interface. 90 | * Note: this value has to be positive! */ 91 | #define NQPMAX 1000 92 | 93 | 94 | /** Numerical value of machine precision (min eps, s.t. 1+eps > 1). 95 | * Note: this value has to be positive! */ 96 | #ifndef __CODE_GENERATION__ 97 | 98 | #ifdef __USE_SINGLE_PRECISION__ 99 | static const real_t QPOASES_EPS = 1.193e-07; 100 | #else 101 | static const real_t QPOASES_EPS = 2.221e-16; 102 | #endif /* __USE_SINGLE_PRECISION__ */ 103 | 104 | #endif /* __CODE_GENERATION__ */ 105 | 106 | 107 | /** Numerical value of zero (for situations in which it would be 108 | * unreasonable to compare with 0.0). 109 | * Note: this value has to be positive! */ 110 | static const real_t QPOASES_ZERO = 1.0e-25; 111 | 112 | /** Numerical value of infinity (e.g. for non-existing bounds). 113 | * Note: this value has to be positive! */ 114 | static const real_t QPOASES_INFTY = 1.0e20; 115 | 116 | /** Tolerance to used for isEqual, isZero etc. 117 | * Note: this value has to be positive! */ 118 | static const real_t QPOASES_TOL = 1.0e-25; 119 | 120 | 121 | /** Maximum number of characters within a string. 122 | * Note: this value should be at least 41! */ 123 | #define QPOASES_MAX_STRING_LENGTH 160 124 | 125 | 126 | END_NAMESPACE_QPOASES 127 | 128 | 129 | #endif /* QPOASES_CONSTANTS_H */ 130 | 131 | 132 | /* 133 | * end of file 134 | */ 135 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/include/qpOASES_e/ConstraintProduct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * \file include/qpOASES_e/ConstraintProduct.h 27 | * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches (thanks to D. Kwame Minde Kufoalor) 28 | * \version 3.1embedded 29 | * \date 2009-2015 30 | * 31 | * Declaration of the ConstraintProduct interface which allows to specify a 32 | * user-defined function for evaluating the constraint product at the 33 | * current iterate to speed-up QP solution in case of a specially structured 34 | * constraint matrix. 35 | */ 36 | 37 | 38 | 39 | #ifndef QPOASES_CONSTRAINT_PRODUCT_H 40 | #define QPOASES_CONSTRAINT_PRODUCT_H 41 | 42 | 43 | BEGIN_NAMESPACE_QPOASES 44 | 45 | 46 | /** 47 | * \brief Interface for specifying user-defined evaluations of constraint products. 48 | * 49 | * An interface which allows to specify a user-defined function for evaluating the 50 | * constraint product at the current iterate to speed-up QP solution in case 51 | * of a specially structured constraint matrix. 52 | * 53 | * \author Hans Joachim Ferreau (thanks to Kwame Minde Kufoalor) 54 | * \version 3.1embedded 55 | * \date 2009-2015 56 | */ 57 | typedef int(*ConstraintProduct)( int, const real_t* const, real_t* const ); 58 | 59 | 60 | END_NAMESPACE_QPOASES 61 | 62 | #endif /* QPOASES_CONSTRAINT_PRODUCT_H */ 63 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/include/qpOASES_e/Flipper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * \file include/qpOASES_e/Flipper.h 27 | * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches 28 | * \version 3.1embedded 29 | * \date 2007-2015 30 | * 31 | * Declaration of the Options class designed to manage user-specified 32 | * options for solving a QProblem. 33 | */ 34 | 35 | 36 | #ifndef QPOASES_FLIPPER_H 37 | #define QPOASES_FLIPPER_H 38 | 39 | 40 | #include 41 | #include 42 | 43 | 44 | BEGIN_NAMESPACE_QPOASES 45 | 46 | 47 | /** 48 | * \brief Auxiliary class for storing a copy of the current matrix factorisations. 49 | * 50 | * This auxiliary class stores a copy of the current matrix factorisations. It 51 | * is used by the classe QProblemB and QProblem in case flipping bounds are enabled. 52 | * 53 | * \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches 54 | * \version 3.1embedded 55 | * \date 2007-2015 56 | */ 57 | typedef struct 58 | { 59 | unsigned int nV; /**< Number of variables. */ 60 | unsigned int nC; /**< Number of constraints. */ 61 | 62 | Bounds bounds; /**< Data structure for problem's bounds. */ 63 | Constraints constraints; /**< Data structure for problem's constraints. */ 64 | 65 | real_t R[NVMAX*NVMAX]; /**< Cholesky factor of H (i.e. H = R^T*R). */ 66 | real_t Q[NVMAX*NVMAX]; /**< Orthonormal quadratic matrix, A = [0 T]*Q'. */ 67 | real_t T[NVCMIN*NVCMIN]; /**< Reverse triangular matrix, A = [0 T]*Q'. */ 68 | } Flipper; 69 | 70 | 71 | /** Constructor which takes the number of bounds and constraints. */ 72 | void FlipperCON( Flipper* _THIS, 73 | unsigned int _nV, /**< Number of bounds. */ 74 | unsigned int _nC /**< Number of constraints. */ 75 | ); 76 | 77 | /** Copy constructor (deep copy). */ 78 | void FlipperCPY( Flipper* FROM, 79 | Flipper* TO 80 | ); 81 | 82 | /** Initialises object with given number of bounds and constraints. 83 | * \return SUCCESSFUL_RETURN \n 84 | RET_INVALID_ARGUMENTS */ 85 | returnValue Flipper_init( Flipper* _THIS, 86 | unsigned int _nV, /**< Number of bounds. */ 87 | unsigned int _nC /**< Number of constraints. */ 88 | ); 89 | 90 | 91 | /** Copies current values to non-null arguments (assumed to be allocated with consistent size). 92 | * \return SUCCESSFUL_RETURN */ 93 | returnValue Flipper_get( Flipper* _THIS, 94 | Bounds* const _bounds, /**< Pointer to new bounds. */ 95 | real_t* const R, /**< New matrix R. */ 96 | Constraints* const _constraints, /**< Pointer to new constraints. */ 97 | real_t* const _Q, /**< New matrix Q. */ 98 | real_t* const _T /**< New matrix T. */ 99 | ); 100 | 101 | /** Assigns new values to non-null arguments. 102 | * \return SUCCESSFUL_RETURN */ 103 | returnValue Flipper_set( Flipper* _THIS, 104 | const Bounds* const _bounds, /**< Pointer to new bounds. */ 105 | const real_t* const _R, /**< New matrix R. */ 106 | const Constraints* const _constraints, /**< Pointer to new constraints. */ 107 | const real_t* const _Q, /**< New matrix Q. */ 108 | const real_t* const _T /**< New matrix T. */ 109 | ); 110 | 111 | /** Returns dimension of matrix T. 112 | * \return Dimension of matrix T. */ 113 | unsigned int Flipper_getDimT( Flipper* _THIS ); 114 | 115 | 116 | END_NAMESPACE_QPOASES 117 | 118 | 119 | #endif /* QPOASES_FLIPPER_H */ 120 | 121 | 122 | /* 123 | * end of file 124 | */ 125 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/include/qpOASES_e/UnitTesting.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * \file include/qpOASES_e/UnitTesting.h 27 | * \author Hans Joachim Ferreau 28 | * \version 3.1embedded 29 | * \date 2014-2015 30 | * 31 | * Definition of auxiliary functions/macros for unit testing. 32 | */ 33 | 34 | 35 | #ifndef QPOASES_UNIT_TESTING_H 36 | #define QPOASES_UNIT_TESTING_H 37 | 38 | 39 | #ifndef TEST_TOL_FACTOR 40 | #define TEST_TOL_FACTOR 1 41 | #endif 42 | 43 | 44 | /** Return value for tests that passed. */ 45 | #define TEST_PASSED 0 46 | 47 | /** Return value for tests that failed. */ 48 | #define TEST_FAILED 1 49 | 50 | /** Return value for tests that could not run due to missing external data. */ 51 | #define TEST_DATA_NOT_FOUND 99 52 | 53 | 54 | /** Macro verifying that two numerical values are equal in order to pass unit test. */ 55 | #define QPOASES_TEST_FOR_EQUAL( x,y ) if ( REFER_NAMESPACE_QPOASES isEqual( (x),(y) ) == BT_FALSE ) { return TEST_FAILED; } 56 | 57 | /** Macro verifying that two numerical values are close to each other in order to pass unit test. */ 58 | #define QPOASES_TEST_FOR_NEAR( x,y ) if ( REFER_NAMESPACE_QPOASES getAbs((x)-(y)) / REFER_NAMESPACE_QPOASES getMax( 1.0,REFER_NAMESPACE_QPOASES getAbs(x) ) >= 1e-10 ) { return TEST_FAILED; } 59 | 60 | /** Macro verifying that first quantity is lower or equal than second one in order to pass unit test. */ 61 | #define QPOASES_TEST_FOR_TOL( x,tol ) if ( (x) > (tol)*(TEST_TOL_FACTOR) ) { return TEST_FAILED; } 62 | 63 | /** Macro verifying that a logical expression holds in order to pass unit test. */ 64 | #define QPOASES_TEST_FOR_TRUE( x ) if ( (x) == 0 ) { return TEST_FAILED; } 65 | 66 | 67 | 68 | BEGIN_NAMESPACE_QPOASES 69 | 70 | 71 | END_NAMESPACE_QPOASES 72 | 73 | 74 | #endif /* QPOASES_UNIT_TESTING_H */ 75 | 76 | 77 | /* 78 | * end of file 79 | */ 80 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/example1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/example1.mat -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/example1a.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/example1a.mat -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/example1b.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/example1b.mat -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/qpOASES_e.m: -------------------------------------------------------------------------------- 1 | %qpOASES -- An Implementation of the Online Active Set Strategy. 2 | %Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 3 | %Christian Kirches et al. All rights reserved. 4 | % 5 | %qpOASES is distributed under the terms of the 6 | %GNU Lesser General Public License 2.1 in the hope that it will be 7 | %useful, but WITHOUT ANY WARRANTY; without even the implied warranty 8 | %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 | %See the GNU Lesser General Public License for more details. 10 | % 11 | %--------------------------------------------------------------------------------- 12 | % 13 | %qpOASES_e solves (a series) of quadratic programming (QP) problems of the 14 | %following form: 15 | % 16 | % min 1/2*x'Hx + x'g 17 | % s.t. lb <= x <= ub 18 | % lbA <= Ax <= ubA {optional} 19 | % 20 | %Call 21 | % 22 | % [x,fval,exitflag,iter,lambda,auxOutput] = 23 | % qpOASES_e( H,g,A,lb,ub,lbA,ubA{,options{,auxInput}} ) 24 | % 25 | %for solving the above-mentioned QP. H must be a symmetric (but possibly 26 | %indefinite) matrix and all vectors g, lb, ub, lbA, ubA have to be given 27 | %as column vectors. Options can be generated using the qpOASES_e_options command, 28 | %otherwise default values are used. Optionally, further auxiliary inputs 29 | %may be generated using qpOASES_e_auxInput command and passed to the solver. 30 | %Both matrices H or A may be passed in sparse matrix format. 31 | % 32 | %Call 33 | % 34 | % [x,fval,exitflag,iter,lambda,auxOutput] = 35 | % qpOASES_e( H,g,lb,ub{,options{,auxInput}} ) 36 | % 37 | %for solving the above-mentioned QP without general constraints. 38 | % 39 | % 40 | %Optional outputs (only x is mandatory): 41 | % x - Optimal primal solution vector (if exitflag==0). 42 | % fval - Optimal objective function value (if exitflag==0). 43 | % exitflag - 0: QP problem solved, 44 | % 1: QP could not be solved within given number of iterations, 45 | % -1: QP could not be solved due to an internal error, 46 | % -2: QP is infeasible (and thus could not be solved), 47 | % -3: QP is unbounded (and thus could not be solved). 48 | % iter - Number of active set iterations actually performed. 49 | % lambda - Optimal dual solution vector (if exitflag==0). 50 | % auxOutput - Struct containing auxiliary outputs as described below. 51 | % 52 | %The auxOutput struct contains the following entries: 53 | % workingSetB - Working set of bounds at point x. 54 | % workingSetC - Working set of constraints at point x. 55 | % The working set is a subset of the active set (indices 56 | % of bounds/constraints that hold with equality) yielding 57 | % a set linearly independent of bounds/constraints. 58 | % The working sets are encoded as follows: 59 | % 1: bound/constraint at its upper bound 60 | % 0: bound/constraint not at any bound 61 | % -1: bound/constraint at its lower bound 62 | % cpuTime - Internally measured CPU time for solving QP problem. 63 | % 64 | % 65 | %If not a single QP but a sequence of QPs with varying vectors is to be solved, 66 | %the i-th QP is given by the i-th columns of the QP vectors g, lb, ub, lbA, ubA 67 | %(i.e. they are matrices in this case). Both matrices H and A remain constant. 68 | % 69 | %See also QPOASES_E_OPTIONS, QPOASES_E_AUXINPUT, QPOASES_E_SEQUENCE 70 | % 71 | % 72 | %For additional information see the qpOASES User's Manual or 73 | %visit http://www.qpOASES.org/. 74 | % 75 | %Please send remarks and questions to support@qpOASES.org! 76 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/qpOASES_e.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/qpOASES_e.mexa64 -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/qpOASES_e_matlab_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * \file interfaces/matlab/qpOASES_e_matlab_utils.h 27 | * \author Hans Joachim Ferreau, Alexander Buchner 28 | * \version 3.1embedded 29 | * \date 2007-2015 30 | * 31 | * Collects utility functions for Interface to Matlab(R) that 32 | * enables to call qpOASES as a MEX function. 33 | * 34 | */ 35 | 36 | 37 | 38 | /* Work-around for settings where mexErrMsgTxt causes unexpected behaviour. */ 39 | #ifdef __AVOID_MEXERRMSGTXT__ 40 | #define myMexErrMsgTxt( TEXT ) mexPrintf( "%s\n\n",(TEXT) ); 41 | #else 42 | #define myMexErrMsgTxt mexErrMsgTxt 43 | #endif 44 | 45 | 46 | #include "mex.h" 47 | #include "matrix.h" 48 | #include "string.h" 49 | 50 | 51 | 52 | static int QPInstance_nexthandle = -1; 53 | 54 | /* 55 | * QProblem instance class 56 | */ 57 | typedef struct 58 | { 59 | int handle; 60 | 61 | QProblem sqp; 62 | QProblemB qpb; 63 | BooleanType isSimplyBounded; 64 | 65 | DenseMatrix H; 66 | DenseMatrix A; 67 | 68 | } QPInstance; 69 | 70 | 71 | void QPInstanceCON( QPInstance* _THIS, 72 | int _nV, 73 | int _nC, 74 | HessianType _hessianType, 75 | BooleanType _isSimplyBounded 76 | ); 77 | 78 | int QPInstance_getNV( QPInstance* _THIS ); 79 | 80 | int QPInstance_getNC( QPInstance* _THIS ); 81 | 82 | 83 | #define MAX_NUM_QPINSTANCES 10 84 | static QPInstance QPInstances[MAX_NUM_QPINSTANCES]; 85 | 86 | 87 | /* 88 | * end of file 89 | */ 90 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/qpOASES_e_sequence.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/quadcopter/acado/export_MPC/qpoases3/interfaces/matlab/qpOASES_e_sequence.mexa64 -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/interfaces/simulink/load_example_QProblem.m: -------------------------------------------------------------------------------- 1 | %% 2 | %% This file is part of qpOASES. 3 | %% 4 | %% qpOASES -- An Implementation of the Online Active Set Strategy. 5 | %% Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | %% Christian Kirches et al. All rights reserved. 7 | %% 8 | %% qpOASES is free software; you can redistribute it and/or 9 | %% modify it under the terms of the GNU Lesser General Public 10 | %% License as published by the Free Software Foundation; either 11 | %% version 2.1 of the License, or (at your option) any later version. 12 | %% 13 | %% qpOASES is distributed in the hope that it will be useful, 14 | %% but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | %% See the GNU Lesser General Public License for more details. 17 | %% 18 | %% You should have received a copy of the GNU Lesser General Public 19 | %% License along with qpOASES; if not, write to the Free Software 20 | %% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | %% 22 | 23 | 24 | 25 | %% 26 | %% Filename: interfaces/simulink/load_example_QProblem.m 27 | %% Author: Hans Joachim Ferreau (thanks to Aude Perrin) 28 | %% Version: 3.1embedded 29 | %% Date: 2007-2015 30 | %% 31 | 32 | 33 | 34 | clear all; 35 | 36 | 37 | %% setup QP data 38 | simulationTime = [0;0.1]; 39 | 40 | H = [ 1.0,0.0; ... 41 | 0.0,0.5 ]; 42 | 43 | A = [ 1.0,1.0 ]; 44 | 45 | g.time = simulationTime; 46 | data1 = [ 1.5,1.0 ]; 47 | data2 = [ 1.0,1.5 ]; 48 | g.signals.values = [data1; data2]; 49 | g.signals.dimensions = numel(data1); 50 | 51 | lb.time = simulationTime; 52 | data1 = [ 0.5,-2.0 ]; 53 | data2 = [ 0.0,-1.0 ]; 54 | lb.signals.values = [data1; data2]; 55 | lb.signals.dimensions = numel(data1); 56 | 57 | ub.time = simulationTime; 58 | data1 = [ 5.0,2.0 ]; 59 | data2 = [ 5.0,-0.5 ]; 60 | ub.signals.values = [data1; data2]; 61 | ub.signals.dimensions = numel(data1); 62 | 63 | lbA.time = simulationTime; 64 | data1 = [ -1.0 ]; 65 | data2 = [ -2.0 ]; 66 | lbA.signals.values = [data1; data2]; 67 | lbA.signals.dimensions = numel(data1); 68 | 69 | ubA.time = simulationTime; 70 | data1 = [ 2.0 ]; 71 | data2 = [ 1.0 ]; 72 | ubA.signals.values = [data1; data2]; 73 | ubA.signals.dimensions = numel(data1); 74 | 75 | clear simulationTime data1 data2 76 | 77 | 78 | %% open corresponding simulink example 79 | open( 'example_QProblem.mdl' ); 80 | 81 | 82 | 83 | %% 84 | %% end of file 85 | %% 86 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/interfaces/simulink/load_example_QProblemB.m: -------------------------------------------------------------------------------- 1 | %% 2 | %% This file is part of qpOASES. 3 | %% 4 | %% qpOASES -- An Implementation of the Online Active Set Strategy. 5 | %% Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | %% Christian Kirches et al. All rights reserved. 7 | %% 8 | %% qpOASES is free software; you can redistribute it and/or 9 | %% modify it under the terms of the GNU Lesser General Public 10 | %% License as published by the Free Software Foundation; either 11 | %% version 2.1 of the License, or (at your option) any later version. 12 | %% 13 | %% qpOASES is distributed in the hope that it will be useful, 14 | %% but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | %% See the GNU Lesser General Public License for more details. 17 | %% 18 | %% You should have received a copy of the GNU Lesser General Public 19 | %% License along with qpOASES; if not, write to the Free Software 20 | %% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | %% 22 | 23 | 24 | 25 | %% 26 | %% Filename: interfaces/simulink/load_example_QProblemB.m 27 | %% Author: Hans Joachim Ferreau (thanks to Aude Perrin) 28 | %% Version: 3.1embedded 29 | %% Date: 2007-2015 30 | %% 31 | 32 | 33 | 34 | clear all; 35 | 36 | 37 | %% setup QP data 38 | simulationTime = [0;0.1]; 39 | 40 | H = [ 1.0,0.0; ... 41 | 0.0,0.5 ]; 42 | 43 | g.time = simulationTime; 44 | data1 = [ 1.5,1.0 ]; 45 | data2 = [ 1.0,1.5 ]; 46 | g.signals.values = [data1; data2]; 47 | g.signals.dimensions = numel(data1); 48 | 49 | lb.time = simulationTime; 50 | data1 = [ 0.5,-2.0 ]; 51 | data2 = [ 0.0,-1.0 ]; 52 | lb.signals.values = [data1; data2]; 53 | lb.signals.dimensions = numel(data1); 54 | 55 | ub.time = simulationTime; 56 | data1 = [ 5.0, 2.0 ]; 57 | data2 = [ 5.0,-0.5 ]; 58 | ub.signals.values = [data1; data2]; 59 | ub.signals.dimensions = numel(data1); 60 | 61 | clear simulationTime data1 data2 62 | 63 | 64 | %% open corresponding simulink example 65 | open( 'example_QProblemB.mdl' ); 66 | 67 | 68 | 69 | %% 70 | %% end of file 71 | %% 72 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/interfaces/simulink/qpOASES_e_simulink_utils.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * \file interfaces/simulink/qpOASES_e_simulink_utils.c 27 | * \author Hans Joachim Ferreau 28 | * \version 3.1 29 | * \date 2007-2015 30 | * 31 | * Collects utility functions for Interface to Simulink(R) that 32 | * enables to call qpOASES as a C S function. 33 | * 34 | */ 35 | 36 | 37 | USING_NAMESPACE_QPOASES 38 | 39 | 40 | /* 41 | * i s N a N 42 | */ 43 | BooleanType isNaN( real_t val ) 44 | { 45 | if ( (( val <= 0.0 ) || ( val >= 0.0 )) == 0 ) 46 | return BT_TRUE; 47 | else 48 | return BT_FALSE; 49 | } 50 | 51 | 52 | /* 53 | * r e m o v e N a N s 54 | */ 55 | returnValue removeNaNs( real_t* const data, unsigned int dim ) 56 | { 57 | unsigned int i; 58 | 59 | if ( data == 0 ) 60 | return RET_INVALID_ARGUMENTS; 61 | 62 | for ( i=0; i QPOASES_INFTY ) 86 | data[i] = QPOASES_INFTY; 87 | } 88 | 89 | return SUCCESSFUL_RETURN; 90 | } 91 | 92 | 93 | 94 | /* 95 | * c o n v e r t F o r t r a n T o C 96 | */ 97 | returnValue convertFortranToC( const real_t* const M_for, int nV, int nC, real_t* const M ) 98 | { 99 | int i,j; 100 | 101 | if ( ( M_for == 0 ) || ( M == 0 ) ) 102 | return RET_INVALID_ARGUMENTS; 103 | 104 | if ( ( nV < 0 ) || ( nC < 0 ) ) 105 | return RET_INVALID_ARGUMENTS; 106 | 107 | for ( i=0; i 37 | 38 | 39 | BEGIN_NAMESPACE_QPOASES 40 | 41 | 42 | /***************************************************************************** 43 | * P U B L I C * 44 | *****************************************************************************/ 45 | 46 | 47 | /* 48 | * F l i p p e r 49 | */ 50 | void FlipperCON( Flipper* _THIS, 51 | unsigned int _nV, 52 | unsigned int _nC 53 | ) 54 | { 55 | Flipper_init( _THIS,_nV,_nC ); 56 | } 57 | 58 | 59 | /* 60 | * c o p y 61 | */ 62 | void FlipperCPY( Flipper* FROM, 63 | Flipper* TO 64 | ) 65 | { 66 | Flipper_set( TO, &(FROM->bounds),FROM->R,&(FROM->constraints),FROM->Q,FROM->T ); 67 | } 68 | 69 | 70 | /* 71 | * i n i t 72 | */ 73 | returnValue Flipper_init( Flipper* _THIS, 74 | unsigned int _nV, 75 | unsigned int _nC 76 | ) 77 | { 78 | _THIS->nV = _nV; 79 | _THIS->nC = _nC; 80 | 81 | return SUCCESSFUL_RETURN; 82 | } 83 | 84 | 85 | 86 | /* 87 | * g e t 88 | */ 89 | returnValue Flipper_get( Flipper* _THIS, 90 | Bounds* const _bounds, 91 | real_t* const _R, 92 | Constraints* const _constraints, 93 | real_t* const _Q, 94 | real_t* const _T 95 | ) 96 | { 97 | if ( _bounds != 0 ) 98 | BoundsCPY( &(_THIS->bounds),_bounds ); 99 | 100 | if ( _constraints != 0 ) 101 | ConstraintsCPY( &(_THIS->constraints),_constraints ); 102 | 103 | if ( _R != 0 ) 104 | memcpy( _R,_THIS->R, (NVMAX*NVMAX)*sizeof(real_t) ); 105 | 106 | if ( _Q != 0 ) 107 | memcpy( _Q,_THIS->Q, (NVMAX*NVMAX)*sizeof(real_t) ); 108 | 109 | if ( _T != 0 ) 110 | memcpy( _T,_THIS->T, (NVCMIN*NVCMIN)*sizeof(real_t) ); 111 | 112 | return SUCCESSFUL_RETURN; 113 | } 114 | 115 | 116 | /* 117 | * s e t 118 | */ 119 | returnValue Flipper_set( Flipper* _THIS, 120 | const Bounds* const _bounds, 121 | const real_t* const _R, 122 | const Constraints* const _constraints, 123 | const real_t* const _Q, 124 | const real_t* const _T 125 | ) 126 | { 127 | if ( _bounds != 0 ) 128 | BoundsCPY( (Bounds*)_bounds,&(_THIS->bounds) ); 129 | 130 | if ( _constraints != 0 ) 131 | ConstraintsCPY( (Constraints*)_constraints,&(_THIS->constraints) ); 132 | 133 | if ( _R != 0 ) 134 | memcpy( _THIS->R,_R, (NVMAX*NVMAX)*sizeof(real_t) ); 135 | 136 | if ( _Q != 0 ) 137 | memcpy( _THIS->Q,_Q, (NVMAX*NVMAX)*sizeof(real_t) ); 138 | 139 | if ( _T != 0 ) 140 | memcpy( _THIS->T,_T, (NVCMIN*NVCMIN)*sizeof(real_t) ); 141 | 142 | return SUCCESSFUL_RETURN; 143 | } 144 | 145 | 146 | 147 | /***************************************************************************** 148 | * P R O T E C T E D * 149 | *****************************************************************************/ 150 | 151 | 152 | unsigned int Flipper_getDimT( Flipper* _THIS ) 153 | { 154 | if ( _THIS->nV > _THIS->nC ) 155 | return _THIS->nC * _THIS->nC; 156 | else 157 | return _THIS->nV * _THIS->nV; 158 | } 159 | 160 | 161 | END_NAMESPACE_QPOASES 162 | 163 | 164 | /* 165 | * end of file 166 | */ 167 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/src/Makefile: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | ## 26 | ## Filename: src/Makefile 27 | ## Author: Hans Joachim Ferreau, Andreas Potschka, Christian Kirches 28 | ## Version: 3.1embedded 29 | ## Date: 2007-2015 30 | ## 31 | 32 | include ../make.mk 33 | 34 | ## 35 | ## flags 36 | ## 37 | 38 | IFLAGS = -I. \ 39 | -I${IDIR} 40 | 41 | QPOASES_OBJECTS = \ 42 | QProblem.${OBJEXT} \ 43 | QProblemB.${OBJEXT} \ 44 | Bounds.${OBJEXT} \ 45 | Constraints.${OBJEXT} \ 46 | Indexlist.${OBJEXT} \ 47 | Flipper.${OBJEXT} \ 48 | Utils.${OBJEXT} \ 49 | Options.${OBJEXT} \ 50 | Matrices.${OBJEXT} \ 51 | MessageHandling.${OBJEXT} 52 | 53 | QPOASES_EXTRAS_OBJECTS = \ 54 | OQPinterface.${OBJEXT} 55 | 56 | QPOASES_DEPENDS = \ 57 | ${IDIR}/qpOASES_e.h \ 58 | ${IDIR}/qpOASES_e/QProblem.h \ 59 | ${IDIR}/qpOASES_e/QProblemB.h \ 60 | ${IDIR}/qpOASES_e/Flipper.h \ 61 | ${IDIR}/qpOASES_e/Bounds.h \ 62 | ${IDIR}/qpOASES_e/Constraints.h \ 63 | ${IDIR}/qpOASES_e/Indexlist.h \ 64 | ${IDIR}/qpOASES_e/Utils.h \ 65 | ${IDIR}/qpOASES_e/Constants.h \ 66 | ${IDIR}/qpOASES_e/Types.h \ 67 | ${IDIR}/qpOASES_e/Options.h \ 68 | ${IDIR}/qpOASES_e/Matrices.h \ 69 | ${IDIR}/qpOASES_e/MessageHandling.h \ 70 | ${IDIR}/qpOASES_e/UnitTesting.h 71 | 72 | 73 | ## 74 | ## targets 75 | ## 76 | 77 | all: ${LINK_DEPENDS} 78 | 79 | 80 | ${BINDIR}/libqpOASES_e.${LIBEXT}: ${QPOASES_OBJECTS} ${QPOASES_EXTRAS_OBJECTS} 81 | @${ECHO} "Creating static lib" $@ 82 | @${AR} r $@ $^ 83 | 84 | ${BINDIR}/libqpOASES_e.${DLLEXT}: ${QPOASES_OBJECTS} ${QPOASES_EXTRAS_OBJECTS} 85 | @${ECHO} "Creating shared lib" $@ 86 | @${CC} ${DEF_TARGET} ${SHARED} $^ ${LINK_LIBRARIES} 87 | 88 | clean: 89 | @${ECHO} "Cleaning up (src)" 90 | @${RM} -f *.${OBJEXT} *.${LIBEXT} *.${DLLEXT} 91 | 92 | clobber: clean 93 | 94 | 95 | %.${OBJEXT}: %.c ${QPOASES_DEPENDS} 96 | @${ECHO} "Creating" $@ 97 | ${CC} ${DEF_TARGET} -c ${IFLAGS} ${CFLAGS} $< 98 | 99 | 100 | ## 101 | ## end of file 102 | ## 103 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/testing/c/Makefile: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of qpOASES. 3 | ## 4 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 5 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | ## Christian Kirches et al. All rights reserved. 7 | ## 8 | ## qpOASES is free software; you can redistribute it and/or 9 | ## modify it under the terms of the GNU Lesser General Public 10 | ## License as published by the Free Software Foundation; either 11 | ## version 2.1 of the License, or (at your option) any later version. 12 | ## 13 | ## qpOASES is distributed in the hope that it will be useful, 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | ## See the GNU Lesser General Public License for more details. 17 | ## 18 | ## You should have received a copy of the GNU Lesser General Public 19 | ## License along with qpOASES; if not, write to the Free Software 20 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | ## 22 | 23 | 24 | 25 | ## 26 | ## Filename: testing/c/Makefile 27 | ## Author: Hans Joachim Ferreau 28 | ## Version: 3.1embedded 29 | ## Date: 2007-2015 30 | ## 31 | 32 | 33 | include ../../make.mk 34 | 35 | ## 36 | ## flags 37 | ## 38 | 39 | IFLAGS = -I. \ 40 | -I${IDIR} 41 | 42 | QPOASES_TEST_EXES = \ 43 | ${BINDIR}/test_bench${EXE} \ 44 | ${BINDIR}/test_runAllOqpExamples${EXE} 45 | 46 | QPOASES_DEPENDS = \ 47 | ${IDIR}/qpOASES_e.h \ 48 | ${IDIR}/qpOASES_e/QProblem.h \ 49 | ${IDIR}/qpOASES_e/QProblemB.h \ 50 | ${IDIR}/qpOASES_e/Bounds.h \ 51 | ${IDIR}/qpOASES_e/Constraints.h \ 52 | ${IDIR}/qpOASES_e/Indexlist.h \ 53 | ${IDIR}/qpOASES_e/Flipper.h \ 54 | ${IDIR}/qpOASES_e/Utils.h \ 55 | ${IDIR}/qpOASES_e/Constants.h \ 56 | ${IDIR}/qpOASES_e/Types.h \ 57 | ${IDIR}/qpOASES_e/Options.h \ 58 | ${IDIR}/qpOASES_e/Matrices.h \ 59 | ${IDIR}/qpOASES_e/MessageHandling.h \ 60 | ${IDIR}/qpOASES_e/extras/OQPinterface.h 61 | 62 | 63 | ## 64 | ## targets 65 | ## 66 | 67 | all: ${QPOASES_TEST_EXES} 68 | 69 | ${BINDIR}/%${EXE}: %.${OBJEXT} ${LINK_DEPENDS} 70 | @${ECHO} "Creating" $@ 71 | @${CC} ${DEF_TARGET} ${CFLAGS} $< ${QPOASES_LINK} ${LINK_LIBRARIES} 72 | 73 | clean: 74 | @${ECHO} "Cleaning up (testing/c)" 75 | @${RM} -f *.${OBJEXT} ${QPOASES_TEST_EXES} 76 | 77 | clobber: clean 78 | 79 | 80 | ${LINK_DEPENDS}: 81 | @cd ../..; ${MAKE} -s src 82 | 83 | %.${OBJEXT}: %.c 84 | @${ECHO} "Creating" $@ 85 | @${CC} ${DEF_TARGET} ${IFLAGS} ${CFLAGS} -c $< 86 | 87 | 88 | ## 89 | ## end of file 90 | ## 91 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/testing/c/data/fetch_cpp_data: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## 4 | ## This file is part of qpOASES. 5 | ## 6 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 7 | ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 8 | ## Christian Kirches et al. All rights reserved. 9 | ## 10 | ## qpOASES is free software; you can redistribute it and/or 11 | ## modify it under the terms of the GNU Lesser General Public 12 | ## License as published by the Free Software Foundation; either 13 | ## version 2.1 of the License, or (at your option) any later version. 14 | ## 15 | ## qpOASES is distributed in the hope that it will be useful, 16 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 | ## See the GNU Lesser General Public License for more details. 19 | ## 20 | ## You should have received a copy of the GNU Lesser General Public 21 | ## License along with qpOASES; if not, write to the Free Software 22 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 23 | ## 24 | 25 | 26 | 27 | ## 28 | ## Filename: testing/c/data/fetch_cpp_data 29 | ## Author: Hans Joachim Ferreau 30 | ## Version: 3.1embedded 31 | ## Date: 2014-2015 32 | 33 | 34 | svn export https://projects.coin-or.org/svn/qpOASES/misc/testingdata/cpp . --force 35 | -------------------------------------------------------------------------------- /quadcopter/acado/export_MPC/qpoases3/testing/c/test_bench.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, 6 | * Christian Kirches et al. All rights reserved. 7 | * 8 | * qpOASES is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * qpOASES is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | * See the GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with qpOASES; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | #define _SVID_SOURCE 25 | 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | 34 | /** Try to solve a list of or all OQP examples in testing/problems */ 35 | int main(int argc, char *argv[]) 36 | { 37 | const real_t TOL = 1e-5; 38 | 39 | /* 1) Define benchmark arguments. */ 40 | BooleanType isSparse = BT_FALSE; 41 | BooleanType useHotstarts = BT_FALSE; 42 | static Options options; 43 | 44 | int maxAllowedNWSR; 45 | real_t maxNWSR, avgNWSR, maxCPUtime, avgCPUtime; 46 | real_t maxStationarity, maxFeasibility, maxComplementarity; 47 | 48 | int scannedDir = 0; 49 | int nfail = 0, npass = 0; 50 | int nproblems, i; 51 | struct dirent **namelist; 52 | char resstr[200], OQPproblem[200]; 53 | char *problem; 54 | returnValue returnvalue; 55 | 56 | Options_setToDefault( &options ); 57 | /*options.enableFlippingBounds = BT_FALSE;*/ 58 | /*Options_setToReliable( &options );*/ 59 | Options_setToMPC( &options ); 60 | /*options.printLevel = PL_DEBUG_ITER;*/ 61 | options.printLevel = PL_LOW; 62 | /*options.enableRamping = BT_FALSE;*/ 63 | /*options.enableFarBounds = BT_FALSE;*/ 64 | 65 | if (argc == 1) 66 | { 67 | /* 2a) Scan problem directory */ 68 | nproblems = scandir("../testing/c/data/problems", &namelist, NULL, alphasort); 69 | if (nproblems <= 0) 70 | { 71 | qpOASES_myPrintf( "No test problems found!\n" ); 72 | return -1; 73 | } 74 | scannedDir = 1; 75 | } 76 | else 77 | { 78 | /* 2b) Use problem list given by arguments */ 79 | nproblems = argc - 1; 80 | scannedDir = 0; 81 | } 82 | 83 | /* 3) Run benchmark. */ 84 | printf("%10s %9s %9s %9s %6s %-12s\n", "problem", "stat", 85 | "feas", "compl", "nWSR", "result"); 86 | for (i = 0; i < nproblems; i++) 87 | { 88 | if (scannedDir) 89 | { 90 | /* skip special directories and zip file cuter.*bz2 */ 91 | if (namelist[i]->d_name[0] == '.' || namelist[i]->d_name[0] == 'c') 92 | { 93 | free(namelist[i]); 94 | continue; 95 | } 96 | problem = namelist[i]->d_name; 97 | } 98 | else 99 | { 100 | problem = argv[i+1]; 101 | } 102 | 103 | fprintf(stdout, "%-10s ", problem); 104 | fflush(stdout); 105 | 106 | snprintf(OQPproblem, 199, "../testing/c/data/problems/%s/", problem); 107 | maxCPUtime = 300.0; 108 | maxAllowedNWSR = 3500; 109 | returnvalue = runOQPbenchmark( OQPproblem, 110 | isSparse,useHotstarts, 111 | &options,maxAllowedNWSR, 112 | &maxNWSR,&avgNWSR,&maxCPUtime,&avgCPUtime, 113 | &maxStationarity,&maxFeasibility,&maxComplementarity 114 | ); 115 | if (returnvalue == SUCCESSFUL_RETURN 116 | && maxStationarity < TOL 117 | && maxFeasibility < TOL 118 | && maxComplementarity < TOL) 119 | { 120 | npass++; 121 | strncpy(resstr, "pass", 199); 122 | } 123 | else 124 | { 125 | nfail++; 126 | snprintf (resstr, 199, "fail (%d)", returnvalue); 127 | } 128 | fprintf(stdout, "%9.2e %9.2e %9.2e %6d %-12s\n", maxStationarity, 129 | maxFeasibility, maxComplementarity, (int)maxNWSR, resstr); 130 | 131 | if (scannedDir) free(namelist[i]); 132 | } 133 | if (scannedDir) free(namelist); 134 | 135 | /* 4) Print results. */ 136 | printf("\n\n" ); 137 | printf("Testbench results:\n" ); 138 | printf("======================\n\n" ); 139 | printf("Pass: %3d\n", npass); 140 | printf("Fail: %3d\n", nfail); 141 | printf("Ratio: %5.1f%%\n", 100.0 * (real_t)npass / (real_t)(npass+nfail)); 142 | printf("\n" ); 143 | 144 | return 0; 145 | } 146 | 147 | 148 | /* 149 | * end of file 150 | */ 151 | -------------------------------------------------------------------------------- /quadcopter/acado/find_steady_state.m: -------------------------------------------------------------------------------- 1 | clear variables 2 | close all 3 | clc 4 | 5 | hover_omega = 40; 6 | init_guess = hover_omega*ones(1,4).'; 7 | 8 | ss_input = fsolve(@(input) dynamics_ss(input), init_guess) -------------------------------------------------------------------------------- /quadcopter/acado/myeul2quat.m: -------------------------------------------------------------------------------- 1 | function [q] = myeul2quat(e1, e2, e3) 2 | % 3 | %Function to convert Euler angles in degrees to a quaternion. The convention used is that of Bunge (1965, 1982) 4 | %Prior to using this euler angle should be converted to this convention 5 | % 6 | %Inputs: 7 | % e1: n x 1 vector of Euler angles 1 (phi1) 8 | % e2: n x 1 vector of Euler angles 2 (PHI) 9 | % e3: n x 1 vector of Euler angles 3 (phi2) 10 | % 11 | %Outputs: 12 | % q: quaternion corresponding to the rotation described by Euler angles 13 | % 14 | % Copyright 2014 Mark Pearce 15 | % 16 | % This file is part of EBSDinterp. 17 | % 18 | % EBSDinterp is free software: you can redistribute it and/or modify 19 | % it under the terms of the CSIRO Open Source Software Licence 20 | % distributed with this software as "CSIRO_BSD_MIT_License_v2_0.txt". 21 | % 22 | % EBSDinterp is distributed in the hope that it will be useful, 23 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | % GNU General Public License for more details. 26 | % 27 | 28 | %Redefine as alpha, beta and gamma in radians 29 | al = e1 / 180 * pi - (pi/2); 30 | be = e2 / 180 * pi; 31 | ga = e3 / 180 * pi - (3*pi / 2); 32 | 33 | for i = 1:length(al) 34 | q(i,:) = [cos(be(i)/2)*cos((al(i) + ga(i))/2); -sin(be(i)/2)*sin((al(i) - ga(i))/2); sin(be(i)/2)*cos((al(i) - ga(i))/2); cos(be(i)/2)*sin((al(i) + ga(i))/2)]'; 35 | end -------------------------------------------------------------------------------- /quadcopter/acado/myquat2eul.m: -------------------------------------------------------------------------------- 1 | function [ e ] = myquat2eul( q ) 2 | q0 = q(1); 3 | q1 = q(2); 4 | q2 = q(3); 5 | q3 = q(4); 6 | 7 | phi = atan2(2*(q0*q1 + q2*q3),(1 - 2*(q1^2 + q2^2))); 8 | theta = asin(2*(q0*q2 - q3*q1)); 9 | psi = atan2(2*(q0*q3 + q1*q2),(1 - 2*(q2^2 + q3^2))); 10 | e = [phi, theta, psi]; 11 | end 12 | 13 | -------------------------------------------------------------------------------- /quadcopter/forces/dynamics.m: -------------------------------------------------------------------------------- 1 | function dx = dynamics(x,u) 2 | rho = 1.23; 3 | A = 0.1; 4 | Cl = 0.25; 5 | Cd = 0.3*Cl; 6 | m = 10; 7 | g = 9.81; 8 | L = 0.5; 9 | J1 = 0.25; 10 | J2 = 0.25; 11 | J3 = 1; 12 | alpha = 0.0; 13 | 14 | P1 = x(1); 15 | P2 = x(2); 16 | P3 = x(3); 17 | V1 = x(4); 18 | V2 = x(5); 19 | V3 = x(6); 20 | q1 = x(7); 21 | q2 = x(8); 22 | q3 = x(9); 23 | q4 = x(10); 24 | Omega1 = x(11); 25 | Omega2 = x(12); 26 | Omega3 = x(13); 27 | W1 = x(14); 28 | W2 = x(15); 29 | W3 = x(16); 30 | W4 = x(17); 31 | 32 | rW1 = u(1); 33 | rW2 = u(2); 34 | rW3 = u(3); 35 | rW4 = u(4); 36 | 37 | dx = [ 38 | V1; 39 | V2; 40 | V3; 41 | (A*Cl*rho*(2*q1*q3 + 2*q2*q4)*(W1*W1 + W2*W2 + W3*W3 + W4*W4))/(2*m); 42 | -(A*Cl*rho*(2*q1*q2 - 2*q3*q4)*(W1*W1 + W2*W2 + W3*W3 + W4*W4))/(2*m); 43 | (A*Cl*rho*(W1*W1 + W2*W2 + W3*W3 + W4*W4)*(q1*q1 - q2*q2 - q3*q3 + q4*q4))/(2*m) - g; 44 | - (Omega1*q2)/2 - (Omega2*q3)/2 - (Omega3*q4)/2 - (alpha*q1*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 45 | (Omega1*q1)/2 - (Omega3*q3)/2 + (Omega2*q4)/2 - (alpha*q2*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 46 | (Omega2*q1)/2 + (Omega3*q2)/2 - (Omega1*q4)/2 - (alpha*q3*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 47 | (Omega3*q1)/2 - (Omega2*q2)/2 + (Omega1*q3)/2 - (alpha*q4*(q1*q1 + q2*q2 + q3*q3 + q4*q4 - 1))/(q1*q1 + q2*q2 + q3*q3 + q4*q4); 48 | (J3*Omega2*Omega3 - J2*Omega2*Omega3 + (A*Cl*L*rho*(W2*W2 - W4*W4))/2)/J1; 49 | -(J3*Omega1*Omega3 - J1*Omega1*Omega3 + (A*Cl*L*rho*(W1*W1 - W3*W3))/2)/J2; 50 | (J2*Omega1*Omega2 - J1*Omega1*Omega2 + (A*Cd*rho*(W1*W1 - W2*W2 + W3*W3 - W4*W4))/2)/J3; 51 | rW1; 52 | rW2; 53 | rW3; 54 | rW4]; 55 | end -------------------------------------------------------------------------------- /quadcopter/forces/myquat2eul.m: -------------------------------------------------------------------------------- 1 | function [ e ] = myquat2eul( q ) 2 | q0 = q(1); 3 | q1 = q(2); 4 | q2 = q(3); 5 | q3 = q(4); 6 | 7 | phi = atan2(2*(q0*q1 + q2*q3),(1 - 2*(q1^2 + q2^2))); 8 | theta = asin(2*(q0*q2 - q3*q1)); 9 | psi = atan2(2*(q0*q3 + q1*q2),(1 - 2*(q2^2 + q3^2))); 10 | e = [phi, theta, psi]; 11 | end 12 | 13 | -------------------------------------------------------------------------------- /robot/acado/dynamics.m: -------------------------------------------------------------------------------- 1 | function dx = dynamics(x,u) 2 | % 2-link planar manipulator dynamics 3 | th1 = x(1); 4 | th1d = x(2); 5 | th2 = x(3); 6 | th2d = x(4); 7 | tau1 = x(5); 8 | tau2 = x(6); 9 | 10 | tau1r = u(1); 11 | tau2r = u(2); 12 | dx = zeros(6,1); 13 | mM1 = 0.3; 14 | mM2 = 0.3; 15 | kr1 = 1.0; 16 | kr2 = 1.0; 17 | rM1 = 0.05; 18 | rM2 = 0.05; 19 | Im1 = 1/2*mM1*rM1*rM1; 20 | Im2 = 1/2*mM2*rM2*rM2; 21 | 22 | ml1 = 3.0; 23 | ml2 = 3.0; 24 | l1 = 1.0; 25 | l2 = 1.0; 26 | Il1 = 1.0/12.0*ml1*l1*l1; 27 | Il2 = 1.0/12.0*ml2*l2*l2; 28 | a1 = l1/2.0; 29 | a2 = l2/2.0; 30 | 31 | g = 9.81; 32 | 33 | alpha_1 = Il1 + ml1*l1*l1 + kr1*kr1*Im1 + Il2 + ml2*(a1*a1 + l2*l2 + 2*a1*l2*cos(th2) + Im2 + mM2*a1*a1); 34 | alpha_2 = Il2 + ml2*(l2*l2 + a1*l2*cos(th2)) + kr2*Im2; 35 | alpha_3 = -2.0*ml2*a1*l2*sin(th2); 36 | alpha_4 = -ml2*a1*l2*sin(th2); 37 | K_alpha = (ml1*l1 + mM2*a1 + ml2*a1)*g*cos(th1) + ml2*l2*g*cos(th1 + th2); 38 | 39 | beta_1 = Il2 + ml2*(l2*l2 + a1*l2*cos(th2)) + kr2*Im2; 40 | beta_2 = Il2 + ml2*l2*l2 + kr2*kr2*Im2; 41 | beta_3 = ml2*a1*l2*sin(th2); 42 | K_beta = ml2*l2*g*cos(th1 + th2); 43 | 44 | theta1dd_exp = 1.0/(alpha_1 - alpha_2*beta_1/beta_2) * (alpha_2/beta_2 * (K_beta + beta_3*th1d*th1d - tau2) - alpha_3*th1d*th2d - alpha_4*th2d - K_alpha + tau1); 45 | 46 | dx = [ th1d; 47 | theta1dd_exp; 48 | th2d; 49 | 1.0/beta_2*(tau2 - beta_1*theta1dd_exp - beta_3*th1d*th1d - K_beta); 50 | tau1r; 51 | tau2r ]; 52 | end -------------------------------------------------------------------------------- /robot/acado/export_MPC/forces/forces_info.txt: -------------------------------------------------------------------------------- 1 | The approximate properties of the solver code are: 2 | - Data memory consumption : 99784 Bytes (statically allocated) 3 | - Code memory consumption : ~ 35000 Bytes 4 | - Computation count : 196455 FLOPS per interior-point iteration -------------------------------------------------------------------------------- /robot/acado/export_MPC/forces/interface/COPYING.m: -------------------------------------------------------------------------------- 1 | % forces : A fast customized optimization solver. 2 | % 3 | % Copyright (C) 2013-2016 EMBOTECH GMBH [info@embotech.com]. All rights reserved. 4 | % 5 | % 6 | % This software is intended for simulation and testing purposes only. 7 | % Use of this software for any commercial purpose is prohibited. 8 | % 9 | % This program is distributed in the hope that it will be useful. 10 | % EMBOTECH makes NO WARRANTIES with respect to the use of the software 11 | % without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | % PARTICULAR PURPOSE. 13 | % 14 | % EMBOTECH shall not have any liability for any damage arising from the use 15 | % of the software. 16 | % 17 | % This Agreement shall exclusively be governed by and interpreted in 18 | % accordance with the laws of Switzerland, excluding its principles 19 | % of conflict of laws. The Courts of Zurich-City shall have exclusive 20 | % jurisdiction in case of any dispute. 21 | % 22 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/forces/interface/forces_build.py: -------------------------------------------------------------------------------- 1 | #forces : A fast customized optimization solver. 2 | # 3 | #Copyright (C) 2013-2016 EMBOTECH GMBH [info@embotech.com]. All rights reserved. 4 | # 5 | # 6 | #This software is intended for simulation and testing purposes only. 7 | #Use of this software for any commercial purpose is prohibited. 8 | # 9 | #This program is distributed in the hope that it will be useful. 10 | #EMBOTECH makes NO WARRANTIES with respect to the use of the software 11 | #without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | #PARTICULAR PURPOSE. 13 | # 14 | #EMBOTECH shall not have any liability for any damage arising from the use 15 | #of the software. 16 | # 17 | #This Agreement shall exclusively be governed by and interpreted in 18 | #accordance with the laws of Switzerland, excluding its principles 19 | #of conflict of laws. The Courts of Zurich-City shall have exclusive 20 | #jurisdiction in case of any dispute. 21 | # 22 | from distutils.ccompiler import new_compiler 23 | c = new_compiler() 24 | #from numpy.distutils.intelccompiler import IntelCCompiler 25 | #c = IntelCCompiler() 26 | 27 | 28 | import os 29 | import sys 30 | import distutils 31 | 32 | # determine source file 33 | sourcefile = os.path.join(os.getcwd(),"forces","src","forces"+".c") 34 | 35 | # determine lib file 36 | if sys.platform.startswith('win'): 37 | libfile = os.path.join(os.getcwd(),"forces","lib","forces"+".lib") 38 | else: 39 | libfile = os.path.join(os.getcwd(),"forces","lib","forces"+".so") 40 | 41 | # create lib dir if it does not exist yet 42 | if not os.path.exists(os.path.join(os.getcwd(),"forces","lib")): 43 | os.makedirs(os.path.join(os.getcwd(),"forces","lib")) 44 | 45 | 46 | 47 | # compile into object file 48 | objdir = os.path.join(os.getcwd(),"forces","obj") 49 | if isinstance(c,distutils.unixccompiler.UnixCCompiler): 50 | objects = c.compile([sourcefile], output_dir=objdir, extra_preargs=['-O3','-fPIC','-fopenmp','-mavx']) 51 | if sys.platform.startswith('linux'): 52 | c.set_libraries(['rt','gomp']) 53 | else: 54 | objects = c.compile([sourcefile], output_dir=objdir) 55 | 56 | 57 | # create libraries 58 | libdir = os.path.join(os.getcwd(),"forces","lib") 59 | exportsymbols = ["%s_solve" % "forces"] 60 | c.create_static_lib(objects, "forces", output_dir=libdir) 61 | c.link_shared_lib(objects, "forces", output_dir=libdir, export_symbols=exportsymbols) -------------------------------------------------------------------------------- /robot/acado/export_MPC/forces/interface/forcesprologo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/robot/acado/export_MPC/forces/interface/forcesprologo.jpg -------------------------------------------------------------------------------- /robot/acado/export_MPC/forces/lib/forces.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/robot/acado/export_MPC/forces/lib/forces.so -------------------------------------------------------------------------------- /robot/acado/export_MPC/forces/obj/forces.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embotech/forcesnlp-examples/d601a98ca8bb3f3fbe1b96fbe683d4de6f250948/robot/acado/export_MPC/forces/obj/forces.o -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/EXAMPLES/example1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file EXAMPLES/example1.cpp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Very simple example for testing qpOASES (using QProblem class). 31 | */ 32 | 33 | 34 | #include 35 | 36 | 37 | /** Example for qpOASES main function using the QProblem class. */ 38 | int main( ) 39 | { 40 | /* Setup data of first QP. */ 41 | real_t H[2*2] = { 1.0, 0.0, 0.0, 0.5 }; 42 | real_t A[1*2] = { 1.0, 1.0 }; 43 | real_t g[2] = { 1.5, 1.0 }; 44 | real_t lb[2] = { 0.5, -2.0 }; 45 | real_t ub[2] = { 5.0, 2.0 }; 46 | real_t lbA[1] = { -1.0 }; 47 | real_t ubA[1] = { 2.0 }; 48 | 49 | /* Setup data of second QP. */ 50 | real_t g_new[2] = { 1.0, 1.5 }; 51 | real_t lb_new[2] = { 0.0, -1.0 }; 52 | real_t ub_new[2] = { 5.0, -0.5 }; 53 | real_t lbA_new[1] = { -2.0 }; 54 | real_t ubA_new[1] = { 1.0 }; 55 | 56 | 57 | /* Setting up QProblem object. */ 58 | QProblem example( 2,1 ); 59 | 60 | /* Solve first QP. */ 61 | int nWSR = 10; 62 | example.init( H,g,A,lb,ub,lbA,ubA, nWSR,0 ); 63 | 64 | /* Solve second QP. */ 65 | nWSR = 10; 66 | example.hotstart( g_new,lb_new,ub_new,lbA_new,ubA_new, nWSR,0 ); 67 | 68 | return 0; 69 | } 70 | 71 | 72 | /* 73 | * end of file 74 | */ 75 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/EXAMPLES/example1b.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file EXAMPLES/example1b.cpp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3 28 | * \date 2007-2008 29 | * 30 | * Very simple example for testing qpOASES using the QProblemB class. 31 | */ 32 | 33 | 34 | #include 35 | 36 | 37 | /** Example for qpOASES main function using the QProblemB class. */ 38 | int main( ) 39 | { 40 | /* Setup data of first QP. */ 41 | real_t H[2*2] = { 1.0, 0.0, 0.0, 0.5 }; 42 | real_t g[2] = { 1.5, 1.0 }; 43 | real_t lb[2] = { 0.5, -2.0 }; 44 | real_t ub[2] = { 5.0, 2.0 }; 45 | 46 | /* Setup data of second QP. */ 47 | real_t g_new[2] = { 1.0, 1.5 }; 48 | real_t lb_new[2] = { 0.0, -1.0 }; 49 | real_t ub_new[2] = { 5.0, -0.5 }; 50 | 51 | 52 | /* Setting up QProblemB object. */ 53 | QProblemB example( 2 ); 54 | 55 | /* Solve first QP. */ 56 | int nWSR = 10; 57 | example.init( H,g,lb,ub, nWSR,0 ); 58 | 59 | /* Solve second QP. */ 60 | nWSR = 10; 61 | example.hotstart( g_new,lb_new,ub_new, nWSR,0 ); 62 | 63 | return 0; 64 | } 65 | 66 | 67 | /* 68 | * end of file 69 | */ 70 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/INCLUDE/Constants.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file INCLUDE/Constants.hpp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2008 29 | * 30 | * Definition of all global constants. 31 | */ 32 | 33 | 34 | #ifndef QPOASES_CONSTANTS_HPP 35 | #define QPOASES_CONSTANTS_HPP 36 | 37 | #ifndef QPOASES_CUSTOM_INTERFACE 38 | #include "acado_qpoases_interface.hpp" 39 | #else 40 | #define XSTR(x) #x 41 | #define STR(x) XSTR(x) 42 | #include STR(QPOASES_CUSTOM_INTERFACE) 43 | #endif 44 | 45 | /** Maximum number of variables within a QP formulation. 46 | Note: this value has to be positive! */ 47 | const int NVMAX = QPOASES_NVMAX; 48 | 49 | /** Maximum number of constraints within a QP formulation. 50 | Note: this value has to be positive! */ 51 | const int NCMAX = QPOASES_NCMAX; 52 | 53 | /** Redefinition of NCMAX used for memory allocation, to avoid zero sized arrays 54 | and compiler errors. */ 55 | const int NCMAX_ALLOC = (NCMAX == 0) ? 1 : NCMAX; 56 | 57 | /**< Maximum number of working set recalculations. 58 | Note: this value has to be positive! */ 59 | const int NWSRMAX = QPOASES_NWSRMAX; 60 | 61 | /** Desired KKT tolerance of QP solution; a warning RET_INACCURATE_SOLUTION is 62 | * issued if this tolerance is not met. 63 | * Note: this value has to be positive! */ 64 | const real_t DESIREDACCURACY = (real_t) 1.0e-3; 65 | 66 | /** Critical KKT tolerance of QP solution; an error is issued if this 67 | * tolerance is not met. 68 | * Note: this value has to be positive! */ 69 | const real_t CRITICALACCURACY = (real_t) 1.0e-2; 70 | 71 | 72 | 73 | /** Numerical value of machine precision (min eps, s.t. 1+eps > 1). 74 | Note: this value has to be positive! */ 75 | const real_t EPS = (real_t) QPOASES_EPS; 76 | 77 | /** Numerical value of zero (for situations in which it would be 78 | * unreasonable to compare with 0.0). 79 | * Note: this value has to be positive! */ 80 | const real_t ZERO = (real_t) 1.0e-50; 81 | 82 | /** Numerical value of infinity (e.g. for non-existing bounds). 83 | * Note: this value has to be positive! */ 84 | const real_t INFTY = (real_t) 1.0e12; 85 | 86 | 87 | /** Lower/upper (constraints') bound tolerance (an inequality constraint 88 | * whose lower and upper bound differ by less than BOUNDTOL is regarded 89 | * to be an equality constraint). 90 | * Note: this value has to be positive! */ 91 | const real_t BOUNDTOL = (real_t) 1.0e-10; 92 | 93 | /** Offset for relaxing (constraints') bounds at beginning of an initial homotopy. 94 | * Note: this value has to be positive! */ 95 | const real_t BOUNDRELAXATION = (real_t) 1.0e3; 96 | 97 | 98 | /** Factor that determines physical lengths of index lists. 99 | * Note: this value has to be greater than 1! */ 100 | const int INDEXLISTFACTOR = 5; 101 | 102 | 103 | #endif /* QPOASES_CONSTANTS_HPP */ 104 | 105 | 106 | /* 107 | * end of file 108 | */ 109 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/INCLUDE/CyclingManager.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file INCLUDE/CyclingManager.hpp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Declaration of the CyclingManager class designed to detect 31 | * and handle possible cycling during QP iterations. 32 | */ 33 | 34 | 35 | #ifndef QPOASES_CYCLINGMANAGER_HPP 36 | #define QPOASES_CYCLINGMANAGER_HPP 37 | 38 | 39 | #include 40 | 41 | 42 | 43 | /** This class is intended to detect and handle possible cycling during QP iterations. 44 | * As cycling seems to occur quite rarely, this class is NOT FULLY IMPLEMENTED YET! 45 | * 46 | * \author Hans Joachim Ferreau 47 | * \version 1.3embedded 48 | * \date 2007-2008 49 | */ 50 | class CyclingManager 51 | { 52 | /* 53 | * PUBLIC MEMBER FUNCTIONS 54 | */ 55 | public: 56 | /** Default constructor. */ 57 | CyclingManager( ); 58 | 59 | /** Copy constructor (deep copy). */ 60 | CyclingManager( const CyclingManager& rhs /**< Rhs object. */ 61 | ); 62 | 63 | /** Destructor. */ 64 | ~CyclingManager( ); 65 | 66 | /** Copy asingment operator (deep copy). */ 67 | CyclingManager& operator=( const CyclingManager& rhs /**< Rhs object. */ 68 | ); 69 | 70 | 71 | /** Pseudo-constructor which takes the number of bounds/constraints. 72 | * \return SUCCESSFUL_RETURN */ 73 | returnValue init( int _nV, /**< Number of bounds to be managed. */ 74 | int _nC /**< Number of constraints to be managed. */ 75 | ); 76 | 77 | 78 | /** Stores index of a bound/constraint that might cause cycling. 79 | * \return SUCCESSFUL_RETURN \n 80 | RET_INDEX_OUT_OF_BOUNDS */ 81 | returnValue setCyclingStatus( int number, /**< Number of bound/constraint. */ 82 | BooleanType isBound, /**< Flag that indicates if given number corresponds to a 83 | * bound (BT_TRUE) or a constraint (BT_FALSE). */ 84 | CyclingStatus _status /**< Cycling status of bound/constraint. */ 85 | ); 86 | 87 | /** Returns if bound/constraint might cause cycling. 88 | * \return BT_TRUE: bound/constraint might cause cycling \n 89 | BT_FALSE: otherwise */ 90 | CyclingStatus getCyclingStatus( int number, /**< Number of bound/constraint. */ 91 | BooleanType isBound /**< Flag that indicates if given number corresponds to 92 | * a bound (BT_TRUE) or a constraint (BT_FALSE). */ 93 | ) const; 94 | 95 | 96 | /** Clears all previous cycling information. 97 | * \return SUCCESSFUL_RETURN */ 98 | returnValue clearCyclingData( ); 99 | 100 | 101 | /** Returns if cycling was detected. 102 | * \return BT_TRUE iff cycling was detected. */ 103 | inline BooleanType isCyclingDetected( ) const; 104 | 105 | 106 | /* 107 | * PROTECTED MEMBER VARIABLES 108 | */ 109 | protected: 110 | int nV; /**< Number of managed bounds. */ 111 | int nC; /**< Number of managed constraints. */ 112 | 113 | CyclingStatus status[NVMAX+NCMAX]; /**< Array to store cycling status of all bounds/constraints. */ 114 | 115 | BooleanType cyclingDetected; /**< Flag if cycling was detected. */ 116 | }; 117 | 118 | 119 | #include 120 | 121 | #endif /* QPOASES_CYCLINGMANAGER_HPP */ 122 | 123 | 124 | /* 125 | * end of file 126 | */ 127 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/INCLUDE/EXTRAS/SolutionAnalysis.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file INCLUDE/EXTRAS/SolutionAnalysis.hpp 26 | * \author Milan Vukov, Boris Houska, Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2012 29 | * 30 | * Solution analysis class, based on a class in the standard version of the qpOASES 31 | */ 32 | 33 | 34 | // 35 | 36 | #ifndef QPOASES_SOLUTIONANALYSIS_HPP 37 | #define QPOASES_SOLUTIONANALYSIS_HPP 38 | 39 | #include 40 | 41 | /** Enables the computation of variance as is in the standard version of qpOASES */ 42 | #define QPOASES_USE_OLD_VERSION 0 43 | 44 | #if QPOASES_USE_OLD_VERSION 45 | #define KKT_DIM (2 * NVMAX + NCMAX) 46 | #endif 47 | 48 | class SolutionAnalysis 49 | { 50 | public: 51 | 52 | /** Default constructor. */ 53 | SolutionAnalysis( ); 54 | 55 | /** Copy constructor (deep copy). */ 56 | SolutionAnalysis( const SolutionAnalysis& rhs /**< Rhs object. */ 57 | ); 58 | 59 | /** Destructor. */ 60 | ~SolutionAnalysis( ); 61 | 62 | /** Copy asingment operator (deep copy). */ 63 | SolutionAnalysis& operator=( const SolutionAnalysis& rhs /**< Rhs object. */ 64 | ); 65 | 66 | /** A routine for computation of inverse of the Hessian matrix. */ 67 | returnValue getHessianInverse( 68 | QProblem* qp, /** QP */ 69 | real_t* hessianInverse /** Inverse of the Hessian matrix*/ 70 | ); 71 | 72 | /** A routine for computation of inverse of the Hessian matrix. */ 73 | returnValue getHessianInverse( QProblemB* qp, /** QP */ 74 | real_t* hessianInverse /** Inverse of the Hessian matrix*/ 75 | ); 76 | 77 | #if QPOASES_USE_OLD_VERSION 78 | returnValue getVarianceCovariance( 79 | QProblem* qp, 80 | real_t* g_b_bA_VAR, 81 | real_t* Primal_Dual_VAR 82 | ); 83 | #endif 84 | 85 | private: 86 | 87 | real_t delta_g_cov[ NVMAX ]; /** A covariance-vector of g */ 88 | real_t delta_lb_cov[ NVMAX ]; /** A covariance-vector of lb */ 89 | real_t delta_ub_cov[ NVMAX ]; /** A covariance-vector of ub */ 90 | real_t delta_lbA_cov[ NCMAX_ALLOC ]; /** A covariance-vector of lbA */ 91 | real_t delta_ubA_cov[ NCMAX_ALLOC ]; /** A covariance-vector of ubA */ 92 | 93 | #if QPOASES_USE_OLD_VERSION 94 | real_t K[KKT_DIM * KKT_DIM]; /** A matrix to store an intermediate result */ 95 | #endif 96 | 97 | int FR_idx[ NVMAX ]; /** Index array for free variables */ 98 | int FX_idx[ NVMAX ]; /** Index array for fixed variables */ 99 | int AC_idx[ NCMAX_ALLOC ]; /** Index array for active constraints */ 100 | 101 | real_t delta_xFR[ NVMAX ]; /** QP reaction, primal, w.r.t. free */ 102 | real_t delta_xFX[ NVMAX ]; /** QP reaction, primal, w.r.t. fixed */ 103 | real_t delta_yAC[ NVMAX ]; /** QP reaction, dual, w.r.t. active */ 104 | real_t delta_yFX[ NVMAX ]; /** QP reaction, dual, w.r.t. fixed*/ 105 | }; 106 | 107 | #endif // QPOASES_SOLUTIONANALYSIS_HPP 108 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/README.txt: -------------------------------------------------------------------------------- 1 | ## 2 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 3 | ## Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 4 | ## 5 | ## qpOASES is free software; you can redistribute it and/or 6 | ## modify it under the terms of the GNU Lesser General Public 7 | ## License as published by the Free Software Foundation; either 8 | ## version 2.1 of the License, or (at your option) any later version. 9 | ## 10 | ## qpOASES is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | ## Lesser General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Lesser General Public 16 | ## License along with qpOASES; if not, write to the Free Software 17 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | ## 19 | 20 | 21 | 22 | INTRODUCTION 23 | ============= 24 | 25 | qpOASES is an open-source C++ implementation of the recently proposed 26 | online active set strategy (see [1], [2]), which was inspired by important 27 | observations from the field of parametric quadratic programming. It has 28 | several theoretical features that make it particularly suited for model 29 | predictive control (MPC) applications. 30 | 31 | The software package qpOASES implements these ideas and has already been 32 | successfully used for closed-loop control of a real-world Diesel engine [3]. 33 | 34 | 35 | References: 36 | 37 | [1] H.J. Ferreau. An Online Active Set Strategy for Fast Solution of 38 | Parametric Quadratic Programs with Applications to Predictive Engine Control. 39 | Diplom thesis, University of Heidelberg, 2006. 40 | 41 | [2] H.J. Ferreau, H.G. Bock, M. Diehl. An online active set strategy to 42 | overcome the limitations of explicit MPC. International Journal of Robust 43 | and Nonlinear Control, 18 (8), pp. 816-830, 2008. 44 | 45 | [3] H.J. Ferreau, P. Ortner, P. Langthaler, L. del Re, M. Diehl. Predictive 46 | Control of a Real-World Diesel Engine using an Extended Online Active Set 47 | Strategy. Annual Reviews in Control, 31 (2), pp. 293-301, 2007. 48 | 49 | 50 | 51 | GETTING STARTED 52 | ================ 53 | 54 | 1. For installation, usage and additional information on this software package 55 | see the qpOASES User's Manual located at ./DOC/manual.pdf! 56 | 57 | 58 | 2. The file ./LICENSE.txt contains a copy of the GNU Lesser General Public 59 | License. Please read it carefully before using qpOASES! 60 | 61 | 62 | 3. The whole software package can be downloaded from 63 | 64 | http://homes.esat.kuleuven.be/~optec/software/qpOASES/ 65 | 66 | On this webpage you will also find a list of frequently asked questions. 67 | 68 | 69 | 70 | CONTACT THE AUTHORS 71 | ==================== 72 | 73 | If you have got questions, remarks or comments on qpOASES 74 | please contact the main author: 75 | 76 | Hans Joachim Ferreau 77 | Katholieke Universiteit Leuven 78 | Department of Electrical Engineering (ESAT) 79 | Kasteelpark Arenberg 10, bus 2446 80 | B-3001 Leuven-Heverlee, Belgium 81 | 82 | Phone: +32 16 32 03 63 83 | E-mail: joachim.ferreau@esat.kuleuven.be 84 | qpOASES@esat.kuleuven.be 85 | 86 | Also bug reports and source code extensions are most welcome! 87 | 88 | 89 | 90 | ## 91 | ## end of file 92 | ## 93 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/SRC/Bounds.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/Bounds.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Implementation of inlined member functions of the Bounds class designed 31 | * to manage working sets of bounds within a QProblem. 32 | */ 33 | 34 | 35 | /***************************************************************************** 36 | * P U B L I C * 37 | *****************************************************************************/ 38 | 39 | /* 40 | * g e t N V 41 | */ 42 | inline int Bounds::getNV( ) const 43 | { 44 | return nV; 45 | } 46 | 47 | 48 | /* 49 | * g e t N F X 50 | */ 51 | inline int Bounds::getNFV( ) const 52 | { 53 | return nFV; 54 | } 55 | 56 | 57 | /* 58 | * g e t N B V 59 | */ 60 | inline int Bounds::getNBV( ) const 61 | { 62 | return nBV; 63 | } 64 | 65 | 66 | /* 67 | * g e t N U V 68 | */ 69 | inline int Bounds::getNUV( ) const 70 | { 71 | return nUV; 72 | } 73 | 74 | 75 | 76 | /* 77 | * s e t N F X 78 | */ 79 | inline returnValue Bounds::setNFV( int n ) 80 | { 81 | nFV = n; 82 | return SUCCESSFUL_RETURN; 83 | } 84 | 85 | 86 | /* 87 | * s e t N B V 88 | */ 89 | inline returnValue Bounds::setNBV( int n ) 90 | { 91 | nBV = n; 92 | return SUCCESSFUL_RETURN; 93 | } 94 | 95 | 96 | /* 97 | * s e t N U V 98 | */ 99 | inline returnValue Bounds::setNUV( int n ) 100 | { 101 | nUV = n; 102 | return SUCCESSFUL_RETURN; 103 | } 104 | 105 | 106 | /* 107 | * g e t N F R 108 | */ 109 | inline int Bounds::getNFR( ) 110 | { 111 | return free.getLength( ); 112 | } 113 | 114 | 115 | /* 116 | * g e t N F X 117 | */ 118 | inline int Bounds::getNFX( ) 119 | { 120 | return fixed.getLength( ); 121 | } 122 | 123 | 124 | /* 125 | * g e t F r e e 126 | */ 127 | inline Indexlist* Bounds::getFree( ) 128 | { 129 | return &free; 130 | } 131 | 132 | 133 | /* 134 | * g e t F i x e d 135 | */ 136 | inline Indexlist* Bounds::getFixed( ) 137 | { 138 | return &fixed; 139 | } 140 | 141 | 142 | /* 143 | * end of file 144 | */ 145 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/SRC/Constraints.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/Constraints.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Declaration of inlined member functions of the Constraints class designed 31 | * to manage working sets of constraints within a QProblem. 32 | */ 33 | 34 | 35 | 36 | /***************************************************************************** 37 | * P U B L I C * 38 | *****************************************************************************/ 39 | 40 | /* 41 | * g e t N C 42 | */ 43 | inline int Constraints::getNC( ) const 44 | { 45 | return nC; 46 | } 47 | 48 | 49 | /* 50 | * g e t N E C 51 | */ 52 | inline int Constraints::getNEC( ) const 53 | { 54 | return nEC; 55 | } 56 | 57 | 58 | /* 59 | * g e t N I C 60 | */ 61 | inline int Constraints::getNIC( ) const 62 | { 63 | return nIC; 64 | } 65 | 66 | 67 | /* 68 | * g e t N U C 69 | */ 70 | inline int Constraints::getNUC( ) const 71 | { 72 | return nUC; 73 | } 74 | 75 | 76 | /* 77 | * s e t N E C 78 | */ 79 | inline returnValue Constraints::setNEC( int n ) 80 | { 81 | nEC = n; 82 | return SUCCESSFUL_RETURN; 83 | } 84 | 85 | 86 | /* 87 | * s e t N I C 88 | */ 89 | inline returnValue Constraints::setNIC( int n ) 90 | { 91 | nIC = n; 92 | return SUCCESSFUL_RETURN; 93 | } 94 | 95 | 96 | /* 97 | * s e t N U C 98 | */ 99 | inline returnValue Constraints::setNUC( int n ) 100 | { 101 | nUC = n; 102 | return SUCCESSFUL_RETURN; 103 | } 104 | 105 | 106 | /* 107 | * g e t N A C 108 | */ 109 | inline int Constraints::getNAC( ) 110 | { 111 | return active.getLength( ); 112 | } 113 | 114 | 115 | /* 116 | * g e t N I A C 117 | */ 118 | inline int Constraints::getNIAC( ) 119 | { 120 | return inactive.getLength( ); 121 | } 122 | 123 | 124 | /* 125 | * g e t A c t i v e 126 | */ 127 | inline Indexlist* Constraints::getActive( ) 128 | { 129 | return &active; 130 | } 131 | 132 | 133 | /* 134 | * g e t I n a c t i v e 135 | */ 136 | inline Indexlist* Constraints::getInactive( ) 137 | { 138 | return &inactive; 139 | } 140 | 141 | 142 | /* 143 | * end of file 144 | */ 145 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/SRC/CyclingManager.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/CyclingManager.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Implementation of inlined member functions of the CyclingManager class 31 | * designed to detect and handle possible cycling during QP iterations. 32 | * 33 | */ 34 | 35 | 36 | /***************************************************************************** 37 | * P U B L I C * 38 | *****************************************************************************/ 39 | 40 | /* 41 | * i s C y c l i n g D e t e c t e d 42 | */ 43 | inline BooleanType CyclingManager::isCyclingDetected( ) const 44 | { 45 | return cyclingDetected; 46 | } 47 | 48 | 49 | /* 50 | * end of file 51 | */ 52 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/SRC/Indexlist.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/Indexlist.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Implementation of inlined member functions of the Indexlist class designed 31 | * to manage index lists of constraints and bounds within a QProblem_SubjectTo. 32 | */ 33 | 34 | 35 | 36 | /***************************************************************************** 37 | * P U B L I C * 38 | *****************************************************************************/ 39 | 40 | /* 41 | * g e t N u m b e r 42 | */ 43 | inline int Indexlist::getNumber( int physicalindex ) const 44 | { 45 | /* consistency check */ 46 | if ( ( physicalindex < 0 ) || ( physicalindex > length ) ) 47 | return -RET_INDEXLIST_OUTOFBOUNDS; 48 | 49 | return number[physicalindex]; 50 | } 51 | 52 | 53 | /* 54 | * g e t L e n g t h 55 | */ 56 | inline int Indexlist::getLength( ) 57 | { 58 | return length; 59 | } 60 | 61 | 62 | /* 63 | * g e t L a s t N u m b e r 64 | */ 65 | inline int Indexlist::getLastNumber( ) const 66 | { 67 | return number[last]; 68 | } 69 | 70 | 71 | /* 72 | * g e t L a s t N u m b e r 73 | */ 74 | inline BooleanType Indexlist::isMember( int _number ) const 75 | { 76 | if ( getIndex( _number ) >= 0 ) 77 | return BT_TRUE; 78 | else 79 | return BT_FALSE; 80 | } 81 | 82 | 83 | /* 84 | * end of file 85 | */ 86 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/SRC/MessageHandling.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/MessageHandling.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Implementation of inlined member functions of the MessageHandling class. 31 | */ 32 | 33 | 34 | 35 | /***************************************************************************** 36 | * P U B L I C * 37 | *****************************************************************************/ 38 | 39 | /* 40 | * g e t E r r o r V i s i b i l i t y S t a t u s 41 | */ 42 | inline VisibilityStatus MessageHandling::getErrorVisibilityStatus( ) const 43 | { 44 | return errorVisibility; 45 | } 46 | 47 | 48 | /* 49 | * g e t W a r n i n g V i s i b i l i t y S t a t u s 50 | */ 51 | inline VisibilityStatus MessageHandling::getWarningVisibilityStatus( ) const 52 | { 53 | return warningVisibility; 54 | } 55 | 56 | 57 | /* 58 | * g e t I n f o V i s i b i l i t y S t a t u s 59 | */ 60 | inline VisibilityStatus MessageHandling::getInfoVisibilityStatus( ) const 61 | { 62 | return infoVisibility; 63 | } 64 | 65 | 66 | /* 67 | * g e t O u t p u t F i l e 68 | */ 69 | inline myFILE* MessageHandling::getOutputFile( ) const 70 | { 71 | return outputFile; 72 | } 73 | 74 | 75 | /* 76 | * g e t E r r o r C o u n t 77 | */ 78 | inline int MessageHandling::getErrorCount( ) const 79 | { 80 | return errorCount; 81 | } 82 | 83 | 84 | /* 85 | * s e t E r r o r V i s i b i l i t y S t a t u s 86 | */ 87 | inline void MessageHandling::setErrorVisibilityStatus( VisibilityStatus _errorVisibility ) 88 | { 89 | errorVisibility = _errorVisibility; 90 | } 91 | 92 | 93 | /* 94 | * s e t W a r n i n g V i s i b i l i t y S t a t u s 95 | */ 96 | inline void MessageHandling::setWarningVisibilityStatus( VisibilityStatus _warningVisibility ) 97 | { 98 | warningVisibility = _warningVisibility; 99 | } 100 | 101 | 102 | /* 103 | * s e t I n f o V i s i b i l i t y S t a t u s 104 | */ 105 | inline void MessageHandling::setInfoVisibilityStatus( VisibilityStatus _infoVisibility ) 106 | { 107 | infoVisibility = _infoVisibility; 108 | } 109 | 110 | 111 | /* 112 | * s e t O u t p u t F i l e 113 | */ 114 | inline void MessageHandling::setOutputFile( myFILE* _outputFile ) 115 | { 116 | outputFile = _outputFile; 117 | } 118 | 119 | 120 | /* 121 | * s e t E r r o r C o u n t 122 | */ 123 | inline returnValue MessageHandling::setErrorCount( int _errorCount ) 124 | { 125 | if ( _errorCount >= 0 ) 126 | { 127 | errorCount = _errorCount; 128 | return SUCCESSFUL_RETURN; 129 | } 130 | else 131 | return RET_INVALID_ARGUMENTS; 132 | } 133 | 134 | 135 | /* 136 | * end of file 137 | */ 138 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/SRC/SubjectTo.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * \file SRC/SubjectTo.ipp 26 | * \author Hans Joachim Ferreau 27 | * \version 1.3embedded 28 | * \date 2007-2008 29 | * 30 | * Implementation of the inlined member functions of the SubjectTo class 31 | * designed to manage working sets of constraints and bounds within a QProblem. 32 | */ 33 | 34 | 35 | /***************************************************************************** 36 | * P U B L I C * 37 | *****************************************************************************/ 38 | 39 | 40 | /* 41 | * g e t T y p e 42 | */ 43 | inline SubjectToType SubjectTo::getType( int i ) const 44 | { 45 | if ( ( i >= 0 ) && ( i < size ) ) 46 | return type[i]; 47 | else 48 | return ST_UNKNOWN; 49 | } 50 | 51 | 52 | /* 53 | * g e t S t a t u s 54 | */ 55 | inline SubjectToStatus SubjectTo::getStatus( int i ) const 56 | { 57 | if ( ( i >= 0 ) && ( i < size ) ) 58 | return status[i]; 59 | else 60 | return ST_UNDEFINED; 61 | } 62 | 63 | 64 | /* 65 | * s e t T y p e 66 | */ 67 | inline returnValue SubjectTo::setType( int i, SubjectToType value ) 68 | { 69 | if ( ( i >= 0 ) && ( i < size ) ) 70 | { 71 | type[i] = value; 72 | return SUCCESSFUL_RETURN; 73 | } 74 | else 75 | return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); 76 | } 77 | 78 | 79 | /* 80 | * s e t S t a t u s 81 | */ 82 | inline returnValue SubjectTo::setStatus( int i, SubjectToStatus value ) 83 | { 84 | if ( ( i >= 0 ) && ( i < size ) ) 85 | { 86 | status[i] = value; 87 | return SUCCESSFUL_RETURN; 88 | } 89 | else 90 | return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); 91 | } 92 | 93 | 94 | /* 95 | * s e t N o L o w e r 96 | */ 97 | inline void SubjectTo::setNoLower( BooleanType _status ) 98 | { 99 | noLower = _status; 100 | } 101 | 102 | 103 | /* 104 | * s e t N o U p p e r 105 | */ 106 | inline void SubjectTo::setNoUpper( BooleanType _status ) 107 | { 108 | noUpper = _status; 109 | } 110 | 111 | 112 | /* 113 | * i s N o L o w e r 114 | */ 115 | inline BooleanType SubjectTo::isNoLower( ) const 116 | { 117 | return noLower; 118 | } 119 | 120 | 121 | /* 122 | * i s N o L o w e r 123 | */ 124 | inline BooleanType SubjectTo::isNoUpper( ) const 125 | { 126 | return noUpper; 127 | } 128 | 129 | 130 | /* 131 | * end of file 132 | */ 133 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/SRC/Utils.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of qpOASES. 3 | * 4 | * qpOASES -- An Implementation of the Online Active Set Strategy. 5 | * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 6 | * 7 | * qpOASES is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * qpOASES is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with qpOASES; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | */ 22 | 23 | 24 | 25 | /** 26 | * \file SRC/Utils.ipp 27 | * \author Hans Joachim Ferreau 28 | * \version 1.3embedded 29 | * \date 2007-2008 30 | * 31 | * Implementation of some inlined utilities for working with the different QProblem 32 | * classes. 33 | */ 34 | 35 | 36 | 37 | /* 38 | * g e t A b s 39 | */ 40 | inline real_t getAbs( real_t x ) 41 | { 42 | if ( x < 0.0 ) 43 | return -x; 44 | else 45 | return x; 46 | } 47 | 48 | 49 | /* 50 | * end of file 51 | */ 52 | -------------------------------------------------------------------------------- /robot/acado/export_MPC/qpoases/VERSIONS.txt: -------------------------------------------------------------------------------- 1 | ## 2 | ## qpOASES -- An Implementation of the Online Active Set Strategy. 3 | ## Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved. 4 | ## 5 | ## qpOASES is free software; you can redistribute it and/or 6 | ## modify it under the terms of the GNU Lesser General Public 7 | ## License as published by the Free Software Foundation; either 8 | ## version 2.1 of the License, or (at your option) any later version. 9 | ## 10 | ## qpOASES is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | ## Lesser General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Lesser General Public 16 | ## License along with qpOASES; if not, write to the Free Software 17 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | ## 19 | 20 | 21 | 22 | VERSION HISTORY 23 | =============== 24 | 25 | 1.3embedded (last updated on 30th April 2009): 26 | ----------------------------------------------------------------------- 27 | 28 | + Re-programming of internal memory management to avoid dynamic memory allocations 29 | + Most #ifdef directives removed 30 | + Almost all type definitions gathered within INCLUDE/Types.hpp 31 | + Irrelevant functionality removed (like the SQProblem class, functionality 32 | for loading data from files or the SCILAB interface) 33 | + Replacement of all doubles by real_t 34 | + Introduction of define "PC_DEBUG" for switching off all print functions 35 | + stdio.h was made optional, string.h is no longer needed 36 | + relative paths removed from #include directives 37 | + made auxiliary objects locally static within solveInitialQP() 38 | + Matlab interface fixed for single precision 39 | + New return value -2 from Legacy wrapper added to Matlab/Simulink interfaces 40 | + KKT optimality check moved into QProblem(B) class, SolutionAnalysis class removed 41 | 42 | 43 | 1.3 (released on 2nd June 2008, last updated on 19th June 2008): 44 | ----------------------------------------------------------------------- 45 | 46 | + Implementation of "initialised homotopy" concept 47 | + Addition of the SolutionAnalysis class 48 | + Utility functions for solving test problems in OQP format added 49 | + Flexibility of Matlab(R) interface enhanced 50 | + Major source code cleanup 51 | (Attention: a few class names and calling interfaces have changed!) 52 | 53 | 54 | 55 | 1.2 (released on 9th October 2007): 56 | ----------------------------------------------------------------------- 57 | 58 | + Special treatment of diagonal Hessians 59 | + Improved infeasibility detection 60 | + Further improved Matlab(R) interface 61 | + Extended Simulink(R) interface 62 | + scilab interface added 63 | + Code cleanup and several bugfixes 64 | 65 | 66 | 67 | 1.1 (released on 8th July 2007): 68 | -------------------------------- 69 | 70 | + Implementation of the QProblemB class 71 | + Basic implementation of the SQProblem class 72 | + Improved Matlab(R) interface 73 | + Enabling/Disabling of constraints introduced 74 | + Several bugfixes 75 | 76 | 77 | 78 | 1.0 (released on 17th April 2007): 79 | ---------------------------------- 80 | 81 | Initial release. 82 | 83 | 84 | 85 | ## 86 | ## end of file 87 | ## 88 | -------------------------------------------------------------------------------- /robot/forces/dynamics.m: -------------------------------------------------------------------------------- 1 | function dx = dynamics(x,u) 2 | % 2-link planar manipulator dynamics 3 | th1 = x(1); 4 | th1d = x(2); 5 | th2 = x(3); 6 | th2d = x(4); 7 | tau1 = x(5); 8 | tau2 = x(6); 9 | 10 | tau1r = u(1); 11 | tau2r = u(2); 12 | dx = zeros(6,1); 13 | mM1 = 0.3; 14 | mM2 = 0.3; 15 | kr1 = 1.0; 16 | kr2 = 1.0; 17 | rM1 = 0.05; 18 | rM2 = 0.05; 19 | Im1 = 1/2*mM1*rM1*rM1; 20 | Im2 = 1/2*mM2*rM2*rM2; 21 | 22 | ml1 = 3.0; 23 | ml2 = 3.0; 24 | l1 = 1.0; 25 | l2 = 1.0; 26 | Il1 = 1.0/12.0*ml1*l1*l1; 27 | Il2 = 1.0/12.0*ml2*l2*l2; 28 | % Il1 = 1.0/12.0*ml1*ml1*l1*l1; 29 | % Il2 = 1.0/12.0*ml2*ml2*l2*l2; 30 | a1 = l1/2.0; 31 | a2 = l2/2.0; 32 | 33 | g = 9.81; 34 | 35 | alpha_1 = Il1 + ml1*l1*l1 + kr1*kr1*Im1 + Il2 + ml2*(a1*a1 + l2*l2 + 2*a1*l2*cos(th2) + Im2 + mM2*a1*a1); 36 | alpha_2 = Il2 + ml2*(l2*l2 + a1*l2*cos(th2)) + kr2*Im2; 37 | alpha_3 = -2.0*ml2*a1*l2*sin(th2); 38 | alpha_4 = -ml2*a1*l2*sin(th2); 39 | K_alpha = (ml1*l1 + mM2*a1 + ml2*a1)*g*cos(th1) + ml2*l2*g*cos(th1 + th2); 40 | 41 | beta_1 = Il2 + ml2*(l2*l2 + a1*l2*cos(th2)) + kr2*Im2; 42 | beta_2 = Il2 + ml2*l2*l2 + kr2*kr2*Im2; 43 | beta_3 = ml2*a1*l2*sin(th2); 44 | K_beta = ml2*l2*g*cos(th1 + th2); 45 | 46 | theta1dd_exp = 1.0/(alpha_1 - alpha_2*beta_1/beta_2) * (alpha_2/beta_2 * (K_beta + beta_3*th1d*th1d - tau2) - alpha_3*th1d*th2d - alpha_4*th2d - K_alpha + tau1); 47 | 48 | dx = [ th1d; 49 | theta1dd_exp; 50 | th2d; 51 | 1.0/beta_2*(tau2 - beta_1*theta1dd_exp - beta_3*th1d*th1d - K_beta); 52 | tau1r; 53 | tau2r ]; 54 | end --------------------------------------------------------------------------------