eband_local_planner源码架构分析

本文详细分析了eband_local_planner的源码架构,从文件结构到类之间的关系,揭示了如何将全局规划路径转化为速度控制指令cmd_vel。核心流程包括:eband_local_planner_ros -> eband_local_planner -> eband_trajectory_controller,涉及数据转换、band处理和速度控制器的交互。最后提到了关键论文《Elastic_Bands_Connecting_Path_Planning and Robot Control》。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、文件结构(代码组成)

由5部分组成,第一部分负责数据类型的转换;第二部分负责具体的局部规划的具体实现,是核心代码;第三部分是move_base局部规划器和本局部规划器具体实现的中间转换接口;第四部分是将局部规划转成速度(cmd_vel或twist_cmd)控制指令;第五部分是RVIZ可视化设置,方便调试;

程序流程:eband_local_planner_ros ----->eband_local_planner ----->eband_trajectory_controller;

move_base.cpp中直接调用这些函数(继承nav_core::BaseLocalPlanner),最终通过方法computeVelocityCommands获得运动控制指令cmd_vel或者,并发布出去!那么具体的cmd_vel是如何得出来的呢?

二、类之间的关系

step1:move_base与eband_local_planner_ros

move_base.cpp调用局部规划算法时,调用的对象是boost::shared_ptr<nav_core::BaseLocalPlanner> tc_

controller_plan_ = latest_plan_;
.......
tc_->setPlan(*controller_plan_);

 

通过使用对象 tc_

[FATAL] [1741941391.454080028, 3050.394000000]: Failed to create the eband_local_planner/EBandPlannerROS planner, are you sure it is properly registered and that the containing library is built? Exception: According to the loaded plugin descriptions the class eband_local_planner/EBandPlannerROS with base class type nav_core::BaseLocalPlanner does not exist. Declared types are base_local_planner/TrajectoryPlannerROS dwa_local_planner/DWAPlannerROS teb_local_planner/TebLocalPlannerROS wpbh_local_planner/WpbhLocalPlanner [FATAL] [1741941391.454666822, 3050.394000000]: Failed to create the eband_local_planner/EBandPlannerROS planner, are you sure it is properly registered and that the containing library is built? Exception: According to the loaded plugin descriptions the class eband_local_planner/EBandPlannerROS with base class type nav_core::BaseLocalPlanner does not exist. Declared types are base_local_planner/TrajectoryPlannerROS dwa_local_planner/DWAPlannerROS teb_local_planner/TebLocalPlannerROS wpbh_local_planner/WpbhLocalPlanner [rb_0/move_base-3] process has died [pid 66728, exit code 1, cmd /home/gany/1/devel/lib/move_base/move_base cmd_vel:=cmd_vel odom:=odometry/filtered __name:=move_base __log:=/home/gany/.ros/log/6329f748-00af-11f0-bcbb-4f7e799ac125/rb_0-move_base-3.log]. log file: /home/gany/.ros/log/6329f748-00af-11f0-bcbb-4f7e799ac125/rb_0-move_base-3*.log [rb_1/move_base-6] process has died [pid 66741, exit code 1, cmd /home/gany/1/devel/lib/move_base/move_base cmd_vel:=cmd_vel odom:=odometry/filtered __name:=move_base __log:=/home/gany/.ros/log/6329f748-00af-11f0-bcbb-4f7e799ac125/rb_1-move_base-6.log]. log file: /home/gany/.ros/log/6329f748-00af-11f0-bcbb-4f7e799ac125/rb_1-move_base-6*.log C
03-15
WARN] [1741927093.798438225, 3049.327000000]: global_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided [ WARN] [1741927093.799843779, 3049.327000000]: global_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided [ WARN] [1741927093.898985893, 3049.363000000]: global_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided [ WARN] [1741927093.900149555, 3049.363000000]: global_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided [ WARN] [1741927094.665188392, 3049.587000000]: local_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided [ WARN] [1741927094.666163966, 3049.588000000]: local_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided [ WARN] [1741927094.906448957, 3049.652000000]: local_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided [ WARN] [1741927094.908444318, 3049.656000000]: local_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided [FATAL] [1741927094.925780258, 3049.663000000]: Failed to create the eband_local_planner/EBandPlannerROS planner, are you sure it is properly registered and that the containing library is built? Exception: According to the loaded plugin descriptions the class eband_local_planner/EBandPlannerROS with base class type nav_core::BaseLocalPlanner does not exist. Declared types are base_local_planner/TrajectoryPlannerROS dwa_local_planner/DWAPlannerROS teb_local_planner/TebLocalPlannerROS wpbh_local_planner/WpbhLocalPlanner [FATAL] [1741927095.142837320, 3049.723000000]: Failed to create the eband_local_planner/EBandPlannerROS planner, are you sure it is properly registered and that the containing library is built? Exception: According to the loaded plugin descriptions the class eband_local_planner/EBandPlannerROS with base class type nav_core::BaseLocalPlanner does not exist. Declared types are base_local_planner/TrajectoryPlannerROS dwa_local_planner/DWAPlannerROS teb_local_planner/TebLocalPlannerROS wpbh_local_planner/WpbhLocalPlanner terminate called recursively terminate called after throwing an instance of 'boost::wrapexcept<boost::lock_error>'
最新发布
03-15
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值