小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
[FishBot教程]7. FishBot-Nav2导航测试
-
我这边的配置和鱼哥的一模一样,,ROS2humle,ubuntu22.04,但是我发现我在进行导航的时候啊,就是会小车走到一半就会终止,
就像这样,请问这是怎么回事呢 -
@2462331351 图太乱了,没有空间给小车走
-
@小鱼 感谢小鱼,问题已解决
-
@921203724 你这个问题解决了吗,我出现了同样的问题。@小鱼
-
出现这个错误了,该怎么解决呢?rosdep已经用一键安装配置好了。 -
@ros_freshman 可以跳过
-
我使用的fishros镜像系统。
但是colcon编译一直报错。有没有整合好的代码可以运行?~ » git clone https://github.com/fishros/fishbot.git -b v1.0.0 --depth=1
正克隆到 'fishbot'...
remote: Enumerating objects: 84, done.
remote: Counting objects: 100% (84/84), done.
remote: Compressing objects: 100% (69/69), done.
remote: Total 84 (delta 21), reused 46 (delta 7), pack-reused 0 (from 0)
接收对象中: 100% (84/84), 332.98 KiB | 1.81 MiB/s, 完成.
处理 delta 中: 100% (21/21), 完成.
~ » cd fishbot
fishbot (v1.0.0 o) » rosdep install --from-paths src --ignore-src -y -r # 安 装依赖
#All required rosdeps installed successfully
fishbot (v1.0.0 o) » colcon build
Starting >>> fishbot_bringup
Starting >>> fishbot_cartographer
Starting >>> fishbot_description
Starting >>> fishbot_interfaces
Starting >>> fishbot_navigation2
Finished <<< fishbot_description [0.60s]
Finished <<< fishbot_cartographer [0.71s]
Finished <<< fishbot_navigation2 [0.84s]
--- stderr: fishbot_interfaces
CMake Error at /opt/ros/humble/share/rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake:59 (message):execute_process(/home/fishros/.x-cmd.root/local/data/pkg/sphere/X/l/j/h/bin/python3
-m rosidl_adapter --package-name fishbot_interfaces --arguments-file
/home/fishros/fishbot/build/fishbot_interfaces/rosidl_adapter__arguments__fishbot_interfaces.json
--output-dir
/home/fishros/fishbot/build/fishbot_interfaces/rosidl_adapter/fishbot_interfaces
--output-file
/home/fishros/fishbot/build/fishbot_interfaces/rosidl_adapter/fishbot_interfaces.idls)
returned error code 1:AttributeError processing template 'srv.idl.em'
Traceback (most recent call last):
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/resource/__init__.py", line 48, in evaluate_template _interpreter = em.Interpreter(
AttributeError: module 'em' has no attribute 'Interpreter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/fishros/.x-cmd.root/local/data/pkg/sphere/X/tree.linux.x64.0/miniconda/v3.10.0+23.9.0-0/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/fishros/.x-cmd.root/local/data/pkg/sphere/X/tree.linux.x64.0/miniconda/v3.10.0+23.9.0-0/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/__main__.py", line 19, in <module> sys.exit(main()) File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/main.py", line 53, in main abs_idl_file = convert_to_idl( File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/__init__.py", line 24, in convert_to_idl return convert_srv_to_idl( File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/srv/__init__.py", line 39, in convert_srv_to_idl expand_template('srv.idl.em', data, output_file, encoding='iso-8859-1') File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/resource/__init__.py", line 23, in expand_template content = evaluate_template(template_name, data) File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/resource/__init__.py", line 69, in evaluate_template _interpreter.shutdown()
AttributeError: 'NoneType' object has no attribute 'shutdown'
Call Stack (most recent call first):
/opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:130 (rosidl_adapt_interfaces)
CMakeLists.txt:29 (rosidl_generate_interfaces)
Failed <<< fishbot_interfaces [0.89s, exited with code 1]
Aborted <<< fishbot_bringup [1.08s]Summary: 3 packages finished [1.24s]
1 package failed: fishbot_interfaces
1 package aborted: fishbot_bringup
1 package had stderr output: fishbot_interfaces -
-
鱼哥,我在执行这段代码:ros2 launch fishbot_navigation2 navigation2.launch.py
发生报错:
raise InvalidLaunchFileError(extension, likely_errors=exceptions)
launch.invalid_launch_file_error.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: "package 'nav2_bringup' not found, searching: ['/home/jws/fishbot/fishbot/install/fishbot_navigation2', '/home/jws/fishbot/fishbot/install/fishbot_interfaces', '/home/jws/fishbot/fishbot/install/fishbot_description', '/home/jws/fishbot/fishbot/install/fishbot_cartographer', '/home/jws/fishbot/fishbot/install/fishbot_bringup', '/opt/ros/foxy']"好像是缺少一个功能包:nav2_bringup
后来我搜了GPT,执行了:sudo apt install ros-foxy-nav2-bt-navigator(运行成功了)
后来再回来执行:ros2 launch fishbot_navigation2 navigation2.launch.py
还是原来的找不到“nav2_bringup”包这个错误。
该怎么解决啊 -
@18296522393 建议用humble版本,另外需要单独装一下nav2_bringup,你可以看最新的视频或书,7.2章节有介绍命令。