机器人开发常用三方库安装

基于ubuntu22.04安装矩阵、优化、图像、李群李代数

gcc

c++编译器

sudo apt-get install gcc

cmake

下载源码编译安装 https://cmake.org/download/

tar -zxvf cmake-3.25.1
cd cmake-3.25.1
./bootstrap
make
sudo make install

cmake --version #查看cmake版本 
which cmake #查看cmake路径

Eigen3

矩阵计算

sudo apt-get install libeigen3-dev
sudo ln -s /usr/local/include/eigen3 /usr/include #修改映射 

g2o

非线性优化

git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
mkdir build
cd build
cmake ..
make
sudo make install

ceres

非线性优化
https://github.com/ceres-solver/ceres-solver/archive/refs/tags/2.0.0.tar.gz

#安装相关依赖
sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3 libgflags-dev libgoogle-glog-dev libgtest-dev
#安装ceres(使用2.0版本没有eigen路径找不到问题)
tar -zxvf ceres-solver-2.0.0.tar.gz 
cd ceres-solver-2.0.0/
mkdir build
cd build
cmake ..
make
sudo make install
# 安装成功查看
/usr/local/include/ceres下找到Ceres的头文件
/usr/local/lib/下找到名为libceres.a的库文件

opencv+opencv_contrib

图像处理
https://github.com/opencv/opencv/archive/4.7.0.zip
https://github.com/opencv/opencv_contrib/archive/refs/tags/4.7.0.tar.gz

#依赖安装
sudo apt install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev libtiff4.dev libswscale-dev libjasper-dev
#解压
unzip opencv-4.7.0
tar -zxvf opencv_contrib-4.7.0.tar.gz
#拷贝
cp -r opencv_contrib-4.7.0 opencv-4.7.0
# 编译
mkdir -p build && cd build
cmake  ..
cmake --build .
#安装
sudo make install # 默认安装路径为/user/local/lib
#修改两个配置文件,尾行新增
sudo gedit /etc/ld.so.conf
include /user/local/lib 

sudo gedit /etc/bash.bashrc
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
source /etc/bash.bashrc
# 查看版本
pkg-config opencv –modversion
# 添加映射方便使用
sudo ln -s /usr/local/include/opencv4/opencv2 /usr/local/include/opencv2
#测试
cd samples
cd cpp
cd example_cmake
cmake .
make
./opencv_example
  • ffmpeg
sudo apt install ffmpeg
  • VTK
    https://www.vtk.org/files/release/9.2/VTK-9.2.2.tar.gz
tar -zxvf VTK-9.2.2.tar.gz
cd VTK-9.2.2/
mkdir build
cmake ../ -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DVTK_WRAP_PYTHON=O
make
sudo make install

Pangolin

三维可视化工具
git clone https://github.com/stevenlovegrove/Pangolin.git

# 依赖
sudo apt install libglew-dev cmake libboost-dev libboost-thread-dev libboost-filesystem-dev libeigen3-dev
# 安装
cd Pangolin/
mkdir build
cd build
cmake ..
make
sudo make install

pcl

点云处理

sudo apt install libpcl-dev

你可能感兴趣的:(机器人之旅,机器人,opencv,计算机视觉)