小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
[FishBot教程]7. FishBot-Nav2导航测试
-
此回复已被删除! -
git clone https://github.com/fishros/fishbot.git -b v1.0.0 --depth=1 cd fishbot rosdep install --from-paths src --ignore-src -y -r # 安装依赖 colcon build
鱼哥,我在编译nav2_pure_pursuit_controller这个功能包的时候报错了,错误如下:
In file included from /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/src/pure_pursuit_controller.cpp:8: /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/include/nav2_pure_pursuit_controller/pure_pursuit_controller.hpp:45:18: error: ‘nav2_core::GoalChecker’ has not been declared 45 | nav2_core::GoalChecker *goal_checker) override; | ^~~~~~~~~~~ /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/include/nav2_pure_pursuit_controller/pure_pursuit_controller.hpp:27:8: error: ‘void nav2_pure_pursuit_controller::PurePursuitController::configure(const WeakPtr&, std::string, std::shared_ptr<tf2_ros::Buffer>, std::shared_ptr<nav2_costmap_2d::Costmap2DROS>)’ marked ‘override’, but does not override 27 | void configure( | ^~~~~~~~~ /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/include/nav2_pure_pursuit_controller/pure_pursuit_controller.hpp:42:36: error: ‘geometry_msgs::msg::TwistStamped nav2_pure_pursuit_controller::PurePursuitController::computeVelocityCommands(const PoseStamped&, const Twist&, int*)’ marked ‘override’, but does not override 42 | geometry_msgs::msg::TwistStamped computeVelocityCommands( | ^~~~~~~~~~~~~~~~~~~~~~~ /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/include/nav2_pure_pursuit_controller/pure_pursuit_controller.hpp:58:8: error: ‘void nav2_pure_pursuit_controller::PurePursuitController::setSpeedLimit(const double&, const bool&)’ marked ‘override’, but does not override 58 | void setSpeedLimit(const double &speed_limit, | ^~~~~~~~~~~~~ /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/src/pure_pursuit_controller.cpp:116:16: error: ‘nav2_core::GoalChecker’ has not been declared 116 | nav2_core::GoalChecker *goal_checker) { | ^~~~~~~~~~~ In file included from /opt/ros/foxy/include/class_loader/class_loader_core.hpp:57, from /opt/ros/foxy/include/class_loader/class_loader.hpp:55, from /opt/ros/foxy/include/class_loader/multi_library_class_loader.hpp:52, from /opt/ros/foxy/include/pluginlib/class_loader.hpp:58, from /opt/ros/foxy/include/nav2_costmap_2d/costmap_2d_ros.hpp:53, from /opt/ros/foxy/include/nav2_core/controller.hpp:42, from /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/include/nav2_pure_pursuit_controller/pure_pursuit_controller.hpp:8, from /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/src/pure_pursuit_controller.cpp:8: /opt/ros/foxy/include/class_loader/meta_object.hpp: In instantiation of ‘B* class_loader::impl::MetaObject<C, B>::create() const [with C = nav2_pure_pursuit_controller::PurePursuitController; B = nav2_core::Controller]’: /opt/ros/foxy/include/class_loader/meta_object.hpp:216:7: required from here /opt/ros/foxy/include/class_loader/meta_object.hpp:218:12: error: invalid new-expression of abstract class type ‘nav2_pure_pursuit_controller::PurePursuitController’ 218 | return new C; | ^~~~~ In file included from /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/src/pure_pursuit_controller.cpp:8: /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/include/nav2_pure_pursuit_controller/pure_pursuit_controller.hpp:15:7: note: because the following virtual functions are pure within ‘nav2_pure_pursuit_controller::PurePursuitController’: 15 | class PurePursuitController : public nav2_core::Controller { | ^~~~~~~~~~~~~~~~~~~~~ In file included from /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/include/nav2_pure_pursuit_controller/pure_pursuit_controller.hpp:8, from /home/zero/Code/SLAM/fishbot/src/nav2_pure_pursuit_controller/src/pure_pursuit_controller.cpp:8: /opt/ros/foxy/include/nav2_core/controller.hpp:74:16: note: ‘virtual void nav2_core::Controller::configure(const SharedPtr&, std::string, const std::shared_ptr<tf2_ros::Buffer>&, const std::shared_ptr<nav2_costmap_2d::Costmap2DROS>&)’ 74 | virtual void configure( | ^~~~~~~~~ /opt/ros/foxy/include/nav2_core/controller.hpp:112:44: note: ‘virtual geometry_msgs::msg::TwistStamped nav2_core::Controller::computeVelocityCommands(const PoseStamped&, const Twist&)’ 112 | virtual geometry_msgs::msg::TwistStamped computeVelocityCommands( | ^~~~~~~~~~~~~~~~~~~~~~~ make[2]: *** [CMakeFiles/nav2_pure_pursuit_controller.dir/build.make:63: CMakeFiles/nav2_pure_pursuit_controller.dir/src/pure_pursuit_controller.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/nav2_pure_pursuit_controller.dir/all] Error 2 make: *** [Makefile:141: all] Error 2 --- Failed <<< nav2_pure_pursuit_controller [3.62s, exited with code 2] Summary: 5 packages finished [3.85s] 1 package failed: nav2_pure_pursuit_controller 1 package had stderr output: nav2_pure_pursuit_controller
这个错误该怎么改呢?
-
@444037843 在 [FishBot教程]7. FishBot-Nav2导航测试 中说:
nav2_pure_pursuit_controller
直接先删掉这个包吧,暂时用不倒,有时间我再更新下
-
你好,小鱼,小车电机转动运行后停止,有抱死后的高频鸣噪,是否可以适当调整停车抱死策略。
-
@萝卜头 有这个打算,下一个固件版本会解决,有时间也可以手动改下代码:https://github.com/fishros/fishbot_motion_control_microros
-
@小鱼 好的,我也看一下代码,还有个问题,每当控制板和雷达板连接到局域网后,若ubuntu终端退出docker运行的程序,再次启动agent,会连不上控制板和雷达板,路由器管理端显示两个设备在线,不知您是否遇到过此问题。
-
@萝卜头 你说的退出是直接关掉终端吗?还是先关闭程序再关闭终端。因为是使用docker,莞城终端不会打断原有程序的运行,所以再次启动就会出现占用情况,
除此之外还有一种可能,是因为网络不稳定造成的,比较推荐,小车直连电脑,或者小车直连路由器,路由器网线接电脑,这两种线路。
-
@小鱼 是Ctrl+C结束docker,再次运行或者再开新终端运行无法执行agent。
-
@萝卜头 可以贴一下log看看,具体提示什么
-
@小鱼 我现在还没回去,等我回去给贴一下
-
@小鱼 刚才测试了几次,应该是我直接关闭终端的缘故造成的,现在可以了,感谢!
-
你好,小鱼,我是双系统的22.04在输入:
git clone --recursive https://github.com/fishros/fishbot.git -b v1.0.0 --depth=1
fatal: 目标路径 'fishbot' 已经存在,并且不是一个空目录。
请问怎么处理这个问题,谢谢! -
@86181314 换个目录就行了,因为当前目录下已经存在了fishbot这一目录,也可以删掉
-
第一步出现了如下问题,不知如何解决 -
@小鱼 鱼哥,换个目录是什么意思?
-
又有新的问题 -
@921203724 别一次性运行太多指令,不然都搞不清楚是哪个出错,一步步来
看你的错误是克隆错误,已经存在fishbot工作空间了
-
@小鱼
已经下载了rosdepc,结果还是让我跑rosdep -
现在报错变了,变成这样了 -
现在变成这样了