小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
Fishbot-humble源码编译错误
-
编译到cartographer_ros时报错
-
@2761607729 注意版本,另外最好复制粘贴提问
-
@小鱼 就fishbot的代码https://github.com/fishros/fishbot/tree/humble,humble版本的
-
-
-
@2761607729 在 Fishbot-humble源码编译错误 中说:
请手动下载各个仓库源码,指定humble相关分支:
[submodule "src/navigation"]
path = src/navigation
url = http://github.fishros.org/https://github.com/fishros/navigation2.git
branch = main
[submodule "src/cartographer_code/cartographer"]
path = src/cartographer_code/cartographer
url = http://github.fishros.org/https://github.com/ros2/cartographer.git
[submodule "src/cartographer_code/cartographer_ros"]
path = src/cartographer_code/cartographer_ros
url = http://github.fishros.org/https://github.com/ros2/cartographer_ros.git -
@小鱼 我又重新安装了一遍,先是git clone --recursive https://github.com/fishros/fishbot.git -b humble
然后按照你的提示将.gitmodules文件改成
[submodule "src/navigation"]
path = src/navigation
url = http://github.fishros.org/https://github.com/fishros/navigation2.git
branch = humble[submodule "src/cartographer_code/cartographer"]
path = src/cartographer_code/cartographer
url = http://github.fishros.org/https://github.com/ros2/cartographer.git
branch = humble[submodule "src/cartographer_code/cartographer_ros"]
path = src/cartographer_code/cartographer_ros
url = http://github.fishros.org/https://github.com/ros2/cartographer_ros.git
branch = humble
接着在工作空间运行git summodule init 和 git submodule update --recursive更新子模块的内容,在conlcon build编译还是报错,还是同样的情况,但是在colcon build编译前我运行那个rosdep install --from-paths src -y
也是报错报ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
fishbot_description: Cannot locate rosdep definition for [ament_python]
我就直接跳过了,不知道有没有影响 -
@2761607729 rosdep这步过不去还是有影响的,另外你要到对应的github仓库去看看有没有humble分支
-
@小鱼 我试了好多次都没解决,那个rosdep提示缺少ament_python的依赖项,我也给安装上了,但是还是报错。我根据这个报错的原因,将cartographer_ros包下面的ros_log_sink.cpp文件中的
const std::string message_string = ::google::LogSink::ToString(
severity, GetBasename(filename), line, tm_time, message, message_len);
中的tm_time改成*tm_time后编译通过了 -
@2761607729 ok,看样子还是源码bug,我以为是下错版本导致的,源码最好切换到一个release的版本
-
@小鱼 那意思是这个humble版本还是有问题的吗,我编译后运行第一个指令显示机器人模型ros2 launch fishbot_description display_rviz2.launch.py,看不见机器人,但是添加tf坐标系有显示。
-
@2761607729 你需要学一个动手学ROS2,从仿真建模开始或者从头开始都可以