当前位置:   article > 正文

2024年最全RRT(快速搜索随机树)_无人机快速搜索随机树流程图(1),2024年最新面试物联网嵌入式开发岗_rrt搜索

rrt搜索

收集整理了一份《2024年最新物联网嵌入式全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升的朋友。
img
img

如果你需要这些资料,可以戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人

都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

% params for function [path_smooth] = smooth(map, path, vertices, delta)
delta = 5;

[vertices, edges, path] = rrt(map, q_start, q_goal, k, delta_q, p);

path_smooth = smooth(map, path, vertices, delta);

imshow(int32(1 - map), []);
title('RRT (Rapidly-Exploring Random Trees) - Smooth');
% imagesc(1 - map);
% colormap(gray);

hold on;

[edgesRowCount, ~] = size(edges);

for ii = 1 : edgesRowCount
    plot(vertices(ii, 1), vertices(ii, 2), 'cyan*', 'linewidth', 1);
    plot([vertices(edges(ii, 1), 1), vertices(edges(ii, 2), 1)], ...
    [vertices(edges(ii, 1), 2), vertices(edges(ii, 2), 2)], ...
     'b', 'LineWidth', 1);
end

plot(q_start(1), q_start(2), 'g*', 'linewidth', 1);
plot(q_goal(1), q_goal(2), 'r*', 'linewidth', 1);


[~, pathCount] = size(path);

for ii = 1 : pathCount - 1
    %plot(vertices(ii, 1), vertices(ii, 2), 'cyan*', 'linewidth', 1);
    plot([vertices(path(ii), 1), vertices(path(ii + 1), 1)], ...
    [vertices(path(ii), 2), vertices(path(ii + 1), 2)], ...
     'r', 'LineWidth', 1);
end

[~, pathCount] = size(path_smooth);

for ii = 1 : pathCount - 1
    %plot(vertices(ii, 1), vertices(ii, 2), 'cyan*', 'linewidth', 1);
    plot([vertices(path_smooth(ii), 1), vertices(path_smooth(ii + 1), 1)], ...
    [vertices(path_smooth(ii), 2), vertices(path_smooth(ii + 1), 2)], ...
     'black', 'LineWidth', 2);
end
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37


  • 1
  • 2

//rrt.m
function [vertices, edges, path] = rrt(map, q_start, q_goal, k, delta_q, p)
%Algorithm to build a tree to solve map
% that goes from the start position till the goal position and to generate a path that connects
% both vertices
%
% map: matrix that you can obtain loading the mat files.
%
% q_start: coordinates x and y of the start position. You can find the coordinates below the figures
% of the environmentin the previous page.
%
% q_goal: coordinates x and y of the goal position. You can find the coordinates below the figures
% of the environment in the previous page.
%
% k: maximum number of samples that will be considered to generate the tree, if the goal is not
% found before.
%
% delta_q: distance between q_new and q_near.
%
% p: probability (between 0 and 1) of choosing q_goal as q_random.

收集整理了一份《2024年最新物联网嵌入式全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升的朋友。
img
img

如果你需要这些资料,可以戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人

都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人**

都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/808619
推荐阅读
相关标签
  

闽ICP备14008679号