小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
[FishBot教程]7. FishBot-Nav2导航测试
-
@blairan121122885 解决了吗,跑了一次一键安装?
-
@192224801 同样问题解决了吗
-
@小鱼 鱼哥这一步跑一键安装,输入命令后安装第几项?
-
@小鱼 鱼哥,卡在“fishbot_bringup”这里了,没找到如何解决的方法呢,帮我看看怎么个问题,多谢
-
我下载的NAV2的代码为什么编译阶段会报错
rclcpp::Node>; std::string = std::__cxx11::basic_string<char>]’: /home/tq/workspace/nav2/src/navigation2-main/nav2_util/src/lifecycle_service_client.cpp:35:3: required from here /home/tq/workspace/nav2/src/navigation2-main/nav2_util/include/nav2_util/service_client.hpp:49:15: error: cannot convert ‘rclcpp::SystemDefaultsQoS’ to ‘const rmw_qos_profile_t&’ {aka ‘const rmw_qos_profile_s&’} 49 | rclcpp::SystemDefaultsQoS(), | ^~~~~~~~~~~~~~~~~~~ | | | rclcpp::SystemDefaultsQoS In file included from /opt/ros/humble/include/rclcpp/rclcpp/node.hpp:1321, from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28, from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22, from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155, from /home/tq/workspace/nav2/src/navigation2-main/nav2_util/include/nav2_util/service_client.hpp:20, from /home/tq/workspace/nav2/src/navigation2-main/nav2_util/include/nav2_util/lifecycle_service_client.hpp:24, from /home/tq/workspace/nav2/src/navigation2-main/nav2_util/src/lifecycle_service_client.cpp:15: /opt/ros/humble/include/rclcpp/rclcpp/node_impl.hpp:127:29: note: initializing argument 2 of ‘typename rclcpp::Client<ServiceT>::SharedPtr rclcpp::Node::create_client(const string&, const rmw_qos_profile_t&, rclcpp::CallbackGroup::SharedPtr) [with ServiceT = lifecycle_msgs::srv::ChangeState; typename rclcpp::Client<ServiceT>::SharedPtr = std::shared_ptr<rclcpp::Client<lifecycle_msgs::srv::ChangeState> >; std::string = std::__cxx11::basic_string<char>; rmw_qos_profile_t = rmw_qos_profile_s; rclcpp::CallbackGroup::SharedPtr = std::shared_ptr<rclcpp::CallbackGroup>]’ 127 | const rmw_qos_profile_t & qos_profile, | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ In file included from /home/tq/workspace/nav2/src/navigation2-main/nav2_util/include/nav2_util/lifecycle_service_client.hpp:24, from /home/tq/workspace/nav2/src/navigation2-main/nav2_util/src/lifecycle_service_client.cpp:15: /home/tq/workspace/nav2/src/navigation2-main/nav2_util/include/nav2_util/service_client.hpp: In instantiation of ‘nav2_util::ServiceClient<ServiceT, NodeT>::ServiceClient(const string&, const NodeT&) [with ServiceT = lifecycle_msgs::srv::GetState; NodeT = std::shared_ptr<rclcpp::Node>; std::string = std::__cxx11::basic_string<char>]’: /home/tq/workspace/nav2/src/navigation2-main/nav2_util/src/lifecycle_service_client.cpp:36:3: required from here /home/tq/workspace/nav2/src/navigation2-main/nav2_util/include/nav2_util/service_client.hpp:49:15: error: cannot convert ‘rclcpp::SystemDefaultsQoS’ to ‘const rmw_qos_profile_t&’ {aka ‘const rmw_qos_profile_s&’} 49 | rclcpp::SystemDefaultsQoS(), | ^~~~~~~~~~~~~~~~~~~ | | | rclcpp::SystemDefaultsQoS In file included from /opt/ros/humble/include/rclcpp/rclcpp/node.hpp:1321, from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28, from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22, from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155, from /home/tq/workspace/nav2/src/navigation2-main/nav2_util/include/nav2_util/service_client.hpp:20, from /home/tq/workspace/nav2/src/navigation2-main/nav2_util/include/nav2_util/lifecycle_service_client.hpp:24, from /home/tq/workspace/nav2/src/navigation2-main/nav2_util/src/lifecycle_service_client.cpp:15: /opt/ros/humble/include/rclcpp/rclcpp/node_impl.hpp:127:29: note: initializing argument 2 of ‘typename rclcpp::Client<ServiceT>::SharedPtr rclcpp::Node::create_client(const string&, const rmw_qos_profile_t&, rclcpp::CallbackGroup::SharedPtr) [with ServiceT = lifecycle_msgs::srv::GetState; typename rclcpp::Client<ServiceT>::SharedPtr = std::shared_ptr<rclcpp::Client<lifecycle_msgs::srv::GetState> >; std::string = std::__cxx11::basic_string<char>; rmw_qos_profile_t = rmw_qos_profile_s; rclcpp::CallbackGroup::SharedPtr = std::shared_ptr<rclcpp::CallbackGroup>]’
-
@1032063747 第二个命令应该在第一个后面输入,注意终端目录
-
此回复已被删除! -
-
@小鱼 在 [FishBot教程]7. FishBot-Nav2导航测试 中说:
source install/setup.bash
ros2 launch fishbot_navigation2 navigation2.launch.py哥,我前面都弄好了,最后一步点击Rviz2工具栏——2D Pose Estimate没有反应是什么原因? ,是Ubuntu22.04,humble版本,前面的都没问题,知道一下呗,很急!!!重试了很多次都是没反应。
-
@1923825015 你提供的信息不足,连个日志都没有
@小鱼 在 提问前必看!一定要看!必须看一下! 中说:
一个好的提问不仅能够帮助自己理清楚问题,还有助于别人快速帮助到你。——提问的智慧
问题一定要描述清楚,终端打印一定复制粘贴,方便回答者检索和引用(你可以在linux系统上打开浏览器进社区)
基本的Markdown语法一定要学习下,有的小伙伴图片代码一团糟
提问时一定要提供尽可能多的信息(系统版本,ROS版本,前后操作,终端日志),包括你的目的,比如你其实想装装某个库遇到问题,不要只说这个问题,因为可能有更好的替代方案
先搜索再提问,很多问题其实都有解决方案,确保你自己对自己的问题有一定了解再提问
尽量一句话说完,不要把社区当微信聊天一样用,每一个回复都尽量提供更多的的信息。 -
@小鱼 鱼哥在构建完地图导航测试时遇到了一点问题,问题如下:
平台:Ubuntu22.04 ROS:humble
问题:地图成功构建好后,按照教程加载到navigation2.launch.py程序中去,编译成功,然后运行后,按照问档设置起点和目标点,无法使小车导航移动。具体操作步骤和执行状态如下:
1、启动micro-ros命令:
sudo docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:$ROS_DISTRO udp4 --port 8888 -v6
状态正常,可以接收到话题
2、启动雷达驱动:
xhost + && sudo docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged -v /tmp/.X11-unix:/tmp/.X11-unix --device /dev/snd -e DISPLAY=unix$DISPLAY -p 8889:8888 fishros2/fishbot_laser
在新开的RVIZ中可以看到雷达正常工作。
3、修改navigation2.launch.py程序,加载新建的地图
4、运行程序,加载地图如下 -
@1923825015 在 [FishBot教程]7. FishBot-Nav2导航测试 中说:
xhost + && sudo docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged -v /tmp/.X11-unix:/tmp/.X11-unix --device /dev/snd -e DISPLAY=unix$DISPLAY -p 8889:8888 fishros2/fishbot_laser
在新开的RVIZ中可以看到雷达正常工作。这里选的几?
这一步你怎么跳过了?
@小鱼 在 [FishBot教程]7. FishBot-Nav2导航测试 中说:
三、启动bringup
source install/setup.bash
ros2 launch fishbot_bringup fishbot_bringup.launch.pybringup节点目前主要将odom话题转成tf并,并发布机器本体的tf广播
-
@小鱼 好的,已经解决了,再问一下,这小车可以定点巡航嘛?就比如自动走圆形,或者其他图案。
-
@1923825015 这个要自己去开发了,属于应用层的东西了
-
@小鱼 在 [FishBot教程]7. FishBot-Nav2导航测试 中说:
此时你可以使用rviz2的工具栏中的Nav2 Goal发送一个目标点,然后观察机器人运动即可。 这一步经常无法实现,有什么解决的方法嘛?每次发送目标时,小车就原地转圈。
-
@1923825015 可能你的图有问题,也可能你的线松了,需要进一步排查
-
@小鱼 哥,具体的排查方法有吗?图我已经建了不低于三个了,然后系统我也重装了两次了,至于接线的话,我平装好之后就没动过线,反正到现在导航就是不行,每次导航,小车就在原地转圈,只有把小车电源关闭了,才能停下来。能帮我解决一下嘛 求求了。
-
@1923825015 手动遥控是否正常,代价地图是否正常
-
@小鱼 键盘控制正常的,代价地图我不清楚怎样才算正常,反正点击Rviz2工具栏——2D Pose Estimate,然后在地图上点个目标点并选择方向后,全局代价地图以及被地代价地图以及激光在地图上都标记出来了,这样算算正常嘛?
-
@小鱼 小鱼,我第一步拿到 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