<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kaan Ucar on Medium]]></title>
        <description><![CDATA[Stories by Kaan Ucar on Medium]]></description>
        <link>https://medium.com/@kucar17?source=rss-c1e5314caac7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-lt8FVWohhxOKhnv7H_J8w.png</url>
            <title>Stories by Kaan Ucar on Medium</title>
            <link>https://medium.com/@kucar17?source=rss-c1e5314caac7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 08:34:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kucar17/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Autonomous Navigation of a Mobile Robot: RRT Path Planning Algorithm]]></title>
            <link>https://medium.com/analytics-vidhya/autonomous-navigation-of-a-mobile-robot-rrt-path-planning-algorithm-a8f780adef9d?source=rss-c1e5314caac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8f780adef9d</guid>
            <category><![CDATA[robotics]]></category>
            <category><![CDATA[robots]]></category>
            <category><![CDATA[matlab]]></category>
            <category><![CDATA[path-planning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Kaan Ucar]]></dc:creator>
            <pubDate>Sun, 27 Sep 2020 18:17:21 GMT</pubDate>
            <atom:updated>2020-10-01T16:18:00.206Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*85gwSlsrLabMx169CcY30Q.png" /><figcaption>Image (1), taken from https://imgbin.com/download-png/HJWCJqwy and used solely with personal purposes.</figcaption></figure><p>Read this article in Turkish / Bu makaleyi Türkçe olarak okuyun: <a href="https://medium.com/@kucar17/bir-mobil-robotun-otonom-%C5%9Fekilde-yol-bulmas%C4%B1-rrt-algoritmas%C4%B1-57a8c51dfab4">https://medium.com/@kucar17/bir-mobil-robotun-otonom-%C5%9Fekilde-yol-bulmas%C4%B1-rrt-algoritmas%C4%B1-57a8c51dfab4</a></p><p>Motion Planning in Robotics is a term which means to find a feasible set of configurations which takes a robot from an initial location to the desired one. Basic RRT Path Planning Algorithm accomplishes that by creating a tree of nodes which connects the starting point to the end (target) point.</p><p>On every step, the algorithm selects a random point and then connects that point to the closest point which was already calculated and inserted into the tree of nodes/points. Hence an edge/path is created between those two points. Then the path which connects the two points is checked to see if it collides with any of the obstacles. If there is no collision with the obstacles, this node is added to the tree of nodes. If the path collides with any of the obstacles however, it is decided that the movement is not feasible and same calculations are performed again with a newly picked point. These operations are performed iteratively until the target point or tolerance range is reached.</p><p>This algorithm is widely used in Robotics since it can be applied to environments which consist of obstacles. Even though it makes the robot reach its target point, the path calculated by the basic RRT Algorithm is often not optimal as it uses randomly picked points. Despite the fact that there are modified algorithms such as RRT* which are used to optimize the path, we are going to be inspecting the basic RRT Algorithm which has few small touches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*KzT8JeQjz7HxEw3eGHA7AA.gif" /><figcaption>Image (2), animation of an RRT Algorithm which has 10000 iterations. Image belongs to Javed Hossain and it is taken from wikipedia.org (https://en.wikipedia.org/wiki/Rapidly-exploring_random_tree).</figcaption></figure><p>Here below, we are going to be covering the act of moving our robot to its objective without colliding into any of the obstacles. RRT Algorithm is going to be run multiple times, in order to create different solutions to particular Path Planning Problem.</p><p>Let us inspect the environment (C-space) where our robot is going to find its way:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*lAHr3uouume0z5nFD_e_dg.png" /></figure><p>Our starting point is located at (-0.5, -0.5) and desired point is located at (0.5, 0.5) points.</p><p>Since our environment is relatively simple, we can expect our algorithm to give a result which is very close to an optimal one.</p><p>We can see the coded — in MATLAB — version of our algorithm below. Firstly our code takes an “obstacles.csv” file as its input and then creates an obstacles matrix with that. Then we assign our start (startNode) and target/end (endNode) nodes to two different variables and limit our algorithm with 50 points. Therefore, our algorithm is going to try to transport our robot to its final configuration by calculating 50 different points at maximum. If the robot is not at its target location after 50 different points are calculated, algorithm is going to tell us that it failed.</p><p>In the code, there are few things which might catch your attention. One of them is the fact that sample spaces in X and Y axes get narrowed down separately in each step. For example if our robot reaches the point <br>(-0.15, 0. 20) without any collision, we tell our algorithm that its new sample spaces are (-0.15, 0.50] and (0.20, 0.50] in X and Y axes, respectively. That way, our algorithm is going to be using those intervals while picking new random points. Even though this approach has the potential of causing problems on certain environments, it helps to create a path which is very close to the optimal one in our instance. Another thing is the fact that straight lines are used in order to connect two points to each other. In systems which have motion constraints, different motion planners are used instead of straight lines. In order to ease the understanding, we are going to be assuming that our robot has no motion constraints.</p><pre>%% Clearing the command window and workspace<br>clc<br>clear</pre><pre>tic</pre><pre>%% Defining obstacles<br>obstacles = readmatrix(&#39;obstacles.csv&#39;);<br>centerX = obstacles(:,1);<br>centerY = obstacles(:,2);<br>radius = obstacles(:,3)/2;</pre><pre>obstacleCenterX = zeros(1, length(obstacles));<br>obstacleCenterY = zeros(1, length(obstacles));<br>obstacleRadius = zeros(1, length(obstacles));</pre><pre>for i = 1 : length(obstacles)<br>    obstacleCenterX(i) = centerX(i);<br>    obstacleCenterY(i) = centerY(i);<br>    obstacleRadius(i) = radius(i);<br>end</pre><pre>%% Setting up the RRT Aims and Parameters:<br>startNode = [-0.5 -0.5];<br>endNode = [0.5 0.5];<br>maxTreeSize = 50;</pre><pre>T{1} = startNode;<br>rangeX = startNode(1) : 0.01 : endNode(1);<br>rangeY = startNode(2) : 0.01 : endNode(2);<br>nodeNumber = 1;<br>edge = [];</pre><pre>%% Starting the RRT Algorithm:<br>while length(T) &lt; maxTreeSize<br>    <br>    if(length(rangeX) ~= 0)<br>    xAxis = randsample(rangeX*0.1, 1);<br>    end<br>    <br>    if(length(rangeY) ~= 0)<br>    yAxis = randsample(rangeY*0.1, 1);   <br>    end<br>    <br>    xSamp = [xAxis yAxis];<br>    <br>    for i = 1 : length(T)<br>        distances = sqrt((T{1}(1) - xAxis)^2 + (T{1}(2) - yAxis)^2);<br>        index = find(distances == min(distances));<br>        xNearest = T{i};<br>    end<br>    <br>    dRange = 0 : 0.005: 0.1;<br>    distanceX = randsample(dRange, 1);<br>    distanceY = randsample(dRange, 1);<br>    <br>    xNewAxisX = xNearest(1) + distanceX;<br>    xNewAxisY = xNearest(2) + distanceY;<br>    xNew = [xNewAxisX xNewAxisY];<br>    <br>    if (xNew(1) - xNearest(1) == 0)<br>        continue<br>    end<br>    <br>    lineCoeffs = polyfit([xNearest(1) xNew(1)], [xNearest(2) xNew(2)], 1);<br>    slope = lineCoeffs(1);<br>    yIntercept = lineCoeffs(2);<br>    <br>    % Checking if the line intersects any of the obstacles:<br>    for i = 1 : length(obstacles)<br>        a = linecirc(slope,yIntercept,obstacleCenterX(i),obstacleCenterY(i),obstacleRadius(i));<br>        % If a is not a NaN array (1 by 2), this means collision and loop<br>        % is terminated:<br>        if (~isnan(a))<br>            addCondition = 0;<br>            break<br>        else<br>            addCondition = 1;<br>        end<br>    <br>    end<br>    <br>    if xNew(1)&gt; 0.5<br>        xNew(1) = 0.5;<br>    end<br>    <br>    if xNew(2)&gt; 0.5<br>        xNew(2) = 0.5;<br>    end<br>    <br>    % If the line does not intersect the obstacles, xNew is added to the<br>    % tree and vertex/edge is created between xNearest and xNew:<br>    if (addCondition ~= 0)<br>        T{length(T) + 1} = xNew;<br>        nodeDistance = sqrt((xNearest(1) - xNew(1))^2 + (xNearest(2) - xNew(2))^2);<br>        edge{length(edge) + 1} = [nodeNumber nodeNumber+1 nodeDistance];<br>        nodeNumber = nodeNumber + 1;<br>        % Narrowing down the range of sample in order to get closer to the<br>        % goal node:<br>        narrowRangeX = rangeX &lt; xNew(1);<br>        narrowRangeY = rangeY &lt; xNew(2);<br>        rangeX(narrowRangeX) = [];<br>        rangeY(narrowRangeY) = [];<br>        <br>        if xNew == endNode<br>            disp(&#39;RRT is completed successfully!&#39;)<br>            for j = 1 : length(T)<br>                nodes(j, :) = [j T{j}];<br>            end<br>            <br>            for j = 1 : length(edge)<br>                edges(j, :) = edge{j};<br>            end           <br>            <br>            writematrix(edges, &#39;edges.csv&#39;);<br>            writematrix(nodes, &#39;nodes.csv&#39;);<br>            writematrix(nodes(:,1)&#39;, &#39;path.csv&#39;)<br>            toc<br>            return<br>        end<br>    end<br>    <br>end<br>disp(&#39;RRT is not completed successfully!&#39;)    <br>toc</pre><p>We expect to get the result “RRT is completed successfully!”, every time we run our code. The reason for that is, we had set the limit of 50 maximum points at the beginning of our code. This limit of 50 points is not a very hard condition for our algorithm. I ran the code approximately 15 times and the maximum number of points the algorithm calculated was 29. However, if we set this limit as 25 or use a different environment, we can expect our algorithm to fail occasionally.</p><p>We can see two different paths our algorithm has calculated below (The simulation of the paths were performed in CoppeliaSim simulation software):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*e0n8y5kd0OJgwXuCASmwhw.png" /><figcaption>The first path which was calculated by the algorithm (26 points).</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*_mUgOd1Tj0wGZ0FXGAyF3A.png" /><figcaption>The second path which was calculated by the algorithm (29 points).</figcaption></figure><p>As the two different results show, algorithm may yield different results each time, since it uses randomly picked points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*S6WOPG-wdxt6CRJzZUYMWA.gif" /><figcaption>Collision-free navigation of the robot.</figcaption></figure><p>You can find the code and .csv file which consists of obstacles information as well as the other simulation files on <a href="https://github.com/kucar17">my GitHub page</a>.</p><p>The simulation environment I used in this article was part of a simulation environment package which was provided by a MOOC series named “Modern Robotics: Mechanics, Planning, and Control Specialization”, which can be found on Coursera. Also this project was inspired by the second week assignment of the fourth course of the same MOOC series.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8f780adef9d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/autonomous-navigation-of-a-mobile-robot-rrt-path-planning-algorithm-a8f780adef9d">Autonomous Navigation of a Mobile Robot: RRT Path Planning Algorithm</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bir Mobil Robotun Otonom Şekilde Yol Bulması: RRT Algoritması]]></title>
            <link>https://medium.com/@kucar17/bir-mobil-robotun-otonom-%C5%9Fekilde-yol-bulmas%C4%B1-rrt-algoritmas%C4%B1-57a8c51dfab4?source=rss-c1e5314caac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/57a8c51dfab4</guid>
            <category><![CDATA[path-planning]]></category>
            <category><![CDATA[robotik]]></category>
            <category><![CDATA[yapay-zeka]]></category>
            <category><![CDATA[matlab]]></category>
            <dc:creator><![CDATA[Kaan Ucar]]></dc:creator>
            <pubDate>Sun, 27 Sep 2020 16:22:10 GMT</pubDate>
            <atom:updated>2020-09-27T18:18:46.985Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*85gwSlsrLabMx169CcY30Q.png" /><figcaption>Resim (1), https://imgbin.com/download-png/HJWCJqwy adresinden alınmış ve kişisel amaçlı olarak kullanılmıştır.</figcaption></figure><p>Bu makaleyi İngilizce olarak okuyun / Read this article in English: <a href="https://medium.com/@kucar17/autonomous-navigation-of-a-mobile-robot-rrt-path-planning-algorithm-a8f780adef9d">https://medium.com/@kucar17/autonomous-navigation-of-a-mobile-robot-rrt-path-planning-algorithm-a8f780adef9d</a></p><p>Robotikte Motion Planning (Hareket Planlaması), bir robotu başlangıç konumundan hedef/istenen konuma ulaştıran geçerli konfigürasyon setini bulmak için kullanılan bir kavramdır. Temel RRT (Rapidly-Exploring Random Trees — Hızlı-Keşfedilen Gelişigüzel Ağaçlar) Algoritması da başlangıç noktasını bitiş noktasına (hedef noktası) bağlayan, gelişigüzel olarak seçilmiş bir nokta ağacı oluşturarak bunu sağlar.</p><p>Algoritma her bir adımda öncelikle gelişigüzel bir nokta seçer ve ardından bu noktayı, kendisine en yakında bulunan noktayla (halihazırda hesaplanmış ve nokta ağacında bulunan bir nokta) birleştirir. Böylece bu iki nokta arasında bir kenar/yol oluşturulur. Ardından iki noktayı birbirine bağlayan bu yolun ortamdaki engellere çarpıp çarpmadığı kontrol edilir. Engellere bir temas olmadığı takdirde bu nokta, nokta ağacına eklenir. Yolun engellerden biriyle kesişmesi (çarpışması) durumunda, hareketin mümkün olmadığına karar verilir ve yeni bir nokta seçilerek aynı hesaplamalar tekrar gerçekleştirilir. Hedef noktasına ulaşana veya tolerans aralığına girilene kadar bu işlemler sürekli olarak tekrar edilir ve robotun hedefe ulaşması sağlanır.</p><p>Engellerden oluşan ortamlara da uygulanabiliyor olması sebebiyle algoritma Robotikte yaygın şekilde kullanılmaktadır. Robotu hedef noktasına ulaştırabiliyor olmasına rağmen, nokta ağacının gelişigüzel olarak seçilmiş noktalardan oluşması nedeniyle, Temel RRT Algoritması tarafından hesaplanan yol çoğunlukla optimal (en kısa) yol değildir. Bu yolu optimize etmek için RRT* gibi modifiye edilmiş algoritmalar da bulunsa da, bu yazımda sizlerle Temel RRT Algoritmasının birkaç ufak dokunuş yapılmış halini inceleyeceğiz.</p><figure><img alt="Javed Hossain’e ait resim, lisans bilgisi: https://creativecommons.org/licenses/by-sa/3.0/" src="https://cdn-images-1.medium.com/max/500/1*KzT8JeQjz7HxEw3eGHA7AA.gif" /><figcaption>Resim (2), 10000 tekrarlı bir RRT Algoritmasının animasyonu. Javed Hossain’e ait olan resim, wikipedia.org adresinden alınmıştır (https://en.wikipedia.org/wiki/Rapidly-exploring_random_tree)</figcaption></figure><p>Aşağıda; birden fazla sayıda engelden oluşan bir ortamda, robotumuzun engellere çarpmadan hedefe ulaşmasını inceleyeceğiz. Hareket Planlaması probleminin farklı çözümler bulmasını sağlamak amacıyla da RRT Algoritması birkaç kez çalıştırılacak.</p><p>Öncelikle robotumuzun yolunu bulacağı ortamı (C-space) görelim:</p><figure><img alt="S harfi Başlangıç, D harfi ise bitiş noktasını temsil etmektedir." src="https://cdn-images-1.medium.com/max/370/1*lAHr3uouume0z5nFD_e_dg.png" /><figcaption>*S harfi Başlangıç, D harfi ise Bitiş noktasını temsil etmektedir.</figcaption></figure><p>Başlangıç noktamız (-0.5, -0.5) koordinatlarında, bitiş noktamız ise (0.5, 0.5) koordinatlarında bulunmaktadır.</p><p>Ortamımızın görece basit olması sebebiyle RRT Algoritmamızın optimale yakın bir çözüm vermesini bekleyebiliriz.</p><p>Algoritmamızın MATLAB üzerinde koda dökülmüş halini aşağıda görebiliriz. Kodumuz öncelikle “obstacles.csv” isimli bir .csv dosyasını girdi olarak alıyor ve bu dosya üzerinden bir engeller (obstacles) matrisi oluşturuyor. Ardından başlangıç (startNode) ve hedef/bitiş (endNode) noktalarımızı iki değişkene atıyor ve algoritmamızı 50 nokta ile sınırlıyoruz. Yani algoritmamız en fazla 50 farklı nokta hesaplayarak robotumuzu hedef noktasına ulaştırmayı deneyecek. 50 farklı noktaya ulaştığımızda robotumuz halen hedef noktasına ulaşmamışsa, algoritmamız bize başarısız olduğunu söyleyecek.</p><p>Kodda dikkatinizi çekebilecek birkaç nokta var. Bunlardan birisi her bir adımda “X” ve “Y” eksenlerinde ayrı ayrı olarak örnek uzayın daraltılması. Örneğin robotumuz engellere çarpmadan (-0.15, 0. 20) noktasına ulaşabiliyorsa, algoritmamıza artık arama yaparken x eksenindeki örnek uzayının (-0.15, 0.50] ve y eksenindeki örnek uzayının (0.20, 0.50] olduğunu söylüyoruz. Yani gelişigüzel yeni noktalar seçilirken algoritmamız bu aralıklar içerisinde bir seçim yapacak. Bu yaklaşım çeşitli ortamlarda problem çıkarma potansiyeline sahip olsa da, kendi örneğimizde optimale yakın bir sonuç almaya büyük ölçüde yardımcı oluyor. Bir diğer konu da; iki noktayı birbirine bağlarken doğruların kullanılması. Yani bir noktadan yeni bir noktaya hareket düz çizgi şeklinde ilerliyor. Hareket kısıtları bulunan sistemlerde iki noktayı birbirine bağlarken, doğrular yerine başka “planlayıcılar” kullanılmakta. Kendi örneğimizde ise anlatımı basit tutmak amacıyla robotumuzun herhangi bir hareket kısıtlaması olmadığını varsaydık.</p><pre>clc<br>clear</pre><pre>%% Engellerimizi tanımlıyoruz:</pre><pre>obstacles = readmatrix(&#39;obstacles.csv&#39;);<br>centerX = obstacles(:,1);<br>centerY = obstacles(:,2);<br>radius = obstacles(:,3)/2;</pre><pre>obstacleCenterX = zeros(1, length(obstacles));<br>obstacleCenterY = zeros(1, length(obstacles));<br>obstacleRadius = zeros(1, length(obstacles));</pre><pre>for i = 1 : length(obstacles)<br>    obstacleCenterX(i) = centerX(i);<br>    obstacleCenterY(i) = centerY(i);<br>    obstacleRadius(i) = radius(i);<br>end</pre><pre>%% RRT Algoritmamızın hedef ve parametrelerini ayarlıyoruz:</pre><pre>startNode = [-0.5 -0.5];<br>endNode = [0.5 0.5];<br>maxTreeSize = 50;</pre><pre>T{1} = startNode;<br>rangeX = startNode(1) : 0.01 : endNode(1);<br>rangeY = startNode(2) : 0.01 : endNode(2);<br>nodeNumber = 1;<br>edge = [];</pre><pre>%% RRT Algoritmasını başlatıyoruz:</pre><pre>while length(T) &lt; maxTreeSize<br>    <br>    if(length(rangeX) ~= 0)<br>    xAxis = randsample(rangeX*0.1, 1);<br>    end<br>    <br>    if(length(rangeY) ~= 0)<br>    yAxis = randsample(rangeY*0.1, 1);   <br>    end<br>    <br>    xSamp = [xAxis yAxis];<br>    <br>    for i = 1 : length(T)<br>        distances = sqrt((T{1}(1) - xAxis)^2 + (T{1}(2) - yAxis)^2);<br>        index = find(distances == min(distances));<br>        xNearest = T{i};<br>    end<br>    <br>    dRange = 0 : 0.005: 0.1;<br>    distanceX = randsample(dRange, 1);<br>    distanceY = randsample(dRange, 1);<br>    <br>    xNewAxisX = xNearest(1) + distanceX;<br>    xNewAxisY = xNearest(2) + distanceY;<br>    xNew = [xNewAxisX xNewAxisY];<br>    <br>    if (xNew(1) - xNearest(1) == 0)<br>        continue<br>    end<br>    <br>    lineCoeffs = polyfit([xNearest(1) xNew(1)], [xNearest(2) xNew(2)], 1);<br>    slope = lineCoeffs(1);<br>    yIntercept = lineCoeffs(2);<br>    <br>    % Çizilen doğrunun engellere temas edip etmediğini kontrol ediyoruz:</pre><pre>    for i = 1 : length(obstacles)<br>        a = linecirc(slope,yIntercept,obstacleCenterX(i),obstacleCenterY(i),obstacleRadius(i));</pre><pre>        % a değişkeni bir NaN array&#39;i değilse (2 x 1), bu çarpışma anlamına gelir ve döngü sonlandırılır:</pre><pre>        if (~isnan(a))<br>            addCondition = 0;<br>            break<br>        else<br>            addCondition = 1;<br>        end<br>    <br>    end<br>    <br>    if xNew(1)&gt; 0.5<br>        xNew(1) = 0.5;<br>    end<br>    <br>    if xNew(2)&gt; 0.5<br>        xNew(2) = 0.5;<br>    end<br>    <br>    % Çizilen doğru engellere temas etmiyorsa; xNew, T array&#39;ine eklenir ve xNew ile xNearest arasında yeni bir kenar/bağlantı oluşturulur:<br><br>    if (addCondition ~= 0)<br>        T{length(T) + 1} = xNew;<br>        nodeDistance = sqrt((xNearest(1) - xNew(1))^2 + (xNearest(2) - xNew(2))^2);<br>        edge{length(edge) + 1} = [nodeNumber nodeNumber+1 nodeDistance];<br>        nodeNumber = nodeNumber + 1;</pre><pre>        % Hedef noktaya yakınlaşabilmek için örnek uzayımızı daraltıyoruz:</pre><pre>        narrowRangeX = rangeX &lt; xNew(1);<br>        narrowRangeY = rangeY &lt; xNew(2);<br>        rangeX(narrowRangeX) = [];<br>        rangeY(narrowRangeY) = [];<br>        <br>        if xNew == endNode<br>            disp(&#39;RRT is completed successfully!&#39;)<br>            for j = 1 : length(T)<br>                nodes(j, :) = [j T{j}];<br>            end<br>            <br>            for j = 1 : length(edge)<br>                edges(j, :) = edge{j};<br>            end           <br>            <br>            writematrix(edges, &#39;edges.csv&#39;);<br>            writematrix(nodes, &#39;nodes.csv&#39;);<br>            writematrix(nodes(:,1)&#39;, &#39;path.csv&#39;)<br>            return<br>        end<br>    end<br>    <br>end<br>disp(&#39;RRT is not completed successfully!&#39;)</pre><p>Kodumuzu her çalıştırdığımızda “RRT is completed successfully! (RRT başarıyla tamamlandı!)” sonucunu almayı bekliyoruz. Zira, kodumuzun başında algoritmamızı 50 noktayla sınırlamıştık ve bu 50 sayısı algoritmamız için zor bir limit değil. Kodu yaklaşık 15 defa çalıştırdım ve bu 15 seferde algoritmanın hesapladığı en yüksek nokta sayısı 29&#39;du. Ancak 50 olan bu sınırı 25&#39;e çekersek ya da farklı bir ortamda deneme yaparsak algoritmamızın başarısız olduğu durumlarla da karşılaşabiliriz.</p><p>Algoritma tarafından hesaplanan iki farklı yolu aşağıda görebiliriz (Yolların simulasyonu CoppeliaSim isimli Robot Simulasyon programında gerçekleştirilmiştir):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*e0n8y5kd0OJgwXuCASmwhw.png" /><figcaption>Algoritma tarafından hesap ilk yol (26 farklı noktadan oluşuyor)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*_mUgOd1Tj0wGZ0FXGAyF3A.png" /><figcaption>Algoritma tarafından hesap ikinci yol (29 farklı noktadan oluşuyor)</figcaption></figure><p>İki farklı sonucun da gösterdiği üzere, örnek uzay üzerinden (neredeyse) gelişigüzel noktaların seçilmesi sebebiyle algoritma her çalıştırıldığında farklı sonuçlar verebiliyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*S6WOPG-wdxt6CRJzZUYMWA.gif" /><figcaption>Robotun engellere çarpmadan ilerlemesi.</figcaption></figure><p>Bu projenin kodunu ve engelleri içeren .csv dosyasının da bulunduğu diğer simulasyon dosyalarımı <a href="https://github.com/kucar17">GitHub sayfamda</a> bulabilirsiniz.</p><p>Yazımda kullandığım simulasyon ortamı; Northwestern University tarafından Coursera’da yayınlanan “Modern Robotics: Mechanics, Planning, and Control Specialization” isimli eğitim serisinin sağlamış olduğu simulasyon ortamı paketinin içerisinde bulunmaktadır. Bu proje de aynı eğitim serisinin dördüncü kursu olan “Modern Robotics, Course 4: Robot Motion Planning and Control” kursundaki 2. hafta ödevinden esinlenilerek yapılmıştır.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57a8c51dfab4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>