<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8"/> <title>OMPL: src/ompl/contrib/rrt_star/BallTreeRRTstar.h Source File</title> <meta name="author" content="Ioan A. Șucan, Mark Moll, Lydia E. Kavraki"> <link rel="stylesheet" href="../css/screen.css" type="text/css" media="screen, projection"> <link rel="stylesheet" href="../css/print.css" type="text/css" media="print"> <!--[if lt IE 7]> <script type="text/javascript" src="../js/jquery/jquery.js"></script> <script type="text/javascript" src="../js/jquery/jquery.dropdown.js"></script> <![endif]--> <script type="text/javaScript" src="search/search.js"></script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-9156598-2']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <body onload='searchBox.OnSelectItem(0);'> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search API'); --></script> <div class="navigation" id="top"> <div class="tabs" id="ompltitle"> <ul class="tablist"> <li>The Open Motion Planning Library</li> <li id="searchli"> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search API" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <ul id="nav" class="dropdown"> <li class="first"><a href="index.html">Home</a></li> <li><a href="download.html">Download</a></li> <li><a href="documentation.html">Documentation</a></li> <li><span class="dir">Code API</span> <ul> <li><a href="api_overview.html">API Overview</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="annotated.html">Classes</a></li> <li><a href="files.html">Files</a></li> <li><a href="dirs.html">Directories</a></li> </ul> </li> <li><span class="dir">Community</span> <ul> <li><a href="developers.html">Developers</a></li> <li><a href="thirdparty.html">Contributions</a></li> <li><a href="education.html">Education</a></li> <li><a href="gallery.html">Gallery</a></li> </ul> </li> <li><span class="dir">About</span> <ul> <li><a href="license.html">License</a></li> <li><a href="citations.html">Citations</a></li> <li><a href="acknowledgements.html">Acknowledgments</a></li> <li><a href="contact.html">Contact Us</a></li> </ul> </li> </ul> </div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="" frameborder="0"name="MSearchResults" id="MSearchResults"></iframe> </div> <div class="container"> <div class="span-22 push-2 first last"> <div> <!-- Generated by Doxygen 1.7.4 --> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_f5421e52a658cd938113ed6044324834.html">src</a> </li> <li class="navelem"><a class="el" href="dir_ae92c2ff78847f0cb49b545f9089bbbc.html">ompl</a> </li> <li class="navelem"><a class="el" href="dir_9f71015475b38a69aaae354435fa4512.html">contrib</a> </li> <li class="navelem"><a class="el" href="dir_dc31619b058474cd7b929e82901d6adb.html">rrt_star</a> </li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <div class="title">BallTreeRRTstar.h</div> </div> </div> <div class="contents"> <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*********************************************************************</span> <a name="l00002"></a>00002 <span class="comment">* Software License Agreement (BSD License)</span> <a name="l00003"></a>00003 <span class="comment">*</span> <a name="l00004"></a>00004 <span class="comment">* Copyright (c) 2011, Rice University</span> <a name="l00005"></a>00005 <span class="comment">* All rights reserved.</span> <a name="l00006"></a>00006 <span class="comment">*</span> <a name="l00007"></a>00007 <span class="comment">* Redistribution and use in source and binary forms, with or without</span> <a name="l00008"></a>00008 <span class="comment">* modification, are permitted provided that the following conditions</span> <a name="l00009"></a>00009 <span class="comment">* are met:</span> <a name="l00010"></a>00010 <span class="comment">*</span> <a name="l00011"></a>00011 <span class="comment">* * Redistributions of source code must retain the above copyright</span> <a name="l00012"></a>00012 <span class="comment">* notice, this list of conditions and the following disclaimer.</span> <a name="l00013"></a>00013 <span class="comment">* * Redistributions in binary form must reproduce the above</span> <a name="l00014"></a>00014 <span class="comment">* copyright notice, this list of conditions and the following</span> <a name="l00015"></a>00015 <span class="comment">* disclaimer in the documentation and/or other materials provided</span> <a name="l00016"></a>00016 <span class="comment">* with the distribution.</span> <a name="l00017"></a>00017 <span class="comment">* * Neither the name of the Rice University nor the names of its</span> <a name="l00018"></a>00018 <span class="comment">* contributors may be used to endorse or promote products derived</span> <a name="l00019"></a>00019 <span class="comment">* from this software without specific prior written permission.</span> <a name="l00020"></a>00020 <span class="comment">*</span> <a name="l00021"></a>00021 <span class="comment">* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span> <a name="l00022"></a>00022 <span class="comment">* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span> <a name="l00023"></a>00023 <span class="comment">* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS</span> <a name="l00024"></a>00024 <span class="comment">* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE</span> <a name="l00025"></a>00025 <span class="comment">* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,</span> <a name="l00026"></a>00026 <span class="comment">* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,</span> <a name="l00027"></a>00027 <span class="comment">* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span> <a name="l00028"></a>00028 <span class="comment">* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span> <a name="l00029"></a>00029 <span class="comment">* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span> <a name="l00030"></a>00030 <span class="comment">* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN</span> <a name="l00031"></a>00031 <span class="comment">* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span> <a name="l00032"></a>00032 <span class="comment">* POSSIBILITY OF SUCH DAMAGE.</span> <a name="l00033"></a>00033 <span class="comment">*********************************************************************/</span> <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="comment">/* Authors: Alejandro Perez, Sertac Karaman, Ioan Sucan */</span> <a name="l00036"></a>00036 <a name="l00037"></a>00037 <span class="preprocessor">#ifndef OMPL_CONTRIB_RRT_STAR_BTRRTSTAR_</span> <a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#define OMPL_CONTRIB_RRT_STAR_BTRRTSTAR_</span> <a name="l00039"></a>00039 <span class="preprocessor"></span> <a name="l00040"></a>00040 <span class="preprocessor">#include "ompl/geometric/planners/PlannerIncludes.h"</span> <a name="l00041"></a>00041 <span class="preprocessor">#include "ompl/datastructures/NearestNeighbors.h"</span> <a name="l00042"></a>00042 <span class="preprocessor">#include "ompl/base/spaces/RealVectorStateSpace.h"</span> <a name="l00043"></a>00043 <span class="preprocessor">#include <limits></span> <a name="l00044"></a>00044 <span class="preprocessor">#include <vector></span> <a name="l00045"></a>00045 <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="keyword">namespace </span>ompl <a name="l00048"></a>00048 { <a name="l00049"></a>00049 <a name="l00050"></a><a class="code" href="namespaceompl_1_1geometric.html">00050</a> <span class="keyword">namespace </span>geometric <a name="l00051"></a>00051 { <a name="l00052"></a>00052 <a name="l00080"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html">00080</a> <span class="keyword">class </span><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html" title="Optimal Rapidly-exploring Random Trees with Ball Trees.">BallTreeRRTstar</a> : <span class="keyword">public</span> base::Planner <a name="l00081"></a>00081 { <a name="l00082"></a>00082 <span class="keyword">public</span>: <a name="l00083"></a>00083 <a name="l00084"></a>00084 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html" title="Optimal Rapidly-exploring Random Trees with Ball Trees.">BallTreeRRTstar</a>(<span class="keyword">const</span> <a class="code" href="classompl_1_1base_1_1SpaceInformationPtr.html" title="A boost shared pointer wrapper for ompl::base::SpaceInformation.">base::SpaceInformationPtr</a> &si) : <a class="code" href="classompl_1_1base_1_1Planner.html#a404c3be95f77983e95a468e3a7032cc9" title="Constructor.">base::Planner</a>(si, <span class="stringliteral">"BallTreeRRTstar"</span>) <a name="l00085"></a>00085 { <a name="l00086"></a>00086 <a class="code" href="classompl_1_1base_1_1Planner.html#a4311ea7a0470f0e0f76cb1656d63e365" title="The specifications of the planner (its capabilities)">specs_</a>.approximateSolutions = <span class="keyword">true</span>; <a name="l00087"></a>00087 <a class="code" href="classompl_1_1base_1_1Planner.html#a4311ea7a0470f0e0f76cb1656d63e365" title="The specifications of the planner (its capabilities)">specs_</a>.optimizingPaths = <span class="keyword">true</span>; <a name="l00088"></a>00088 <a name="l00089"></a>00089 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a33a19e26f0cec791f0bdf871155f603b" title="The fraction of time the goal is picked as the state to expand towards (if such a state is available)...">goalBias_</a> = 0.05; <a name="l00090"></a>00090 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a74f84ff8f56b4413a617bee1dc5ee68d" title="The maximum length of a motion to be added to a tree.">maxDistance_</a> = 0.0; <a name="l00091"></a>00091 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a313137f73961f360e6eebaba79f21315" title="Maximum radius the planner uses to find near neighbors and rewire.">ballRadiusMax_</a> = 0.0; <a name="l00092"></a>00092 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ae031c5ecc5c5a557692862f41d325f11" title="Shrink rate of radius the planner uses to find near neighbors and rewire.">ballRadiusConst_</a> = 1.0; <a name="l00093"></a>00093 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a55358bb64b5f55532df2961ccccd8a5a" title="Initial radius of volumes assigned to new vertices in the tree.">rO_</a> = std::numeric_limits<double>::infinity(); <a name="l00094"></a>00094 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ace5c17f5eae277cbe6c9e2dc8f3fb1ed" title="Option to delay and reduce collision checking within iterations.">delayCC_</a> = <span class="keyword">true</span>; <a name="l00095"></a>00095 } <a name="l00096"></a>00096 <a name="l00097"></a>00097 <span class="keyword">virtual</span> ~<a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html" title="Optimal Rapidly-exploring Random Trees with Ball Trees.">BallTreeRRTstar</a>(<span class="keywordtype">void</span>) <a name="l00098"></a>00098 { <a name="l00099"></a>00099 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ace1165ebcf8b4712422bc53a73ae5dec" title="Free the memory allocated by this planner.">freeMemory</a>(); <a name="l00100"></a>00100 } <a name="l00101"></a>00101 <a name="l00102"></a>00102 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a8ea2d6a703307a13272b52588acca8ef" title="Get information about the current run of the motion planner. Repeated calls to this function will upd...">getPlannerData</a>(<a class="code" href="classompl_1_1base_1_1PlannerData.html" title="Datatype holding data a planner can expose for debug purposes.">base::PlannerData</a> &data) <span class="keyword">const</span>; <a name="l00103"></a>00103 <a name="l00104"></a>00104 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#aca33b01960299c9fd1704e6cdaf06c06" title="Function that can solve the motion planning problem. This function can be called multiple times on th...">solve</a>(<span class="keyword">const</span> <a class="code" href="classompl_1_1base_1_1PlannerTerminationCondition.html" title="Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whe...">base::PlannerTerminationCondition</a> &ptc); <a name="l00105"></a>00105 <a name="l00106"></a>00106 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a450aea782c10383dc22e21cfcb72dcea" title="Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() wil...">clear</a>(<span class="keywordtype">void</span>); <a name="l00107"></a>00107 <a name="l00117"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a70b2c08354698e9db840bbf1c6948ef0">00117</a> <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a70b2c08354698e9db840bbf1c6948ef0" title="Set the goal bias.">setGoalBias</a>(<span class="keywordtype">double</span> goalBias) <a name="l00118"></a>00118 { <a name="l00119"></a>00119 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a33a19e26f0cec791f0bdf871155f603b" title="The fraction of time the goal is picked as the state to expand towards (if such a state is available)...">goalBias_</a> = goalBias; <a name="l00120"></a>00120 } <a name="l00121"></a>00121 <a name="l00123"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a3e21418a91e339c1ef88d6f230137f97">00123</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a3e21418a91e339c1ef88d6f230137f97" title="Get the goal bias the planner is using.">getGoalBias</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> <a name="l00124"></a>00124 <span class="keyword"> </span>{ <a name="l00125"></a>00125 <span class="keywordflow">return</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a33a19e26f0cec791f0bdf871155f603b" title="The fraction of time the goal is picked as the state to expand towards (if such a state is available)...">goalBias_</a>; <a name="l00126"></a>00126 } <a name="l00127"></a>00127 <a name="l00133"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a419daaa5e348bffc0910cd7c20f3ae7d">00133</a> <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a419daaa5e348bffc0910cd7c20f3ae7d" title="Set the range the planner is supposed to use.">setRange</a>(<span class="keywordtype">double</span> distance) <a name="l00134"></a>00134 { <a name="l00135"></a>00135 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a74f84ff8f56b4413a617bee1dc5ee68d" title="The maximum length of a motion to be added to a tree.">maxDistance_</a> = distance; <a name="l00136"></a>00136 } <a name="l00137"></a>00137 <a name="l00139"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a94bbec9d263a902069a90a70ddb3d715">00139</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a94bbec9d263a902069a90a70ddb3d715" title="Get the range the planner is using.">getRange</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> <a name="l00140"></a>00140 <span class="keyword"> </span>{ <a name="l00141"></a>00141 <span class="keywordflow">return</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a74f84ff8f56b4413a617bee1dc5ee68d" title="The maximum length of a motion to be added to a tree.">maxDistance_</a>; <a name="l00142"></a>00142 } <a name="l00143"></a>00143 <a name="l00153"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a4a58f01c44cce7010f946a51d326df96">00153</a> <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a4a58f01c44cce7010f946a51d326df96" title="When the planner attempts to rewire the tree, it does so by looking at some of the neighbors within a...">setBallRadiusConstant</a>(<span class="keywordtype">double</span> ballRadiusConstant) <a name="l00154"></a>00154 { <a name="l00155"></a>00155 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ae031c5ecc5c5a557692862f41d325f11" title="Shrink rate of radius the planner uses to find near neighbors and rewire.">ballRadiusConst_</a> = ballRadiusConstant; <a name="l00156"></a>00156 } <a name="l00157"></a>00157 <a name="l00161"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ad88faf8fc58653cf3318c270961713bf">00161</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ad88faf8fc58653cf3318c270961713bf" title="Get the multiplicative factor used in the computation of the radius whithin which tree rewiring is do...">getBallRadiusConstant</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> <a name="l00162"></a>00162 <span class="keyword"> </span>{ <a name="l00163"></a>00163 <span class="keywordflow">return</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ae031c5ecc5c5a557692862f41d325f11" title="Shrink rate of radius the planner uses to find near neighbors and rewire.">ballRadiusConst_</a>; <a name="l00164"></a>00164 } <a name="l00165"></a>00165 <a name="l00174"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ad2d37a360030644b484ce3963d4ed348">00174</a> <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ad2d37a360030644b484ce3963d4ed348" title="When the planner attempts to rewire the tree, it does so by looking at some of the neighbors within a...">setMaxBallRadius</a>(<span class="keywordtype">double</span> maxBallRadius) <a name="l00175"></a>00175 { <a name="l00176"></a>00176 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a313137f73961f360e6eebaba79f21315" title="Maximum radius the planner uses to find near neighbors and rewire.">ballRadiusMax_</a> = maxBallRadius; <a name="l00177"></a>00177 } <a name="l00178"></a>00178 <a name="l00181"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a4f12db53111f2b1fe7bd1b2377207c19">00181</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a4f12db53111f2b1fe7bd1b2377207c19" title="Get the maximum radius the planner uses in the tree rewiring step.">getMaxBallRadius</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> <a name="l00182"></a>00182 <span class="keyword"> </span>{ <a name="l00183"></a>00183 <span class="keywordflow">return</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a313137f73961f360e6eebaba79f21315" title="Maximum radius the planner uses to find near neighbors and rewire.">ballRadiusMax_</a>; <a name="l00184"></a>00184 } <a name="l00185"></a>00185 <a name="l00190"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a84af5186357ce1d7380254d1cf59b83e">00190</a> <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a84af5186357ce1d7380254d1cf59b83e" title="Each vertex in the tree has a volume (hyper-sphere) associated with it. The radius of said volume is ...">setInitialVolumeRadius</a>(<span class="keywordtype">double</span> rO) <a name="l00191"></a>00191 { <a name="l00192"></a>00192 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a55358bb64b5f55532df2961ccccd8a5a" title="Initial radius of volumes assigned to new vertices in the tree.">rO_</a> = rO; <a name="l00193"></a>00193 } <a name="l00194"></a>00194 <a name="l00196"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ad7518f0df19cdde74920c420736ca3c8">00196</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ad7518f0df19cdde74920c420736ca3c8" title="Get the initial volume radius.">getInitialVolumeRadius</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> <a name="l00197"></a>00197 <span class="keyword"> </span>{ <a name="l00198"></a>00198 <span class="keywordflow">return</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a55358bb64b5f55532df2961ccccd8a5a" title="Initial radius of volumes assigned to new vertices in the tree.">rO_</a>; <a name="l00199"></a>00199 } <a name="l00200"></a>00200 <a name="l00202"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a0eb8816c4b6f104969c7a416c0d2a5d1">00202</a> <span class="keywordtype">bool</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a0eb8816c4b6f104969c7a416c0d2a5d1" title="Verify if a state is inside an existing volume.">inVolume</a>(<a class="code" href="classompl_1_1base_1_1State.html" title="Definition of an abstract state.">base::State</a> *state) <a name="l00203"></a>00203 { <a name="l00204"></a>00204 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0 ; i < <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a0e00059a9ab09563c25d7bc378ae65f6" title="A copy of the list of motions in the tree used for faser verification of samples.">motions_</a>.size() ; ++i) <a name="l00205"></a>00205 { <a name="l00206"></a>00206 <span class="keywordflow">if</span> ((<a class="code" href="classompl_1_1base_1_1Planner.html#aa3ceb9471163b6c96f6eeadbcfd3694e" title="The space information for which planning is done.">si_</a>->distance(<a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a0e00059a9ab09563c25d7bc378ae65f6" title="A copy of the list of motions in the tree used for faser verification of samples.">motions_</a>[i]->state, state) <= <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a0e00059a9ab09563c25d7bc378ae65f6" title="A copy of the list of motions in the tree used for faser verification of samples.">motions_</a>[i]->volRadius)) <a name="l00207"></a>00207 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00208"></a>00208 } <a name="l00209"></a>00209 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00210"></a>00210 } <a name="l00211"></a>00211 <a name="l00212"></a>00212 <a name="l00214"></a>00214 <span class="keyword">template</span><<span class="keyword">template</span><<span class="keyword">typename</span> T> <span class="keyword">class </span>NN> <a name="l00215"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ab055cfe175c683d665f2649e87d59006">00215</a> <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ab055cfe175c683d665f2649e87d59006" title="Set a different nearest neighbors datastructure.">setNearestNeighbors</a>(<span class="keywordtype">void</span>) <a name="l00216"></a>00216 { <a name="l00217"></a>00217 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#acc4f6c9bc0eab53494c14c1410c11484" title="A nearest-neighbors datastructure containing the tree of motions.">nn_</a>.reset(<span class="keyword">new</span> NN<Motion*>()); <a name="l00218"></a>00218 } <a name="l00219"></a>00219 <a name="l00227"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ab66c1d17aef42d231e326f229d371cac">00227</a> <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ab66c1d17aef42d231e326f229d371cac" title="Option that delays collision checking procedures. When it is enabled, all neighbors are sorted by cos...">setDelayCC</a>(<span class="keywordtype">bool</span> delayCC) <a name="l00228"></a>00228 { <a name="l00229"></a>00229 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ace5c17f5eae277cbe6c9e2dc8f3fb1ed" title="Option to delay and reduce collision checking within iterations.">delayCC_</a> = delayCC; <a name="l00230"></a>00230 } <a name="l00231"></a>00231 <a name="l00233"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a81097da98a166e5d9d5a3c804e97d0cc">00233</a> <span class="keywordtype">bool</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a81097da98a166e5d9d5a3c804e97d0cc" title="Get the state of the delayed collision checking option.">getDelayCC</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> <a name="l00234"></a>00234 <span class="keyword"> </span>{ <a name="l00235"></a>00235 <span class="keywordflow">return</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ace5c17f5eae277cbe6c9e2dc8f3fb1ed" title="Option to delay and reduce collision checking within iterations.">delayCC_</a>; <a name="l00236"></a>00236 } <a name="l00237"></a>00237 <a name="l00238"></a>00238 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#afd5af5d5217dff1115820202d9c85ac3" title="Perform extra configuration steps, if needed. This call will also issue a call to ompl::base::SpaceIn...">setup</a>(<span class="keywordtype">void</span>); <a name="l00239"></a>00239 <a name="l00240"></a>00240 <span class="keyword">protected</span>: <a name="l00241"></a>00241 <a name="l00243"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html">00243</a> <span class="keyword">class </span><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html" title="Representation of a motion.">Motion</a> <a name="l00244"></a>00244 { <a name="l00245"></a>00245 <span class="keyword">public</span>: <a name="l00246"></a>00246 <a name="l00247"></a>00247 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html" title="Representation of a motion.">Motion</a>(<span class="keywordtype">double</span> rO) : <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a8d95ca2061c2d38e294a307c0bd86be1" title="The state contained by the motion.">state</a>(NULL), <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#af3b35ea82a4ce4a771ae72e12c3d8298" title="The parent motion in the exploration tree.">parent</a>(NULL), <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a589e3cb7a2a25c4f54dde560c31c379e" title="The cost of this motion.">cost</a>(0.0), <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a36a1c4c7f77b7c5c6ee14adc9f5a4b72" title="The radius of the volume associated to this motion.">volRadius</a>(rO) <a name="l00248"></a>00248 { <a name="l00249"></a>00249 } <a name="l00250"></a>00250 <a name="l00252"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a915477fd8447d2f84d64d3380d653ed3">00252</a> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html" title="Representation of a motion.">Motion</a>(<span class="keyword">const</span> <a class="code" href="classompl_1_1base_1_1SpaceInformationPtr.html" title="A boost shared pointer wrapper for ompl::base::SpaceInformation.">base::SpaceInformationPtr</a> &si, <span class="keywordtype">double</span> rO) : <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a8d95ca2061c2d38e294a307c0bd86be1" title="The state contained by the motion.">state</a>(si->allocState()), <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#af3b35ea82a4ce4a771ae72e12c3d8298" title="The parent motion in the exploration tree.">parent</a>(NULL), <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a589e3cb7a2a25c4f54dde560c31c379e" title="The cost of this motion.">cost</a>(0.0), <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a36a1c4c7f77b7c5c6ee14adc9f5a4b72" title="The radius of the volume associated to this motion.">volRadius</a>(rO) <a name="l00253"></a>00253 <a name="l00254"></a>00254 { <a name="l00255"></a>00255 } <a name="l00256"></a>00256 <a name="l00257"></a>00257 ~<a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html" title="Representation of a motion.">Motion</a>(<span class="keywordtype">void</span>) <a name="l00258"></a>00258 { <a name="l00259"></a>00259 } <a name="l00260"></a>00260 <a name="l00262"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a8d95ca2061c2d38e294a307c0bd86be1">00262</a> <a class="code" href="classompl_1_1base_1_1State.html" title="Definition of an abstract state.">base::State</a> *<a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a8d95ca2061c2d38e294a307c0bd86be1" title="The state contained by the motion.">state</a>; <a name="l00263"></a>00263 <a name="l00265"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#af3b35ea82a4ce4a771ae72e12c3d8298">00265</a> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html" title="Representation of a motion.">Motion</a> *<a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#af3b35ea82a4ce4a771ae72e12c3d8298" title="The parent motion in the exploration tree.">parent</a>; <a name="l00266"></a>00266 <a name="l00268"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a589e3cb7a2a25c4f54dde560c31c379e">00268</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a589e3cb7a2a25c4f54dde560c31c379e" title="The cost of this motion.">cost</a>; <a name="l00269"></a>00269 <a name="l00271"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a36a1c4c7f77b7c5c6ee14adc9f5a4b72">00271</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a36a1c4c7f77b7c5c6ee14adc9f5a4b72" title="The radius of the volume associated to this motion.">volRadius</a>; <a name="l00272"></a>00272 }; <a name="l00273"></a>00273 <a name="l00275"></a>00275 <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ace1165ebcf8b4712422bc53a73ae5dec" title="Free the memory allocated by this planner.">freeMemory</a>(<span class="keywordtype">void</span>); <a name="l00276"></a>00276 <a name="l00278"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a8c21342a5f17ed28477efe458e123195">00278</a> <span class="keywordtype">void</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a8c21342a5f17ed28477efe458e123195" title="Add a motion to the tree.">addMotion</a>(<a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html" title="Representation of a motion.">Motion</a>* m) <a name="l00279"></a>00279 { <a name="l00280"></a>00280 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#acc4f6c9bc0eab53494c14c1410c11484" title="A nearest-neighbors datastructure containing the tree of motions.">nn_</a>->add(m); <a name="l00281"></a>00281 <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a0e00059a9ab09563c25d7bc378ae65f6" title="A copy of the list of motions in the tree used for faser verification of samples.">motions_</a>.push_back(m); <a name="l00282"></a>00282 } <a name="l00283"></a>00283 <a name="l00285"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a449342b8dd1ff55891a0f567607e53be">00285</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a449342b8dd1ff55891a0f567607e53be" title="Sort the near neighbors by cost.">compareMotion</a>(<span class="keyword">const</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html" title="Representation of a motion.">Motion</a>* a, <span class="keyword">const</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html" title="Representation of a motion.">Motion</a>* b) <a name="l00286"></a>00286 { <a name="l00287"></a>00287 <span class="keywordflow">return</span> (a-><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a589e3cb7a2a25c4f54dde560c31c379e" title="The cost of this motion.">cost</a> < b-><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a589e3cb7a2a25c4f54dde560c31c379e" title="The cost of this motion.">cost</a>); <a name="l00288"></a>00288 } <a name="l00290"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ad23854a908038c8caf45c9ab8421acc1">00290</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ad23854a908038c8caf45c9ab8421acc1" title="Distance calculation considering volumes.">distanceFunction</a>(<span class="keyword">const</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html" title="Representation of a motion.">Motion</a>* a, <span class="keyword">const</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html" title="Representation of a motion.">Motion</a>* b)<span class="keyword"> const</span> <a name="l00291"></a>00291 <span class="keyword"> </span>{ <a name="l00292"></a>00292 <span class="keywordflow">return</span> (<a class="code" href="classompl_1_1base_1_1Planner.html#aa3ceb9471163b6c96f6eeadbcfd3694e" title="The space information for which planning is done.">si_</a>->distance(a-><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a8d95ca2061c2d38e294a307c0bd86be1" title="The state contained by the motion.">state</a>, b-><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a8d95ca2061c2d38e294a307c0bd86be1" title="The state contained by the motion.">state</a>)) - a-><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar_1_1Motion.html#a36a1c4c7f77b7c5c6ee14adc9f5a4b72" title="The radius of the volume associated to this motion.">volRadius</a>; <a name="l00293"></a>00293 } <a name="l00294"></a>00294 <a name="l00296"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a6e8cc8d05aa98c353c6c048c17835e54">00296</a> <a class="code" href="classompl_1_1base_1_1StateSamplerPtr.html" title="A boost shared pointer wrapper for ompl::base::StateSampler.">base::StateSamplerPtr</a> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a6e8cc8d05aa98c353c6c048c17835e54" title="State sampler.">sampler_</a>; <a name="l00297"></a>00297 <a name="l00299"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#acc4f6c9bc0eab53494c14c1410c11484">00299</a> boost::shared_ptr< NearestNeighbors<Motion*> > <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#acc4f6c9bc0eab53494c14c1410c11484" title="A nearest-neighbors datastructure containing the tree of motions.">nn_</a>; <a name="l00300"></a>00300 <a name="l00302"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a0e00059a9ab09563c25d7bc378ae65f6">00302</a> std::vector<Motion*> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a0e00059a9ab09563c25d7bc378ae65f6" title="A copy of the list of motions in the tree used for faser verification of samples.">motions_</a>; <a name="l00303"></a>00303 <a name="l00305"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a33a19e26f0cec791f0bdf871155f603b">00305</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a33a19e26f0cec791f0bdf871155f603b" title="The fraction of time the goal is picked as the state to expand towards (if such a state is available)...">goalBias_</a>; <a name="l00306"></a>00306 <a name="l00308"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a74f84ff8f56b4413a617bee1dc5ee68d">00308</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a74f84ff8f56b4413a617bee1dc5ee68d" title="The maximum length of a motion to be added to a tree.">maxDistance_</a>; <a name="l00309"></a>00309 <a name="l00311"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a9c8c838fdf405d6720a282688e1918c7">00311</a> <a class="code" href="classompl_1_1RNG.html" title="Random number generation. An instance of this class cannot be used by multiple threads at once (membe...">RNG</a> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a9c8c838fdf405d6720a282688e1918c7" title="The random number generator.">rng_</a>; <a name="l00312"></a>00312 <a name="l00314"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ae031c5ecc5c5a557692862f41d325f11">00314</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ae031c5ecc5c5a557692862f41d325f11" title="Shrink rate of radius the planner uses to find near neighbors and rewire.">ballRadiusConst_</a>; <a name="l00315"></a>00315 <a name="l00317"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a313137f73961f360e6eebaba79f21315">00317</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a313137f73961f360e6eebaba79f21315" title="Maximum radius the planner uses to find near neighbors and rewire.">ballRadiusMax_</a>; <a name="l00318"></a>00318 <a name="l00320"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ace5c17f5eae277cbe6c9e2dc8f3fb1ed">00320</a> <span class="keywordtype">bool</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#ace5c17f5eae277cbe6c9e2dc8f3fb1ed" title="Option to delay and reduce collision checking within iterations.">delayCC_</a>; <a name="l00321"></a>00321 <a name="l00323"></a><a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a55358bb64b5f55532df2961ccccd8a5a">00323</a> <span class="keywordtype">double</span> <a class="code" href="classompl_1_1geometric_1_1BallTreeRRTstar.html#a55358bb64b5f55532df2961ccccd8a5a" title="Initial radius of volumes assigned to new vertices in the tree.">rO_</a>; <a name="l00324"></a>00324 }; <a name="l00325"></a>00325 <a name="l00326"></a>00326 } <a name="l00327"></a>00327 } <a name="l00328"></a>00328 <a name="l00329"></a>00329 <span class="preprocessor">#endif</span> </pre></div></div> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div> <div class="footer span-22 push-2 last"> <a href="http://www.kavrakilab.org">Physical and Biological Computing Group</a> • <a href="http://www.cs.rice.edu">Department of Computer Science</a> • <a href="http://www.rice.edu">Rice University</a><br> <div class="gray">Generated on Sun Oct 9 2011 23:04:40 by <a href="http://www.doxygen.org/index.html">doxygen</a> 1.7.4</div> </div> </div> </body> </html>