基于改进Informed-RRT*的路径规划算法

摘要

针对Informed-RRT*算法在路径规划中存在盲目性、收敛速度慢和优化效率低等问题,提出了一种改进的Informed-RRT*算法。首先,寻找初始路径时引入双向贪婪搜索,加快了初始路径寻找速率;其次,在树的生长过程中引入自适应步长代替固定步长进行生长,使得算法面对不同环境都能找到较优路径;最后,用懒惰采样代替原本的随机采样,在对算法进行处理前删除没有作用的节点,减小了算法运行压力,也加速了算法收敛。实验结果表明,面对复杂环境,优化后的算法能够快速找到较优路径。

关键词

路径规划; Informed-RRT*; 自适应步长; 

### Informed-RRT*算法概述 Informed-RRT*是一种用于路径规划的采样基优化算法,它改进了传统的RRT*(Rapidly-exploring Random Tree Star)方法,在探索空间的同时能够更高效地找到最优解。该算法通过构建一个树结构来表示已访问过的状态,并不断更新这棵树以逼近全局最优路径[^1]。 #### 算法特点 - **启发式搜索范围**:不同于标准RRT*, Informed-RRT*利用椭圆约束缩小可能包含最短路径的空间区域,从而减少不必要的样本点生成。 - **渐近收敛性**:随着迭代次数增加,所得到的最佳路径长度逐渐接近理论上的最小值。 - **计算效率高**:由于采用了更为精确的目标导向策略,因此能够在较短时间内获得高质量的结果。 ```python import numpy as np from scipy.spatial import KDTree class Node: def __init__(self, position): self.position = position self.parent = None self.cost = 0.0 def distance(node1, node2): return np.linalg.norm(np.array(node1.position)-np.array(node2.position)) def steer(from_node, to_position, extend_length=float("inf")): new_node = Node(to_position) d = distance(from_node, new_node) if d > extend_length: ratio = extend_length / d new_node.position = tuple((np.array(from_node.position)+ratio*np.subtract(new_node.position, from_node.position)).tolist()) new_node.parent = from_node new_node.cost = from_node.cost + distance(from_node, new_node) return new_node def informed_rrt_star(start, goal, obstacle_list, rand_area, max_iter=200, expand_dis=1.0, path_resolution=0.5): start_node = Node(start) end_node = Node(goal) tree = {start_node} kd_tree = KDTree([node.position for node in tree]) best_cost = float('inf') final_path = [] for i in range(max_iter): rnd_node = sample_free_space(rand_area) nearest_ind = kd_tree.query(rnd_node.position)[1] nearest_node = list(tree)[nearest_ind] new_node = steer(nearest_node, rnd_node.position, expand_dis) if check_collision(new_node, obstacle_list): continue near_nodes = find_near_nodes(new_node, tree, kd_tree) new_node = choose_parent(new_node, near_nodes) tree.add(new_node) kd_tree = KDTree([node.position for node in tree]) rewire(new_node, near_nodes) if is_within_ellipse(new_node, start_node, end_node): temp_end_node = steer(new_node, end_node.position) if not check_collision(temp_end_node, obstacle_list): current_best_cost = calculate_total_cost(temp_end_node) if current_best_cost < best_cost: best_cost = current_best_cost final_path = get_final_course(temp_end_node) return final_path ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

罗伯特之技术屋

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值