Udacity Self-Driving Car Engineer Nanodegree 1:開發環境搭建


仿真器和源代碼

term2 && term3: https://github.com/udacity/self-driving-car-sim/releases 

Winodws 10 配置Udacity 開發環境

CarND-Term2 — GCC Setup on Windows 和  Udacity project setup in Visual Studio with uWebSockets 或者 本人轉自的

注意高版本的vcpkg,在同樣的操作下並不一定和博客中有一樣的結論。

Ubuntu 16.04 配置開發環境

官方 CarND-MPC-Quizzes 里面有 install-ubuntu-MPC.sh 文件針對 Cppad和Ipopt安裝配置,

#! /bin/bash
sudo apt-get update

# gfortran dependency
sudo apt-get install gfortran

# get unzip
sudo apt-get install unzip

# Ipopt: get, install, unzip
wget https://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.11.zip && unzip Ipopt-3.12.11.zip && rm Ipopt-3.12.11.zip
./install_ipopt.sh ./Ipopt-3.12.11

# CppAD
sudo apt-get install cppad

# Gnuplot
sudo apt-get install gnuplot

# python and matplotlib
sudo apt-get install python-matplotlib
sudo apt-get install python2.7-dev

uWebsockets 的安裝文件 install-ubuntu.sh 如下 

#! /bin/bash
sudo apt-get update
sudo apt-get install git libuv1-dev libssl-dev gcc g++ cmake make
git clone https://github.com/uWebSockets/uWebSockets 
cd uWebSockets
git checkout e94b6e1
mkdir build
cd build
cmake ..
make 
sudo make install
cd ../..
sudo ln -s /usr/lib64/libuWS.so /usr/lib/libuWS.so
sudo rm -r uWebSockets

 單獨安裝 Ipopt 參考install_ipopt.sh

# Pass the Ipopt source directory as the first argument
if [ -z $1 ]
then
    echo "Specifiy the location of the Ipopt source directory in the first argument."
    exit
fi
cd $1

prefix=/usr/local
srcdir=$PWD

echo "Building Ipopt from ${srcdir}"
echo "Saving headers and libraries to ${prefix}"

# BLAS
cd $srcdir/ThirdParty/Blas
./get.Blas
mkdir -p build && cd build
../configure --prefix=$prefix --disable-shared --with-pic
make install

# Lapack
cd $srcdir/ThirdParty/Lapack
./get.Lapack
mkdir -p build && cd build
../configure --prefix=$prefix --disable-shared --with-pic \
    --with-blas="$prefix/lib/libcoinblas.a -lgfortran"
make install

# ASL
cd $srcdir/ThirdParty/ASL
./get.ASL

# MUMPS
cd $srcdir/ThirdParty/Mumps
./get.Mumps

# build everything
cd $srcdir
./configure --prefix=$prefix coin_skip_warn_cxxflags=yes \
    --with-blas="$prefix/lib/libcoinblas.a -lgfortran" \
    --with-lapack=$prefix/lib/libcoinlapack.a
make
make test
make -j1 install

之后需要下載Ipopt源碼包

sudo apt-get install gfortran
sudo apt-get install unzip
wget https://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.11.zip && unzip Ipopt-3.12.11.zip && rm Ipopt-3.12.11.zip
sudo ./install_ipopt.sh Ipopt-3.12.11

安裝CppAD

sudo apt-get install cppad

編譯成功后,如果運行程序出現以下錯誤:

error while loading shared libraries: libcoinmumps.so.1: cannot open shared

對於這個錯誤,是因為系統是64位的,但是程序用到的某個32版本的庫。運行以下命令就解決了。

sudo apt-get update
sudo apt-get install lib32z1

 


免責聲明!

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



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