(Jetson Project#15)Implementing Cartographer SLAM_근데 에러를 곁들인

mseokq23·2024년 11월 26일
0
post-thumbnail

Part 8: Implementing Cartographer SLAM

8.1. Install Cartographer ROS
1. Install Dependencies:

sudo apt-get update
sudo apt-get install -y python3-wstool python3-rosdep ninja-build stow
  1. Create a New Workspace for Cartographer:
mkdir -p ~/cartographer_ws/src
cd ~/cartographer_ws
  1. Initialize wstool:
wstool init src
  1. Merge Cartographer's ROS Installation:
wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall
  1. Update the Workspace:
wstool update -t src
  1. Install Protocol Buffers (If Necessary):
sudo apt-get install -y libprotobuf-dev protobuf-compiler
  1. Initialize and Update rosdep:
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=noetic -y

But, error..... si

errored at "libabsl-dev"

Solution: Building and Installing Abseil C++ (abseil-cpp)

Step 1: Install Necessary Build Tools and Dependencies

First, ensure that you have all the necessary tools and dependencies installed:

sudo apt-get update
sudo apt-get install -y \
  build-essential \
  ninja-build \
  stow \
  git \
  cmake \
  libcairo2-dev \
  libpango1.0-dev \
  liblua5.3-dev \
  libboost-all-dev \
  libgflags-dev \
  libgoogle-glog-dev \
  libprotobuf-dev \
  protobuf-compiler \
  libceres-dev \
  python3-sphinx \
  libeigen3-dev \
  libjsoncpp-dev \
  python3-wstool \
  python3-rosdep \
  python3-catkin-tools \
  ros-noetic-tf2-eigen \
  ros-noetic-tf2-sensor-msgs

Step 2: Download Abseil C++ Source Code

Clone the Abseil C++ repository from GitHub:

cd ~
git clone https://github.com/abseil/abseil-cpp.git

Step 3: Build and Install Abseil C++

Build and install abseil-cpp:

cd abseil-cpp
mkdir build && cd build
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
sudo make install

Explanation:

  • CMAKE_POSITION_INDEPENDENT_CODE=ON ensures that position-independent code is generated, which is necessary for shared libraries.
  • sudo make install installs the library files to /usr/local/lib and header files to /usr/local/include/absl.

Step 4: Update Library Cache

After installing new libraries, update the system's library cache:

sudo ldconfig

Step 5: Verify Abseil Installation

Check that the Abseil libraries are installed:

ls /usr/local/lib/libabsl_*.a

You should see several libabsl_*.a files listed.

Step6: At "cartograher", edit "package.xml"

cd ~/cartographer_ws/src/cartographer
ls
nano package.xml
  • edit package.xml

remove this part.

<depend>libabsl-dev</depend>

Full script.


<?xml version="1.0"?>
<!--
  Copyright 2016 The Cartographer Authors

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<package format="3">
  <name>cartographer</name>
  <version>2.0.0</version>
  <description>
    Cartographer is a system that provides real-time simultaneous localization
    and mapping (SLAM) in 2D and 3D across multiple platforms and sensor
    configurations.
  </description>
  <maintainer email="cartographer-owners@googlegroups.com">
    The Cartographer Authors
  </maintainer>
  <license>Apache 2.0</license>

  <url>https://github.com/cartographer-project/cartographer</url>

  <author email="google-cartographer@googlegroups.com">
    The Cartographer Authors
  </author>

  <buildtool_depend>cmake</buildtool_depend>

  <build_depend>git</build_depend>
  <build_depend>google-mock</build_depend>
  <build_depend>gtest</build_depend>
  <build_depend>python3-sphinx</build_depend>

  <depend>libboost-iostreams-dev</depend>
  <depend>eigen</depend>
  <!-- depend>libabsl-dev/depend -->
  <depend>libcairo2-dev</depend>
  <depend>libceres-dev</depend>
  <depend>libgflags-dev</depend>
  <depend>libgoogle-glog-dev</depend>
  <depend>lua5.2-dev</depend>
  <depend>protobuf-dev</depend>

  <export>
    <build_type>cmake</build_type>
  </export>
</package>

Step7: Reproceed with Cartographer Installation

cd ~/cartographer_ws

rosdep install --from-paths src --ignore-src --rosdistro=noetic -y --skip-keys=libabsl-dev
catkin_make_isolated --install --use-ninja

..... Erorr again...

0개의 댓글