二次規划求解庫安裝教程


Eigen安裝

sudo apt-get install libeigen3-dev   #進行安裝

1、CppAD 安裝

sudo apt-get install cppad

CppAD需要調用系統中已經安裝好的優化求解器,如非線性優化器ipoptGurobiGLPK

2、Ipopt安裝

# How to install Ipopt on arm environment  

## Inatall CPPAD & Fortran   
$ sudo apt-get install cppad gfortran  

## Get ipopt source code   
Download Ipopt-3.12.8.tgz from https://www.coin-or.org/download/source/Ipopt/  
Untar the package and cd into the "Ipopt-3.12.8" folder  

## Step by step   
$ cd CUSTOM_PATH/Ipopt-3.12.8/ThirdParty/Blas  
$ ./get.Blas    
$ cd ../Lapack  
$ ./get.Lapack  
$ cd ../Mumps  
$ ./get.Mumps  
$ cd ../Metis  
$ ./get.Metis  
   
$ cd CUSTOM_PATH/Ipopt-3.12.8  
$ mkdir build  
$ cd build  
$ ../configure --build=arm-linux  
$ make -j4  
$ make install  
    
## Copy install files into specific directory 
$ cd CUSTOM_PATH/Ipopt-3.12.8/build  
$ sudo cp -a include/* /usr/include/.  
$ sudo cp -a lib/* /usr/lib/.  
  
## Trouble Shooting
If something wrong like: "redefinition of ‘bool CppAD::is_pod()"  
Modify the file:  
$ sudo gedit /usr/include/cppad/configure.hpp   
Change line from:  
define CPPAD_SIZE_T_NOT_UNSIGNED_INT 1  
to 
define CPPAD_SIZE_T_NOT_UNSIGNED_INT 0

 

# How to install Ipopt on x86 environment  

## Inatall CPPAD & Fortran  
$ sudo apt-get install cppad gfortran  
    
## Get ipopt source code    
Download Ipopt-3.12.8.tgz from https://www.coin-or.org/download/source/Ipopt/  
Untar the package and cd into the "Ipopt-3.12.8" folder  
  
## Step by step   
$ cd CUSTOM_PATH/Ipopt-3.12.8/ThirdParty/Blas  
$ ./get.Blas    
$ cd ../Lapack  
$ ./get.Lapack  
$ cd ../Mumps  
$ ./get.Mumps  
$ cd ../Metis  
$ ./get.Metis
$ cd ../ASL
$ ./get.ASL
   
$ cd CUSTOM_PATH/Ipopt-3.12.8  
$ mkdir build  
$ cd build  
$ ../configure  
$ make -j4  
$ make install  
    
## Copy install files into specific directory 
$ cd CUSTOM_PATH/Ipopt-3.12.8/build  
$ sudo cp -a include/* /usr/include/.  
$ sudo cp -a lib/* /usr/lib/.

3、osqp安裝

這里默認git的是最新版本,apollo默認用的是0.5.0版本,可以切換0.6.0。0.6.0更新了osqp_setup

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

  

4、osqp-eigen

git clone https://github.com/robotology/osqp-eigen.git
cd osqp-eigen
mkdir build
cd build
cmake -G "Unix Makefiles" ..
cmake --build .
make
sudo make install

  

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM