Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConditionalStateSampler_8cpp_source.html
More file actions
Latest commit
308 lines (306 loc) · 36.7 KB
/
Copy pathConditionalStateSampler_8cpp_source.html
File metadata and controls
308 lines (306 loc) · 36.7 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!-- HTML header for doxygen 1.14.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml" lang="en-US" class="light-mode">
<head>
<metaname="color-scheme" content="light">
<metahttp-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<metahttp-equiv="X-UA-Compatible" content="IE=11"/>
<metaname="generator" content="Doxygen 1.16.1"/>
<metaname="viewport" content="width=device-width, initial-scale=1"/>
<title>ompl: ompl/base/samplers/src/ConditionalStateSampler.cpp Source File</title>
<linkhref="tabs.css" rel="stylesheet" type="text/css"/>
<scripttype="text/javascript" src="jquery.js"></script>
<scripttype="text/javascript" src="dynsections.js"></script>
<scripttype="text/javascript" src="clipboard.js"></script>
<scripttype="text/javascript" src="cookie.js"></script>
<linkhref="search/search.css" rel="stylesheet" type="text/css"/>
<scripttype="text/javascript" src="search/searchdata.js"></script>
<scripttype="text/javascript" src="search/search.js"></script>
<scripttype="text/javascript">
$(function(){init_search();});
</script>
<linkhref="doxygen.css" rel="stylesheet" type="text/css" />
<linkhref="ompl.css" rel="stylesheet" type="text/css"/>
<linkrel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<linkhref="ompl.css" rel="stylesheet">
</head>
<body>
<divid="top"><!-- do not remove this div, it is closed by doxygen! -->
<navclass="navbar navbar-expand-md fixed-top navbar-dark">
<aclass="navbar-brand" href="./index.html">OMPL</a>
<buttonclass="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar">
<spanclass="navbar-toggler-icon"></span>
</button>
<divclass="collapse navbar-collapse" id="navbar">
<ulclass="navbar-nav mr-auto">
<liclass="nav-item"><aclass="nav-link" href="download.html">Download</a></li>
<liclass="nav-item dropdown">
<aclass="nav-link dropdown-toggle" href="#" id="docDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
<divclass="dropdown-menu" aria-labelledby="docDropdown">
<aclass="dropdown-item" href="https://ompl.kavrakilab.org/OMPL_Primer.pdf">Primer</a>
<aclass="dropdown-item" href="installation.html">Installation</a>
<aclass="dropdown-item" href="tutorials.html">Tutorials</a>
<aclass="dropdown-item" href="demos.html">Demos</a>
<aclass="dropdown-item" href="python.html">Python Bindings</a>
<aclass="dropdown-item" href="planners.html">Available Planners</a>
<aclass="dropdown-item" href="plannerTerminationConditions.html">Planner Termination Conditions</a>
<aclass="dropdown-item" href="benchmark.html">Benchmarking Planners</a>
<aclass="dropdown-item" href="spaces.html">Available State Spaces</a>
<aclass="dropdown-item" href="optimalPlanning.html">Optimal Planning</a>
<aclass="dropdown-item" href="constrainedPlanning.html">Constrained Planning</a>
<aclass="dropdown-item" href="multiLevelPlanning.html">Multilevel Planning</a>
<aclass="dropdown-item" href="FAQ.html">FAQ</a>
<divclass="dropdown-divider"></div>
<divclass="dropdown-header">External links</div>
<aclass="dropdown-item" href="http://moveit.ros.org">MoveIt</a>
<aclass="dropdown-item" href="http://plannerarena.org">Planner Arena</a>
<aclass="dropdown-item" href="https://www.youtube.com/watch?v=jWHYR5OYqjQ">ICRA 2026 Tutorial</a>
</div>
</li>
<liclass="nav-item"><aclass="nav-link" href="gallery.html">Gallery</a></li>
<liclass="nav-item"><aclass="nav-link" href="integration.html">OMPL Integrations</a></li>
<liclass="nav-item dropdown">
<aclass="nav-link dropdown-toggle" href="#" id="codeDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Code</a>
<divclass="dropdown-menu" aria-labelledby="codeDropdown">
<aclass="dropdown-item" href="api_overview.html">API Overview</a>
<aclass="dropdown-item" href="annotated.html">Classes</a>
<aclass="dropdown-item" href="files.html">Files</a>
<aclass="dropdown-item" href="styleGuide.html">Style Guide</a>
<aclass="dropdown-item" href="https://github.com/ompl/ompl">OMPL on GitHub</a>
</div>
</li>
<liclass="nav-item"><aclass="nav-link" href="https://github.com/ompl/ompl/issues">Issues</a></li>
<liclass="nav-item dropdown">
<aclass="nav-link dropdown-toggle" href="#" id="communityDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Community</a>
<divclass="dropdown-menu" aria-labelledby="communityDropdown">
<aclass="dropdown-item" href="support.html">Get Support</a>
<aclass="dropdown-item" href="developers.html">Developers/Contributors</a>
<aclass="dropdown-item" href="contrib.html">Submit a Contribution</a>
</div>
</li>
<liclass="nav-item dropdown">
<aclass="nav-link dropdown-toggle" href="#" id="aboutDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">About</a>
<divclass="dropdown-menu" aria-labelledby="aboutDropdown">
<aclass="dropdown-item" href="license.html">License</a>
<aclass="dropdown-item" href="citations.html">Citations</a>
<aclass="dropdown-item" href="acknowledgements.html">Acknowledgments</a>
</div>
</li>
<liclass="nav-item"><aclass="nav-link" href="https://ompl.kavrakilab.org/blog.html">Blog</a></li>
</ul>
<divid="MSearchBox" class="MSearchBoxInactive">
<spanclass="left">
<spanid="MSearchSelect" class="search-icon" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"><spanclass="search-icon-dropdown"></span></span>
<inputtype="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><spanclass="right">
<aid="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><divid="MSearchCloseImg" class="close-icon"></div></a>
</span>
</div>
</div>
</nav>
<divclass="container" role="main">
<div>
<!-- Generated by Doxygen 1.16.1 -->
<scripttype="text/javascript">
varsearchBox=newSearchBox("searchBox","search/",'.html');
</script>
<scripttype="text/javascript">
$(function(){codefold.init();});
</script>
<!-- window showing the filter options -->
<divid="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<divid="MSearchResultsWindow">
<divid="MSearchResults">
<divclass="SRPage">
<divid="SRIndex">
<divid="SRResults"></div>
<divclass="SRStatus" id="Loading">Loading...</div>
<divclass="SRStatus" id="Searching">Searching...</div>
<divclass="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<divid="nav-path" class="navpath">
<ul>
<liclass="navelem"><b>ompl</b></li><liclass="navelem"><b>base</b></li><liclass="navelem"><b>samplers</b></li><liclass="navelem"><b>src</b></li></ul>
</div>
</div><!-- top -->
<divid="doc-content">
<divclass="header">
<divclass="headertitle"><divclass="title">ConditionalStateSampler.cpp</div></div>
</div><!--header-->
<divclass="contents">
<divclass="fragment"><divclass="line"><aid="l00001" name="l00001"></a><spanclass="lineno"> 1</span><spanclass="comment">/*********************************************************************</span></div>
<divclass="line"><aid="l00002" name="l00002"></a><spanclass="lineno"> 2</span><spanclass="comment"> * Software License Agreement (BSD License)</span></div>
<divclass="line"><aid="l00003" name="l00003"></a><spanclass="lineno"> 3</span><spanclass="comment"> *</span></div>
<divclass="line"><aid="l00004" name="l00004"></a><spanclass="lineno"> 4</span><spanclass="comment"> * Copyright (c) 2021, Technische Universität Berlin (TU Berlin)</span></div>
<divclass="line"><aid="l00005" name="l00005"></a><spanclass="lineno"> 5</span><spanclass="comment"> * All rights reserved.</span></div>
<divclass="line"><aid="l00006" name="l00006"></a><spanclass="lineno"> 6</span><spanclass="comment"> *</span></div>
<divclass="line"><aid="l00007" name="l00007"></a><spanclass="lineno"> 7</span><spanclass="comment"> * Redistribution and use in source and binary forms, with or without</span></div>
<divclass="line"><aid="l00008" name="l00008"></a><spanclass="lineno"> 8</span><spanclass="comment"> * modification, are permitted provided that the following conditions</span></div>
<divclass="line"><aid="l00009" name="l00009"></a><spanclass="lineno"> 9</span><spanclass="comment"> * are met:</span></div>
<divclass="line"><aid="l00010" name="l00010"></a><spanclass="lineno"> 10</span><spanclass="comment"> *</span></div>
<divclass="line"><aid="l00011" name="l00011"></a><spanclass="lineno"> 11</span><spanclass="comment"> * * Redistributions of source code must retain the above copyright</span></div>
<divclass="line"><aid="l00012" name="l00012"></a><spanclass="lineno"> 12</span><spanclass="comment"> * notice, this list of conditions and the following disclaimer.</span></div>
<divclass="line"><aid="l00013" name="l00013"></a><spanclass="lineno"> 13</span><spanclass="comment"> * * Redistributions in binary form must reproduce the above</span></div>
<divclass="line"><aid="l00014" name="l00014"></a><spanclass="lineno"> 14</span><spanclass="comment"> * copyright notice, this list of conditions and the following</span></div>
<divclass="line"><aid="l00015" name="l00015"></a><spanclass="lineno"> 15</span><spanclass="comment"> * disclaimer in the documentation and/or other materials provided</span></div>
<divclass="line"><aid="l00016" name="l00016"></a><spanclass="lineno"> 16</span><spanclass="comment"> * with the distribution.</span></div>
<divclass="line"><aid="l00017" name="l00017"></a><spanclass="lineno"> 17</span><spanclass="comment"> * * Neither the name of the TU Berlin nor the names of its</span></div>
<divclass="line"><aid="l00018" name="l00018"></a><spanclass="lineno"> 18</span><spanclass="comment"> * contributors may be used to endorse or promote products derived</span></div>
<divclass="line"><aid="l00019" name="l00019"></a><spanclass="lineno"> 19</span><spanclass="comment"> * from this software without specific prior written permission.</span></div>
<divclass="line"><aid="l00020" name="l00020"></a><spanclass="lineno"> 20</span><spanclass="comment"> *</span></div>
<divclass="line"><aid="l00021" name="l00021"></a><spanclass="lineno"> 21</span><spanclass="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span></div>
<divclass="line"><aid="l00022" name="l00022"></a><spanclass="lineno"> 22</span><spanclass="comment"> * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span></div>
<divclass="line"><aid="l00023" name="l00023"></a><spanclass="lineno"> 23</span><spanclass="comment"> * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS</span></div>
<divclass="line"><aid="l00024" name="l00024"></a><spanclass="lineno"> 24</span><spanclass="comment"> * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE</span></div>
<divclass="line"><aid="l00025" name="l00025"></a><spanclass="lineno"> 25</span><spanclass="comment"> * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,</span></div>
<divclass="line"><aid="l00026" name="l00026"></a><spanclass="lineno"> 26</span><spanclass="comment"> * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,</span></div>
<divclass="line"><aid="l00027" name="l00027"></a><spanclass="lineno"> 27</span><spanclass="comment"> * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span></div>
<divclass="line"><aid="l00028" name="l00028"></a><spanclass="lineno"> 28</span><spanclass="comment"> * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span></div>
<divclass="line"><aid="l00029" name="l00029"></a><spanclass="lineno"> 29</span><spanclass="comment"> * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span></div>
<divclass="line"><aid="l00030" name="l00030"></a><spanclass="lineno"> 30</span><spanclass="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN</span></div>
<divclass="line"><aid="l00031" name="l00031"></a><spanclass="lineno"> 31</span><spanclass="comment"> * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
<divclass="line"><aid="l00032" name="l00032"></a><spanclass="lineno"> 32</span><spanclass="comment"> * POSSIBILITY OF SUCH DAMAGE.</span></div>
<divclass="line"><aid="l00033" name="l00033"></a><spanclass="lineno"> 33</span><spanclass="comment"> *********************************************************************/</span></div>
<divclass="line"><aid="l00034" name="l00034"></a><spanclass="lineno"> 34</span></div>
<divclass="line"><aid="l00035" name="l00035"></a><spanclass="lineno"> 35</span><spanclass="comment">/* Author: Francesco Grothe */</span></div>
<divclass="line"><aid="l00036" name="l00036"></a><spanclass="lineno"> 36</span></div>
<divclass="line"><aid="l00037" name="l00037"></a><spanclass="lineno"> 37</span><spanclass="preprocessor">#include "ompl/base/samplers/ConditionalStateSampler.h"</span></div>
<divclass="line"><aid="l00038" name="l00038"></a><spanclass="lineno"> 38</span></div>
<divclass="foldopen" id="foldopen00039" data-start="{" data-end="}">
<divclass="line"><aid="l00039" name="l00039"></a><spanclass="lineno"><aclass="line" href="classompl_1_1base_1_1ConditionalStateSampler.html#a74d8ea75c3b60e5a62d58d6365bbf084"> 39</a></span><aclass="code hl_function" href="classompl_1_1base_1_1ConditionalStateSampler.html#a74d8ea75c3b60e5a62d58d6365bbf084">ompl::base::ConditionalStateSampler::ConditionalStateSampler</a>(<spanclass="keyword">const</span><aclass="code hl_class" href="classompl_1_1base_1_1SpaceInformation.html">ompl::base::SpaceInformation</a> *si,</div>
<divclass="line"><aid="l00040" name="l00040"></a><spanclass="lineno"> 40</span><aclass="code hl_class" href="classompl_1_1base_1_1ConditionalStateSampler_1_1Motion.html">Motion</a> *&startMotion, std::vector<Motion *> &goalMotions,</div>
<divclass="line"><aid="l00041" name="l00041"></a><spanclass="lineno"> 41</span> std::vector<Motion *> &newBatchGoalMotions,</div>
<divclass="line"><aid="l00042" name="l00042"></a><spanclass="lineno"> 42</span><spanclass="keywordtype">bool</span> &sampleOldBatch)</div>
<divclass="line"><aid="l00043" name="l00043"></a><spanclass="lineno"> 43</span> : ValidStateSampler(si)</div>
<divclass="line"><aid="l00044" name="l00044"></a><spanclass="lineno"> 44</span> , startMotion_(startMotion)</div>
<divclass="line"><aid="l00045" name="l00045"></a><spanclass="lineno"> 45</span> , goalMotions_(goalMotions)</div>
<divclass="line"><aid="l00046" name="l00046"></a><spanclass="lineno"> 46</span> , newBatchGoalMotions_(newBatchGoalMotions)</div>
<divclass="line"><aid="l00047" name="l00047"></a><spanclass="lineno"> 47</span> , sampleOldBatch_(sampleOldBatch)</div>
<divclass="line"><aid="l00048" name="l00048"></a><spanclass="lineno"> 48</span>{</div>
<divclass="line"><aid="l00049" name="l00049"></a><spanclass="lineno"> 49</span><aclass="code hl_variable" href="classompl_1_1base_1_1ValidStateSampler.html#aa81e8e1aac6d0c7a114aaa69b33a6631">name_</a> = <spanclass="stringliteral">"ConditionalSampler"</span>;</div>
<divclass="line"><aid="l00050" name="l00050"></a><spanclass="lineno"> 50</span>}</div>
</div>
<divclass="line"><aid="l00051" name="l00051"></a><spanclass="lineno"> 51</span></div>
<divclass="foldopen" id="foldopen00052" data-start="{" data-end="}">
<divclass="line"><aid="l00052" name="l00052"></a><spanclass="lineno"><aclass="line" href="classompl_1_1base_1_1ConditionalStateSampler.html#a46d93a8ad934f84777f36842713f3440"> 52</a></span><spanclass="keywordtype">bool</span><aclass="code hl_function" href="classompl_1_1base_1_1ConditionalStateSampler.html#a46d93a8ad934f84777f36842713f3440">ompl::base::ConditionalStateSampler::sample</a>(<aclass="code hl_class" href="classompl_1_1base_1_1State.html">ompl::base::State</a> *state)</div>
<divclass="line"><aid="l00053" name="l00053"></a><spanclass="lineno"> 53</span>{</div>
<divclass="line"><aid="l00054" name="l00054"></a><spanclass="lineno"> 54</span><spanclass="keywordflow">for</span> (<spanclass="keywordtype">int</span> i = 0; i < maxTries_; ++i)</div>
<divclass="line"><aid="l00055" name="l00055"></a><spanclass="lineno"> 55</span> {</div>
<divclass="line"><aid="l00056" name="l00056"></a><spanclass="lineno"> 56</span> internalSampler_->sampleUniform(state);</div>
<divclass="line"><aid="l00057" name="l00057"></a><spanclass="lineno"> 57</span><spanclass="keywordtype">double</span> leftBound, rightBound;</div>
<divclass="line"><aid="l00058" name="l00058"></a><spanclass="lineno"> 58</span><spanclass="comment">// get minimum time, when the state can be reached from the start</span></div>
<divclass="line"><aid="l00059" name="l00059"></a><spanclass="lineno"> 59</span><spanclass="keywordtype">double</span> startBound =</div>
<divclass="line"><aid="l00060" name="l00060"></a><spanclass="lineno"> 60</span> startMotion_->state->as<<aclass="code hl_class" href="classompl_1_1base_1_1CompoundState.html">base::CompoundState</a>>()->as<base::TimeStateSpace::StateType>(1)->position +</div>
<divclass="line"><aid="l00061" name="l00061"></a><spanclass="lineno"> 61</span><aclass="code hl_variable" href="classompl_1_1base_1_1ValidStateSampler.html#a66930cdb64d8d71e3b6ba5a5a1aee223">si_</a>->getStateSpace()->as<<aclass="code hl_class" href="classompl_1_1base_1_1SpaceTimeStateSpace.html">base::SpaceTimeStateSpace</a>>()->timeToCoverDistance(state, startMotion_->state);</div>
<divclass="line"><aid="l00062" name="l00062"></a><spanclass="lineno"> 62</span><spanclass="comment">// sample old batch</span></div>
<divclass="line"><aid="l00063" name="l00063"></a><spanclass="lineno"> 63</span><spanclass="keywordflow">if</span> (sampleOldBatch_)</div>
<divclass="line"><aid="l00064" name="l00064"></a><spanclass="lineno"> 64</span> {</div>
<divclass="line"><aid="l00065" name="l00065"></a><spanclass="lineno"> 65</span> leftBound = startBound;</div>
<divclass="line"><aid="l00066" name="l00066"></a><spanclass="lineno"> 66</span><spanclass="comment">// get maximum time, at which any goal can be reached from the state</span></div>
<divclass="line"><aid="l00067" name="l00067"></a><spanclass="lineno"> 67</span> rightBound = std::numeric_limits<double>::min();</div>
<divclass="line"><aid="l00068" name="l00068"></a><spanclass="lineno"> 68</span><spanclass="keywordflow">for</span> (<spanclass="keyword">auto</span> goal : goalMotions_)</div>
<divclass="line"><aid="l00069" name="l00069"></a><spanclass="lineno"> 69</span> {</div>
<divclass="line"><aid="l00070" name="l00070"></a><spanclass="lineno"> 70</span><spanclass="keywordtype">double</span> t =</div>
<divclass="line"><aid="l00071" name="l00071"></a><spanclass="lineno"> 71</span> goal->state->as<<aclass="code hl_class" href="classompl_1_1base_1_1CompoundState.html">base::CompoundState</a>>()->as<base::TimeStateSpace::StateType>(1)->position -</div>
<divclass="line"><aid="l00072" name="l00072"></a><spanclass="lineno"> 72</span><aclass="code hl_variable" href="classompl_1_1base_1_1ValidStateSampler.html#a66930cdb64d8d71e3b6ba5a5a1aee223">si_</a>->getStateSpace()->as<<aclass="code hl_class" href="classompl_1_1base_1_1SpaceTimeStateSpace.html">base::SpaceTimeStateSpace</a>>()->timeToCoverDistance(goal->state, state);</div>
<divclass="line"><aid="l00073" name="l00073"></a><spanclass="lineno"> 73</span><spanclass="keywordflow">if</span> (t > rightBound)</div>
<divclass="line"><aid="l00074" name="l00074"></a><spanclass="lineno"> 74</span> {</div>
<divclass="line"><aid="l00075" name="l00075"></a><spanclass="lineno"> 75</span> rightBound = t;</div>
<divclass="line"><aid="l00076" name="l00076"></a><spanclass="lineno"> 76</span> }</div>
<divclass="line"><aid="l00077" name="l00077"></a><spanclass="lineno"> 77</span> }</div>
<divclass="line"><aid="l00078" name="l00078"></a><spanclass="lineno"> 78</span> }</div>
<divclass="line"><aid="l00079" name="l00079"></a><spanclass="lineno"> 79</span><spanclass="comment">// sample new batch</span></div>
<divclass="line"><aid="l00080" name="l00080"></a><spanclass="lineno"> 80</span><spanclass="keywordflow">else</span></div>
<divclass="line"><aid="l00081" name="l00081"></a><spanclass="lineno"> 81</span> {</div>
<divclass="line"><aid="l00082" name="l00082"></a><spanclass="lineno"> 82</span><spanclass="comment">// get maximum time, at which any goal from the new batch can be reached from the state</span></div>
<divclass="line"><aid="l00083" name="l00083"></a><spanclass="lineno"> 83</span> rightBound = std::numeric_limits<double>::min();</div>
<divclass="line"><aid="l00084" name="l00084"></a><spanclass="lineno"> 84</span><spanclass="keywordflow">for</span> (<spanclass="keyword">auto</span> goal : newBatchGoalMotions_)</div>
<divclass="line"><aid="l00085" name="l00085"></a><spanclass="lineno"> 85</span> {</div>
<divclass="line"><aid="l00086" name="l00086"></a><spanclass="lineno"> 86</span><spanclass="keywordtype">double</span> t =</div>
<divclass="line"><aid="l00087" name="l00087"></a><spanclass="lineno"> 87</span> goal->state->as<<aclass="code hl_class" href="classompl_1_1base_1_1CompoundState.html">base::CompoundState</a>>()->as<base::TimeStateSpace::StateType>(1)->position -</div>
<divclass="line"><aid="l00088" name="l00088"></a><spanclass="lineno"> 88</span><aclass="code hl_variable" href="classompl_1_1base_1_1ValidStateSampler.html#a66930cdb64d8d71e3b6ba5a5a1aee223">si_</a>->getStateSpace()->as<<aclass="code hl_class" href="classompl_1_1base_1_1SpaceTimeStateSpace.html">base::SpaceTimeStateSpace</a>>()->timeToCoverDistance(goal->state, state);</div>
<divclass="line"><aid="l00089" name="l00089"></a><spanclass="lineno"> 89</span><spanclass="keywordflow">if</span> (t > rightBound)</div>
<divclass="line"><aid="l00090" name="l00090"></a><spanclass="lineno"> 90</span> {</div>
<divclass="line"><aid="l00091" name="l00091"></a><spanclass="lineno"> 91</span> rightBound = t;</div>
<divclass="line"><aid="l00092" name="l00092"></a><spanclass="lineno"> 92</span> }</div>
<divclass="line"><aid="l00093" name="l00093"></a><spanclass="lineno"> 93</span> }</div>
<divclass="line"><aid="l00094" name="l00094"></a><spanclass="lineno"> 94</span><spanclass="comment">// get maximum time, at which any goal from the old batch can be reached from the state</span></div>
<divclass="line"><aid="l00095" name="l00095"></a><spanclass="lineno"> 95</span><spanclass="comment">// only allow the left bound to be smaller than the right bound</span></div>
<divclass="line"><aid="l00096" name="l00096"></a><spanclass="lineno"> 96</span> leftBound = std::numeric_limits<double>::min();</div>
<divclass="line"><aid="l00097" name="l00097"></a><spanclass="lineno"> 97</span><spanclass="keywordflow">for</span> (<spanclass="keyword">auto</span> goal : goalMotions_)</div>
<divclass="line"><aid="l00098" name="l00098"></a><spanclass="lineno"> 98</span> {</div>
<divclass="line"><aid="l00099" name="l00099"></a><spanclass="lineno"> 99</span><spanclass="keywordtype">double</span> t =</div>
<divclass="line"><aid="l00100" name="l00100"></a><spanclass="lineno"> 100</span> goal->state->as<<aclass="code hl_class" href="classompl_1_1base_1_1CompoundState.html">base::CompoundState</a>>()->as<base::TimeStateSpace::StateType>(1)->position -</div>
<divclass="line"><aid="l00101" name="l00101"></a><spanclass="lineno"> 101</span><aclass="code hl_variable" href="classompl_1_1base_1_1ValidStateSampler.html#a66930cdb64d8d71e3b6ba5a5a1aee223">si_</a>->getStateSpace()->as<<aclass="code hl_class" href="classompl_1_1base_1_1SpaceTimeStateSpace.html">base::SpaceTimeStateSpace</a>>()->timeToCoverDistance(goal->state, state);</div>
<divclass="line"><aid="l00102" name="l00102"></a><spanclass="lineno"> 102</span><spanclass="keywordflow">if</span> (t > leftBound && t < rightBound)</div>
<divclass="line"><aid="l00103" name="l00103"></a><spanclass="lineno"> 103</span> {</div>
<divclass="line"><aid="l00104" name="l00104"></a><spanclass="lineno"> 104</span> leftBound = t;</div>
<divclass="line"><aid="l00105" name="l00105"></a><spanclass="lineno"> 105</span> }</div>
<divclass="line"><aid="l00106" name="l00106"></a><spanclass="lineno"> 106</span> }</div>
<divclass="line"><aid="l00107" name="l00107"></a><spanclass="lineno"> 107</span> leftBound = std::max(leftBound, startBound);</div>
<divclass="line"><aid="l00108" name="l00108"></a><spanclass="lineno"> 108</span> }</div>
<divclass="line"><aid="l00109" name="l00109"></a><spanclass="lineno"> 109</span></div>
<divclass="line"><aid="l00110" name="l00110"></a><spanclass="lineno"> 110</span><spanclass="keywordflow">if</span> (leftBound <= rightBound)</div>
<divclass="line"><aid="l00111" name="l00111"></a><spanclass="lineno"> 111</span> {</div>
<divclass="line"><aid="l00112" name="l00112"></a><spanclass="lineno"> 112</span><spanclass="keywordtype">double</span><aclass="code hl_namespace" href="namespaceompl_1_1time.html">time</a> = rng_.uniformReal(leftBound, rightBound);</div>
<divclass="line"><aid="l00113" name="l00113"></a><spanclass="lineno"> 113</span> state-><aclass="code hl_function" href="classompl_1_1base_1_1State.html#af1b51b919c418c1625ed42a3c36f2be2">as</a><<aclass="code hl_class" href="classompl_1_1base_1_1CompoundState.html">base::CompoundState</a>>()->as<base::TimeStateSpace::StateType>(1)->position = <aclass="code hl_namespace" href="namespaceompl_1_1time.html">time</a>;</div>
<divclass="line"><aid="l00114" name="l00114"></a><spanclass="lineno"> 114</span><spanclass="keywordflow">return</span><spanclass="keyword">true</span>;</div>
<divclass="line"><aid="l00115" name="l00115"></a><spanclass="lineno"> 115</span> }</div>
<divclass="line"><aid="l00116" name="l00116"></a><spanclass="lineno"> 116</span> }</div>
<divclass="line"><aid="l00117" name="l00117"></a><spanclass="lineno"> 117</span><spanclass="keywordflow">return</span><spanclass="keyword">false</span>;</div>
<divclass="line"><aid="l00118" name="l00118"></a><spanclass="lineno"> 118</span>}</div>
</div>
<divclass="line"><aid="l00119" name="l00119"></a><spanclass="lineno"> 119</span></div>
<divclass="foldopen" id="foldopen00120" data-start="{" data-end="}">
<divclass="line"><aid="l00120" name="l00120"></a><spanclass="lineno"><aclass="line" href="classompl_1_1base_1_1ConditionalStateSampler.html#a0a2118e98f1d404d09de9622768fbb22"> 120</a></span><spanclass="keywordtype">bool</span><aclass="code hl_function" href="classompl_1_1base_1_1ConditionalStateSampler.html#a0a2118e98f1d404d09de9622768fbb22">ompl::base::ConditionalStateSampler::sampleNear</a>(<aclass="code hl_class" href="classompl_1_1base_1_1State.html">ompl::base::State</a> *, <spanclass="keyword">const</span><aclass="code hl_class" href="classompl_1_1base_1_1State.html">ompl::base::State</a> *, <spanclass="keywordtype">double</span>)</div>
<divclass="line"><aid="l00121" name="l00121"></a><spanclass="lineno"> 121</span>{</div>
<divclass="line"><aid="l00122" name="l00122"></a><spanclass="lineno"> 122</span><spanclass="keywordflow">throw</span><aclass="code hl_class" href="classompl_1_1Exception.html">ompl::Exception</a>(<spanclass="stringliteral">"ConditionalSampler::sampleNear"</span>, <spanclass="stringliteral">"not implemented"</span>);</div>
<divclass="line"><aid="l00123" name="l00123"></a><spanclass="lineno"> 123</span>}</div>
</div>
<divclass="ttc" id="aclassompl_1_1Exception_html"><divclass="ttname"><ahref="classompl_1_1Exception.html">ompl::Exception</a></div><divclass="ttdoc">The exception type for ompl.</div><divclass="ttdef"><b>Definition</b><ahref="Exception_8h_source.html#l00046">Exception.h:47</a></div></div>
<divclass="ttc" id="aclassompl_1_1base_1_1CompoundState_html"><divclass="ttname"><ahref="classompl_1_1base_1_1CompoundState.html">ompl::base::CompoundState</a></div><divclass="ttdoc">Definition of a compound state.</div><divclass="ttdef"><b>Definition</b><ahref="base_2State_8h_source.html#l00086">State.h:87</a></div></div>
<divclass="ttc" id="aclassompl_1_1base_1_1ConditionalStateSampler_1_1Motion_html"><divclass="ttname"><ahref="classompl_1_1base_1_1ConditionalStateSampler_1_1Motion.html">ompl::base::ConditionalStateSampler::Motion</a></div><divclass="ttdoc">Representation of a motion.</div><divclass="ttdef"><b>Definition</b><ahref="ConditionalStateSampler_8h_source.html#l00057">ConditionalStateSampler.h:58</a></div></div>
<divclass="ttc" id="aclassompl_1_1base_1_1ConditionalStateSampler_html_a0a2118e98f1d404d09de9622768fbb22"><divclass="ttname"><ahref="classompl_1_1base_1_1ConditionalStateSampler.html#a0a2118e98f1d404d09de9622768fbb22">ompl::base::ConditionalStateSampler::sampleNear</a></div><divclass="ttdeci">bool sampleNear(State *state, const State *near, double distance) override</div><divclass="ttdoc">Sample a state near another, within specified distance. Return false, in case of failure.</div><divclass="ttdef"><b>Definition</b><ahref="#l00120">ConditionalStateSampler.cpp:120</a></div></div>
<divclass="ttc" id="aclassompl_1_1base_1_1ConditionalStateSampler_html_a46d93a8ad934f84777f36842713f3440"><divclass="ttname"><ahref="classompl_1_1base_1_1ConditionalStateSampler.html#a46d93a8ad934f84777f36842713f3440">ompl::base::ConditionalStateSampler::sample</a></div><divclass="ttdeci">bool sample(State *state) override</div><divclass="ttdoc">Sample a state. Return false in case of failure.</div><divclass="ttdef"><b>Definition</b><ahref="#l00052">ConditionalStateSampler.cpp:52</a></div></div>
<divclass="ttc" id="aclassompl_1_1base_1_1ConditionalStateSampler_html_a74d8ea75c3b60e5a62d58d6365bbf084"><divclass="ttname"><ahref="classompl_1_1base_1_1ConditionalStateSampler.html#a74d8ea75c3b60e5a62d58d6365bbf084">ompl::base::ConditionalStateSampler::ConditionalStateSampler</a></div><divclass="ttdeci">ConditionalStateSampler(const SpaceInformation *si, Motion *&startMotion, std::vector< Motion * > &goalMotions, std::vector< Motion * > &newBatchGoalMotions, bool &sampleOldBatch)</div><divclass="ttdoc">The constructor.</div><divclass="ttdef"><b>Definition</b><ahref="#l00039">ConditionalStateSampler.cpp:39</a></div></div>
<divclass="ttc" id="aclassompl_1_1base_1_1SpaceInformation_html"><divclass="ttname"><ahref="classompl_1_1base_1_1SpaceInformation.html">ompl::base::SpaceInformation</a></div><divclass="ttdoc">The base class for space information. This contains all the information about the space planning is d...</div><divclass="ttdef"><b>Definition</b><ahref="base_2SpaceInformation_8h_source.html#l00081">SpaceInformation.h:82</a></div></div>
<divclass="ttc" id="aclassompl_1_1base_1_1SpaceTimeStateSpace_html"><divclass="ttname"><ahref="classompl_1_1base_1_1SpaceTimeStateSpace.html">ompl::base::SpaceTimeStateSpace</a></div><divclass="ttdoc">A state space consisting of a space and a time component.</div><divclass="ttdef"><b>Definition</b><ahref="SpaceTimeStateSpace_8h_source.html#l00050">SpaceTimeStateSpace.h:51</a></div></div>
<divclass="ttc" id="aclassompl_1_1base_1_1State_html"><divclass="ttname"><ahref="classompl_1_1base_1_1State.html">ompl::base::State</a></div><divclass="ttdoc">Definition of an abstract state.</div><divclass="ttdef"><b>Definition</b><ahref="base_2State_8h_source.html#l00049">State.h:50</a></div></div>
<divclass="ttc" id="aclassompl_1_1base_1_1State_html_af1b51b919c418c1625ed42a3c36f2be2"><divclass="ttname"><ahref="classompl_1_1base_1_1State.html#af1b51b919c418c1625ed42a3c36f2be2">ompl::base::State::as</a></div><divclass="ttdeci">const T * as() const</div><divclass="ttdoc">Cast this instance to a desired type.</div><divclass="ttdef"><b>Definition</b><ahref="base_2State_8h_source.html#l00066">State.h:66</a></div></div>
<divclass="ttc" id="aclassompl_1_1base_1_1ValidStateSampler_html_a66930cdb64d8d71e3b6ba5a5a1aee223"><divclass="ttname"><ahref="classompl_1_1base_1_1ValidStateSampler.html#a66930cdb64d8d71e3b6ba5a5a1aee223">ompl::base::ValidStateSampler::si_</a></div><divclass="ttdeci">const SpaceInformation * si_</div><divclass="ttdoc">The state space this sampler samples.</div><divclass="ttdef"><b>Definition</b><ahref="ValidStateSampler_8h_source.html#l00121">ValidStateSampler.h:121</a></div></div>
<divclass="ttc" id="aclassompl_1_1base_1_1ValidStateSampler_html_aa81e8e1aac6d0c7a114aaa69b33a6631"><divclass="ttname"><ahref="classompl_1_1base_1_1ValidStateSampler.html#aa81e8e1aac6d0c7a114aaa69b33a6631">ompl::base::ValidStateSampler::name_</a></div><divclass="ttdeci">std::string name_</div><divclass="ttdoc">The name of the sampler.</div><divclass="ttdef"><b>Definition</b><ahref="ValidStateSampler_8h_source.html#l00127">ValidStateSampler.h:127</a></div></div>
<divclass="ttc" id="anamespaceompl_1_1time_html"><divclass="ttname"><ahref="namespaceompl_1_1time.html">ompl::time</a></div><divclass="ttdoc">Namespace containing time datatypes and time operations.</div><divclass="ttdef"><b>Definition</b><ahref="Time_8h_source.html#l00049">Time.h:50</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div>
<footerclass="footer">
<divclass="container">
<ahref="http://www.kavrakilab.org">Kavraki Lab</a> •
<ahref="https://www.cs.rice.edu">Department of Computer Science</a> •
<ahref="https://www.rice.edu">Rice University</a><br/>
Funded in part by the <ahref="https://www.nsf.gov">National Science Foundation</a><br/>
Documentation generated by <ahref="http://www.doxygen.org/index.html">doxygen</a> 1.16.1
</div>
</footer>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*newDate();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create','UA-9156598-2','auto');
ga('send','pageview');
</script>
<scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<scriptsrc="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>