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:
- mkdir build && cd build
- cmake …
- make
- sudo make install
Install abseil's dynamic library: you can delete the previous build file and rebuild
- mkdir build && cd build
- cmake … -DBUILD_SHARED_LIBS=ON
- make
- 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