小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
[FishBot教程]7. FishBot-Nav2导航测试
-
@小鱼 小鱼,我第一步拿到 fishbot 源码后 colcon build 就失败了,能帮我看下问题出在哪儿吗?感谢感谢~
- Configuration : Ubuntu 22.04 humble + ros2
- issues 情景 + 尝试解决方案:
(1) 初始问题 (retry_test_1):
- 操作:按原教程使用
git clone https://github.com/fishros/fishbot.git -b v1.0.0 --depth=1 cd fishbot rosdepc install --from-paths src --ignore-src -y -r # 安装依赖 colcon build
-
结果:all packages 全部编译失败
--
(2) retry_test_2: -
操作:手动 download “ https://github.com/fishros/fishbot ” 的 humble 源码,后添加依赖,后 colcon build
-
结果:只有 “fishbot_description” package 编译成功,其它失败
--
(3) retry_test_3:
每个pkg 单独编译,结果 同(2)
--
(4) retry_test_4:
重装 ros2,后重复 “retry_test_1 / 2 / 3”中操作,结果与之前相同
--
(5) 思考:
我之前好像看到过 你标注过 catorgrapher 在 ubuntu 2004上测试ok了,但是没有提到在 ubuntu 2204上测试结果,会不会是这个原因?
--
但是我看到其他帖子里有个人刚开始也碰到我这个初始编译问题,他后续说重装ros2就解决了,但是我重装了并没有解决,是不是源码中还有哪些地方要根据实际情况修改下?
--另外报错有提到 ament_lint_auto_find_test_dependencies ,是不是依赖也出了问题,它检索不到所以无法编译?
3. Note: 下方所附为 "ros2重装" 后 "retry_test_2" 中的 "操作" 下 的结果
(base) ros2@ros2-virtual-machine:~/Desktop/d2lros2/chapt2/Julie_ws$ ls fishbot fishbot-1.0.0.zip map (base) ros2@ros2-virtual-machine:~/Desktop/d2lros2/chapt2/Julie_ws$ cd fishbot/ (base) ros2@ros2-virtual-machine:~/Desktop/d2lros2/chapt2/Julie_ws/fishbot$ ls doc README.md src (base) ros2@ros2-virtual-machine:~/Desktop/d2lros2/chapt2/Julie_ws/fishbot$ rosdepc install --from-paths src --ignore-src -y -r 您已经成功安装rosdepc,下面提示的用法中,请将rosdep替换为rosdepc使用~ 欢迎使用国内版rosdep之rosdepc,我是作者小鱼! 学习机器人,就关注《鱼香ROS》(公众号|B站|CSDN)! 小鱼rosdepc正式为您服务 #All required rosdeps installed successfully --------------------------------------------------------------------------- --------------------------------------------------------------------------- 小鱼科普:rosdep干什么用的?可以跳过吗?https://fishros.org.cn/forum/topic/2124 如果再使用过程中遇到任何问题,欢迎通过fishros.org.cn反馈,或者加入QQ交流群(139707339) (base) ros2@ros2-virtual-machine:~/Desktop/d2lros2/chapt2/Julie_ws/fishbot$ colcon build Starting >>> fishbot_bringup Starting >>> fishbot_cartographer Starting >>> fishbot_description Starting >>> fishbot_interfaces Finished <<< fishbot_description [3.93s] Starting >>> fishbot_navigation2 --- stderr: fishbot_navigation2 Traceback (most recent call last): File "/opt/ros/humble/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 22, in <module> from catkin_pkg.package import parse_package_string ModuleNotFoundError: No module named 'catkin_pkg' CMake Error at /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:95 (message): execute_process(/home/ros2/miniconda3/bin/python3 /opt/ros/humble/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py /home/ros2/Desktop/d2lros2/chapt2/Julie_ws/fishbot/src/fishbot_navigation2/package.xml /home/ros2/Desktop/d2lros2/chapt2/Julie_ws/fishbot/build/fishbot_navigation2/ament_cmake_core/package.cmake) returned error code 1 Call Stack (most recent call first): /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:49 (_ament_package_xml) /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake:31 (ament_package_xml) CMakeLists.txt:34 (ament_lint_auto_find_test_dependencies) --- Failed <<< fishbot_navigation2 [4.18s, exited with code 1] Aborted <<< fishbot_cartographer [8.20s] Aborted <<< fishbot_interfaces [7.96s] Aborted <<< fishbot_bringup [13.3s] Summary: 1 package finished [15.9s] 1 package failed: fishbot_navigation2 3 packages aborted: fishbot_bringup fishbot_cartographer fishbot_interfaces 4 packages had stderr output: fishbot_bringup fishbot_cartographer fishbot_interfaces fishbot_navigation2
-
-
@小鱼 谢谢小鱼,已经解决了
-
@小鱼 这个一键安装后的rosdepc还是需要初始化,但是我初始化的时候显示
-
@2934775495这样该怎么解决呢
-
鱼哥,我第三步会出现这种问题,是怎么回事啊
-
@2934775495 sudo apt install ros-humble-joint-state-publisher
-
@小鱼 已经解决了,但是后面启动导航出问题了,我改了.py文件的内容出现这个问题,我是在VScode里面打开一个终端进行colcon build的,不知道为什么不可以
-
@2934775495
又试了一遍,现在是这样子 -
明明有文件,为什么找不到包呢? -
@2916186745 不知道啊,很奇怪
-
@2916186745 目录搞错了,你应该在工作空间下构建和source
-
此回复已被删除! -
@2496480233 看看路径里是不是有中文
-
鱼哥,我这边跑导航测试那一步ros2 launch fishbot_navigation2 navigation2.launch.py的时候会出现这个问题,要怎么解决呢? -
@2934775495 按照要求,单独发帖提问下
-
@2934775495 我也有同样的问题
-
请问进行导航的时候 地图变成这个样子是怎么回事 怎么解决 -
@1032063747 什么一键安装?我也卡在这里了,请问可以分享一下处理办法吗?
-
@小鱼 在 [FishBot教程]7. FishBot-Nav2导航测试 中说:
ros2 launch fishbot_bringup fishbot_bringup.launch.py
eepdriving@deepdriving:~/fishbot$ ros2 launch fishbot_bringup fishbot_bringup.launch.py [INFO] [launch]: All log files can be found below /home/deepdriving/.ros/log/2024-05-11-15-55-53-146433-deepdriving-1888666 [INFO] [launch]: Default logging verbosity is set to INFO Task exception was never retrieved future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=PackageNotFoundError("package 'joint_state_publisher' not found, searching: ['/home/deepdriving/fishbot/install/fishbot_navigation2', '/home/deepdriving/fishbot/install/fishbot_interfaces', '/home/deepdriving/fishbot/install/fishbot_description', '/home/deepdriving/fishbot/install/fishbot_cartographer', '/home/deepdriving/fishbot/install/fishbot_bringup', '/opt/ros/foxy']")> Traceback (most recent call last): File "/opt/ros/foxy/lib/python3.8/site-packages/ament_index_python/packages.py", line 50, in get_package_prefix content, package_prefix = get_resource('packages', package_name) File "/opt/ros/foxy/lib/python3.8/site-packages/ament_index_python/resources.py", line 48, in get_resource raise LookupError( LookupError: Could not find the resource 'joint_state_publisher' of type 'packages' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event await self.__process_event(next_event) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event visit_all_entities_and_collect_futures(entity, self.__context)) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) [Previous line repeated 1 more time] File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures sub_entities = entity.visit(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit return self.execute(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py", line 453, in execute ret = super().execute(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 823, in execute self.__expand_substitutions(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 668, in __expand_substitutions cmd = [perform_substitutions(context, x) for x in self.__cmd] File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 668, in <listcomp> cmd = [perform_substitutions(context, x) for x in self.__cmd] File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions return ''.join([context.perform_substitution(sub) for sub in subs]) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in <listcomp> return ''.join([context.perform_substitution(sub) for sub in subs]) File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py", line 232, in perform_substitution return substitution.perform(self) File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/substitutions/executable_in_package.py", line 76, in perform package_prefix = super().perform(context) File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/substitutions/find_package.py", line 79, in perform result = self.find(package) File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/substitutions/find_package.py", line 96, in find return get_package_prefix(package_name) File "/opt/ros/foxy/lib/python3.8/site-packages/ament_index_python/packages.py", line 52, in get_package_prefix raise PackageNotFoundError( ament_index_python.packages.PackageNotFoundError: "package 'joint_state_publisher' not found, searching: ['/home/deepdriving/fishbot/install/fishbot_navigation2', '/home/deepdriving/fishbot/install/fishbot_interfaces', '/home/deepdriving/fishbot/install/fishbot_description', '/home/deepdriving/fishbot/install/fishbot_cartographer', '/home/deepdriving/fishbot/install/fishbot_bringup', '/opt/ros/foxy']"