cartographer_frontier_detection
source link: https://charon-cheung.github.io/2022/05/13/%E8%87%AA%E4%B8%BB%E6%8E%A2%E7%B4%A2/cartographer_frontier_detection/%E7%BC%96%E8%AF%91%20cartographer_frontier_detection/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
编译 cartographer_frontier_detection
这个作者是真懒,放到github就不管了,几个人在issue提出编译失败,他也不回复,我给他发邮件,他也不回复
删除cartographer/cmake/modules/FindAbseil.cmake
我对CMakeLists
进行了修改,主要是absl
相关,比如cartographer_frontier_detection\cartographer_frontier_detection\cartographer\CMakeLists.txt
将find_package(Abseil REQUIRED)
改为 find_package(absl REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY} standalone_absl)
改为
target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY}
absl::algorithm
absl::base
absl::debugging
absl::flat_hash_map
absl::memory
absl::meta
absl::numeric
absl::str_format
absl::strings
absl::synchronization
absl::time
absl::utility
)
最终仍然是这个报错
然后将cartographer-config.cmake.in
中的find_package(Abseil ${QUIET_OR_REQUIRED_OPTION})
改为 find_package(absl REQUIRED)
。 作者用absl
库的一些函数替代了carto::common
的函数,比如absl::MutexLock
代替carto::common::MutexLocker
如果是新安装的ubuntu,一般能编译通过了。如果之前已经装过cartographer了,cartographer_rviz
会出问题,Rviz插件Submaps
不正常。因为这次的插件和之前的安装的Submaps
插件是不同的,终端会报错:
[/rviz] wants topic /submap_list to have datatype/md5sum [cartographer_ros_msgs/SubmapList/73b1e412208f0787050395996f6143db], but our version has [cartographer_ros_msgs/SubmapList/853a6fd3598626d65ab60752cc4a6117]. Dropping connection
在Rviz里看不到地图,使用
rostopic echo
也看不到。 看上去这个报错的是cartographer_ros_msgs
没有编译好,其实编译已经成功,问题是Rviz插件只要执行
source ~/frontier_detection/devel_isolated/cartographer_ros_msgs/setup.zsh
然后使用echo就能看到
submap_list
的消息了,但是Rviz插件仍然失败,所以应该把这个插件改名称和类型,相当于编译新插件最终我在虚拟机上(刚装完ROS)运行成功了,红色的边界就是话题frontier_marker
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK