原因是ros2在安装一些库的时候,在ros2的路径下生成了cartographer,默认找到了ros下,导致的,把这些库删掉即可
kobe@kobe-NUC11PAHi7:/opt/ros/humble/include$ sudo rm -R cartographer
[sudo] kobe 的密码:
kobe@kobe-NUC11PAHi7:/opt/ros/humble/include$ sudo rm -R cartographer_ros
kobe@kobe-NUC11PAHi7:/opt/ros/humble/include$ sudo rm -R cartographer_ros_msgs/
kobe@kobe-NUC11PAHi7:/opt/ros/humble/lib$ sudo rm -R cartographer_ros/