Nvidia Xavier NX install and test Cartographer

preface

Recently, we successfully installed and tested Google's open source laser slam algorithm Cartographer in Nvidia Xavier NX and Nvidia Xavier AGX, and recorded some pits in the process.

setup script

  1. First, install ROS. Note that Nvidia Xavier NX and Nvidia Xavier AGX are installed Ubuntu 18 04 system, so install the corresponding ROS version: ROS melody. Refer to ROS official website for installation tutorial.
    For most tutorials of Cartographer, please refer to the official website. The links are as follows:
    Cartographer official website

  2. Install dependent Libraries

sudo apt-get update
sudo apt-get install -y \
    clang \
    cmake \
    g++ \
    git \
    google-mock \
    libboost-all-dev \
    libcairo2-dev \
    libcurl4-openssl-dev \
    libeigen3-dev \
    libgflags-dev \
    libgoogle-glog-dev \
    liblua5.2-dev \
    libsuitesparse-dev \
    lsb-release \
    ninja-build \
    stow
  1. Install abseil
git clone https://github.com/abseil/abseil-cpp.git
cd abseil-cpp
git checkout d902eb869bcfacc1bad14933ed9af4bed006d481
mkdir build
cd build
cmake -G Ninja \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
  -DCMAKE_INSTALL_PREFIX=/usr/local/stow/absl \
  ..
ninja
sudo ninja install
cd /usr/local/stow
sudo stow absl

abseil is google's open source C + + base library. ninja is google's own compiler, which is faster. If the wall climbing software is not installed, sometimes the download will not come, or the download speed is very slow. You can consider downloading it on the Window platform and copying it to the Nvidia platform.

It's best to follow this installation step, otherwise it may cause problems. As shown below, compile cartographer_ Error prompted when ROS.

The process is as follows:

When I execute make and cmake, I first execute sudo cmake... / and sudo make sudo make install in the build folder. Later, I have a problem when I execute the cd /usr/local/stow sudo stow absl command, as shown below.

Therefore, the compilation conditions given on the official website should be added during compilation.

  1. Install Ceres
VERSION="1.13.0"

# Build and install Ceres.
git clone https://ceres-solver.googlesource.com/ceres-solver
cd ceres-solver
git checkout tags/${VERSION}
mkdir build
cd build
cmake .. -G Ninja -DCXX11=ON
ninja
CTEST_OUTPUT_ON_FAILURE=1 ninja test
sudo ninja install

Ceres I downloaded it from Github on the Window platform. Just download version 1.13.0.
5. Install proto3

VERSION="v3.4.1"

# Build and install proto3.
git clone https://github.com/google/protobuf.git
cd protobuf
git checkout tags/${VERSION}
mkdir build
cd build
cmake -G Ninja \
  -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
  -DCMAKE_BUILD_TYPE=Release \
  -Dprotobuf_BUILD_TESTS=OFF \
  ../cmake
ninja
sudo ninja install

protobuf(Google Protocol Buffers) is a tool library with efficient protocol data exchange format provided by Google (similar to Json), but compared with JSON, protobuf has higher conversion efficiency, and its time efficiency and space efficiency are 3-5 times that of JSON. Note to download the corresponding version.
I started with the following links:
protobuf


However, the installation did not succeed. Compile cartographer later_ When ROS, it is always prompted that the Protocol version is wrong. Later, according to the tutorial on the official website, the installation was successful at one time.
6. Install cartographer
It should be noted that the cartographer and cartographer should be installed_ In the order of ROS, cartographer should be installed first and then compiled_ Ross can, because cartographer_ Cartograph dependency. Note the version of cartographer and cartographer_ The version of ROS should be consistent. I compiled cartographer at the beginning_ During the process of ROS, some files of cartographer cannot be found, that is, the versions are not consistent. The error is shown in the following figure:

  1. Installing cartographer_ros

Final cartographer_ If ROS compilation is OK, cartographer is installed successfully.
8. Download the bag package and test it

bag can be downloaded from the link below.
bag package download address
Let's test the bag package.
Don't forget this step, otherwise you can't find the ros path.

echo "source ~/cartographer/cartographer_ros/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

Execute roslaunch.

roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag

Home is home path (~ /), bag_filename is the path where the bag package is located, and the software will automatically open Rviz to display the positioning and mapping tracks.

software package

I put the software I used to install cartographer in the following Baidu online disk link. The software package includes abseil, Ceres, proto3 and various versions of cartographer_ros and cartographer, vscode. I use the latest version of cartographer in my installation_ ROS and cartographer.
Extraction code: 1111.
Software package Baidu network disk address
The following is operation b0-2014-10-07-12-50-07 The mapping results of bag.

The following is running b0-2014-07-11-10-58-16 The mapping results of bag.

Keywords: slam

Added by nahla123 on Wed, 09 Feb 2022 15:29:53 +0200