ROS Navigation的global_planner类继承关系与实现算法

ROS的navigation包中的global_planner详细解释了如何在nav_core接口上实现全局路径规划,包括A*和Dijkstra算法的运用。global_planner通过calculatePotentials接口计算网格潜力,并通过Traceback找到全局路径。最终,通过makePlan进行路径平滑并发布。使用时,可以通过配置move_base参数来选择global_planner而非默认的navfn。
摘要由CSDN通过智能技术生成

navigation包里有一个nav_core,是一个纯粹的接口package,里面规定了核心的几个类应该有基本功能。BaseGlobalPlanner是全局导航的接口,规定一个功能函数makePlan,给定起始跟目标,输出路径(一系列pose)走过去;BaseLocalPlanner规定了一个核心函数computeVelocityCommands,就是计算局部地图内的下一步控制指令(线速度,角速度);还有一个RecoveryBehavior,规定一个runBehavior,在小车卡住情况下执行运动恢复,回到正常的导航状态。

global_planner

在nav_core的global_planner中的继承关系:

可以知道在nav_core的接口上,又提供了carrot_planner::CarrotPlanner,navfn::NavfnROS,这里介绍的是global_planner::GlobalPlanner的实现。
在全局规划中,提供了例如A star和Dijstra算法;提供处理规划之后的路径的类型的算法。

expander规定了calculatePotentials的接口,根据costmap跟起始终止点计算网格的potential。关于算法,D..就不看了,A*的算法思想如下:

A* Algorithm
cost      // the cost of every grid in the map
potential // the cost of every grid from the start node
OPEN      // the set of nodes to be evaluated
CLOSED    // the set of nodes already evaluated
add the start node to OPEN
loop
    current = node in OPEN with the lowest f_cost  // from cost list
    remove current from OPEN
    add current to CLOSED
    if current is the target node  // path has been found
        return 
    foreach neighbor of the current node
        if neighbour is not traversable or neighbor is 
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值