👨🎓个人主页:研学社的博客
💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
RRT算法生长并维护一棵树,树的每个节点都是工作空间中的一个节点(状态)。算法所探索的区域即为树所占据的区域。算法最初以一棵以起始节点为唯一节点的树开始。在每次迭代时,通过选择一个随机状态并向该状态扩展树来扩展树。扩展是通过将树中距离最近的节点向选定的随机状态扩展一小步来完成的,如图2所示。算法运行,直到某个扩展使树足够靠近目标。
📚2 运行结果
2.1 场景1
2.2 场景2
2.3 场景3
2.4 场景4
2.5 场景5
2.6 场景6
部分代码:
%**************************************
function T = init_Tree(start,goal)
T.v(1).x = start(1); % start point
T.v(1).y = start(2);
T.v(1).theta = start(3); % start orientation
T.v(1).xPrev = start(1); % parent node for start point
T.v(1).yPrev = start(2);
T.v(1).thetaPrev = start(3); % parent node orietation
T.v(1).dist=0; % RRT tree node 1 attribute of distance
T.v(1).angle=0;% RRT tree node 1 attribute of angle change
T.v(1).dist_angle=0; % distance + angle change
T.v(1).Potential_value=0; % RRT tree node 1 attribute of potential value
T.v(1).Dist_Angle_PFvalue=0;% distance + angle change + potential value
T.v(1).indPrev = 0; %% RRT tree node 1 attribute of previous node index
T.v(1).path_flag = true;% if the node is within the path
T.v(1).valid = true; % if the node is active
T.v(1).Heuristic = norm([goal(1)-start(1) ,goal(2)-start(2)]);% RRT tree node heuristic value, to goal Euclidean distance
T.v(1).toGoal = norm(start(1,1:2) - goal); % estimation distance to goal for start point = cost to come + cost to go
T.v(1).series = zeros(16,3); % trajectory points for node 1
end
function [ChooseNeighbor_Rang, rewiring_range, minimal_rewiring_range, plot_flag, flag_rand_goal, coef_angle, Circle_radius, div_n, diff_margin] = Init_Parameter(Goal)
ChooseNeighbor_Rang = 220; % Neighbor range
rewiring_range = 280; % Rewire range
minimal_rewiring_range = 180; % Minimal rewire range
plot_flag = false; % plot flag
flag_rand_goal = false; % random sample flag
coef_angle = 40; % coefficient of angle
Circle_radius =60; % vehicle turing circle
div_n = 15; % segment division
diff_margin = 20; % optimal trajectory cost update margin
end
🌈3 Matlab代码、数据、文章讲解
🎉4 参考文献
部分理论来源于网络,如有侵权请联系删除。
[1]Hongqing Tian, Boqi Li, Heye Huang, Ling Han (2022) A driving risk-aversive motion planning algorithm for vehicles in off-road environment.