Cartographer does not want to download Abseil's alternative method when compiling

The principle is explained: download abseil on github, then compile this library separately, and then change the code of some cartographer and cartographer_ros.

detailed steps:

One: download abseil

Website: https://github.com/abseil/abseil-cpp .

Install abseil's static library:
  1. mkdir build && cd build
  2. cmake …
  3. make
  4. sudo make install
Install abseil's dynamic library: you can delete the previous build file and rebuild
  1. mkdir build && cd build
  2. cmake … -DBUILD_SHARED_LIBS=ON
  3. make
  4. sudo make install

Two: Change cartographer's CMakeList.txt file (2 places) and cartographer-config.cmake.in file (1 place)

CMakeList.txt first place:

find_package(Abseil REQUIRED) --> find_package(absl REQUIRED)

CMakeList.txt Item 2: # The default library file is standalone_absl

target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY}
absl::base
absl::synchronization
absl::strings
absl::flat_hash_map
absl::numeric
absl::flags)
然后重新编译即可

cartographer-config.cmake.in 1 place:

find_package(Abseil ${QUIET_OR_REQUIRED_OPTION}) Abseil 改为 absl

Three: Change cartographer_ros's CMakeList.txt, there are 2

The following are the same:
cartographer_ros and cartographer_rviz are the same:
find_package (Abseil REQUIRED)-> find_package (absl REQUIRED)
and then recompile
This experiment is verified and feasible

Welcome to exchange technical questions: QQ: 136841924

Published 51 original articles · Like 13 · Visitors 20,000+

Guess you like

Origin blog.csdn.net/windxf/article/details/103963934