Jeston agx xavier部署LOAM_LIVOX激光SLAM算法

准备工作

由于之前的agx的环境有点乱,为了能更好的部署LOAM_LIVOX算法,利用了虚拟机对agx进行了刷机。

安装OpenCV

由于LOAM需要的OpenCV版本较低,而jetson自带的版本为4.1.1,为了方便编译,所以安装了OpenCV 3.2.0,点击Source下载Opencv的压缩包。

Jeston agx xavier部署LOAM_LIVOX激光SLAM算法_第1张图片

 1.安装依赖环境

sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install pkg-config

2.编译安装

cd OpenCv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. 
make -j8
sudo make install

3.配置环境,将opencv的库加入路径

3.1 sudo gedit /etc/ld.so.conf 在文件末尾加入/usr/loacl/lib

3.2 sudo ldconfig

     sudo gedit /etc/bash.bashrc

文件末尾加入PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig export PKG_CONFIG_PATH

3.3 source /etc/bash.bashrc

4.验证安装

pkg-config opencv --modversion

注意:修改cv_bridge

 将标注的部分改为改成
set(_include_dirs "include;/usr/local/include;/usr/local/include/opencv")

Jeston agx xavier部署LOAM_LIVOX激光SLAM算法_第2张图片

 即可解决cv_bridge报错问题

开始进行部署

对ROS环境进行配置

sudo apt-get install ros-melodic-cv-bridge ros-melodic-tf ros-melodic-message-filters ros-melodic-image-transport

安装依赖

# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev libgflags-dev
# Use ATLAS for BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse and CXSparse (optional)
sudo apt-get install libsuitesparse-dev

解压、编译与安装

tar zxf ceres-solver-2.1.0.tar.gz
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver-2.1.0
make -j3
make test
sudo make install

安装PCL库

sudo apt install libpcl-dev

新建工作空间存放LOAM算法

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/hku-mars/loam_livox.git
cd ../
catkin_make
source ~/catkin_ws/devel/setup.bash

运行官方提供的rosbag包

roslaunch loam_livox rosbag.launch
rosbag play HKU_ZYM.bag

Jeston agx xavier部署LOAM_LIVOX激光SLAM算法_第3张图片

 Jeston agx xavier部署LOAM_LIVOX激光SLAM算法_第4张图片

 

你可能感兴趣的:(slam)