Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 1099e73f16f15ba3cf656e619f52a447 > files > 1905

ompl-devel-0.9.5-1.fc14.x86_64.rpm

<!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: Working with States and State Spaces</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</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>
<div class="header">
  <div class="headertitle">
<div class="title">Working with States and State Spaces </div>  </div>
</div>
<div class="contents">
<div class="textblock"><h2><a class="anchor" id="stateAlloc"></a>
Allocating memory for states</h2>
<ul>
<li>The simple version:<br/>
 <div class="fragment"><pre class="fragment"><a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> space(<span class="keyword">new</span> T());
<a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;&gt;</a> state(space);
</pre></div> or <div class="fragment"><pre class="fragment"><a class="code" href="classompl_1_1base_1_1SpaceInformationPtr.html" title="A boost shared pointer wrapper for ompl::base::SpaceInformation.">ompl::base::SpaceInformationPtr</a> si(space);
<a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;T&gt;</a> state(si);
</pre></div> The <a class="el" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState</a> class will do the necessary memory operations to allocate a state from the correct state space. This is the recommended way of allocating states for code other than ompl internals. Convenience operators such as = and == are provided. If a type T is provided, where T is a state space type, the maintained state is cast as T::StateType. operator= will use <a class="el" href="classompl_1_1base_1_1StateSpace.html#abff3478c3fc4da03c94d6f929f6ca7f9" title="Copy a state to another. The memory of source and destination should NOT overlap.">ompl::base::StateSpace::copyState()</a> and operator== will use <a class="el" href="classompl_1_1base_1_1StateSpace.html#a6babf3addb5ed9608800b7460a20da39" title="Checks whether two states are equal.">ompl::base::StateSpace::equalStates()</a>.</li>
</ul>
<ul>
<li>The expert version:<br/>
 <div class="fragment"><pre class="fragment"><a class="code" href="classompl_1_1base_1_1SpaceInformationPtr.html" title="A boost shared pointer wrapper for ompl::base::SpaceInformation.">ompl::base::SpaceInformationPtr</a> si(space);
<a class="code" href="classompl_1_1base_1_1State.html" title="Definition of an abstract state.">ompl::base::State</a>* state = si-&gt;<a class="code" href="classompl_1_1base_1_1SpaceInformation.html#a9e758a30cc13bd00c6cee667c9232e88" title="Allocate memory for a state.">allocState</a>();
...
si-&gt;freeState(state);
</pre></div> The structure of a state depends on the state space specification. The <a class="el" href="classompl_1_1base_1_1State.html" title="Definition of an abstract state.">ompl::base::State</a> type is just an abstract base for the states of other state spaces. For this reason, states cannot be allocated directly, but through the allocation mechanism of the state space: <a class="el" href="classompl_1_1base_1_1StateSpace.html#a65ed00dd1909446bb79542c3670d6efd" title="Allocate a state that can store a point in the described space.">ompl::base::StateSpace::allocState()</a>. States are to be freed using <a class="el" href="classompl_1_1base_1_1StateSpace.html#aeb75db7a7ef3d05f13632b7ccc67e6b9" title="Free the memory of the allocated state.">ompl::base::StateSpace::freeState()</a>. For convenience, <a class="el" href="classompl_1_1base_1_1SpaceInformation.html#a9e758a30cc13bd00c6cee667c9232e88" title="Allocate memory for a state.">ompl::base::SpaceInformation::allocState()</a> and <a class="el" href="classompl_1_1base_1_1SpaceInformation.html#a78dff42e6a76b87a9a4d19680fb82e31" title="Free the memory of a state.">ompl::base::SpaceInformation::freeState()</a> are defined as well. Using the calls from the <a class="el" href="classompl_1_1base_1_1SpaceInformation.html" title="The base class for space information. This contains all the information about the space planning is d...">ompl::base::SpaceInformation</a> class is better since they certainly use the same state space as the one used for planning. This is the lowest level of operating on states and only recommended for expert users.</li>
</ul>
<p>See <a class="el" href="workingWithStates.html#stateOps">Operating with states</a> for how to fill the contents of the allocated states.</p>
<h2><a class="anchor" id="stateOps"></a>
Operating with states</h2>
<p>In order for states to be useful in setting start (or goal) positions, accessing their content is needed. It is assumed the reader is familiar with <a class="el" href="workingWithStates.html#stateAlloc">Allocating memory for states</a>. Furthermore, <a class="el" href="group__stateAndSpaceOperators.html">operators on states and state spaces</a> are also used.</p>
<ul>
<li>Simple version:<br/>
 The recommended use of states is with <a class="el" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState</a>. Given the instance of a state space, this class will allocate a state from that space. The internally maintained state is freed when the instance of <a class="el" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState</a> goes out of scope. <a class="el" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState</a> is a templated class and it inherits from T::StateType, where T is a state space type. This allows it to cast the state it maintains to the desired type and thus exhibit the functionality (the same members) as T::StateType. If no template argument is specified, the internal state is kept as <a class="el" href="classompl_1_1base_1_1State.html" title="Definition of an abstract state.">ompl::base::State</a>*. <div class="fragment"><pre class="fragment"><a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> space(<span class="keyword">new</span> <a class="code" href="classompl_1_1base_1_1SE2StateSpace.html" title="A state space representing SE(2)">ompl::base::SE2StateSpace</a>());
<a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;ompl::base::SE2StateSpace&gt;</a> state(space);
state-&gt;setX(0.1);
state-&gt;setY(0.2);
state-&gt;setYaw(0.0);

<a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;&gt;</a> backup = state;
<span class="comment">// backup maintains its internal state as State*, so setX() is not available.</span>
<span class="comment">// the content of backup is copied from state</span>

<a class="code" href="classompl_1_1base_1_1State.html" title="Definition of an abstract state.">ompl::base::State</a> *abstractState = space-&gt;allocState();


<span class="comment">// this will copy the content of abstractState to state and</span>
<span class="comment">// cast it internall as  ompl::base::SE2StateSpace::StateType</span>
state = abstractState;

<span class="comment">// restore state to it&#39;s original value</span>
state = backup;

<span class="keywordflow">if</span> (state != backup)
   <span class="keywordflow">throw</span> <a class="code" href="classompl_1_1Exception.html" title="The exception type for ompl.">ompl::Exception</a>(<span class="stringliteral">&quot;This should never happen&quot;</span>);
</pre></div> Combining <a class="el" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState</a> with <a class="el" href="classompl_1_1base_1_1CompoundStateSpace.html" title="A space to allow the composition of state spaces.">ompl::base::CompoundStateSpace</a>: <div class="fragment"><pre class="fragment"><a class="code" href="classompl_1_1base_1_1CompoundStateSpace.html" title="A space to allow the composition of state spaces.">ompl::base::CompoundStateSpace</a> *cs = <span class="keyword">new</span> <a class="code" href="classompl_1_1base_1_1CompoundStateSpace.html" title="A space to allow the composition of state spaces.">ompl::base::CompoundStateSpace</a>();
cs-&gt;<a class="code" href="classompl_1_1base_1_1CompoundStateSpace.html#aba4aafa2e39b134bf55c5a2ba17d29af" title="Adds a new state space as part of the compound state space. For computing distances within the compou...">addSubSpace</a>(<a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a>(<span class="keyword">new</span> <a class="code" href="classompl_1_1base_1_1SO2StateSpace.html" title="A state space representing SO(2). The distance function and interpolation take into account angle wra...">ompl::base::SO2StateSpace</a>()), 1.0);
cs-&gt;<a class="code" href="classompl_1_1base_1_1CompoundStateSpace.html#aba4aafa2e39b134bf55c5a2ba17d29af" title="Adds a new state space as part of the compound state space. For computing distances within the compou...">addSubSpace</a>(<a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a>(<span class="keyword">new</span> <a class="code" href="classompl_1_1base_1_1SO3StateSpace.html" title="A state space representing SO(3). The internal representation is done with quaternions. The distance between states is the angle between quaternions and interpolation is done with slerp.">ompl::base::SO3StateSpace</a>()), 1.0);

<span class="comment">// put the pointer to the state space in a shared pointer</span>
<a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> space(cs);

<span class="comment">// the ompl::base::ScopedState helps only with one cast here, since we still need to</span>
<span class="comment">// manually cast the components of the state to what we want them to be.</span>
<a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;ompl::base::CompoundStateSpace&gt;</a> state(space);
state-&gt;<a class="code" href="classompl_1_1base_1_1State.html#ae4ed5c095a6b2d4a5c946b91bc65e9cb" title="Cast this instance to a desired type.">as</a>&lt;<a class="code" href="classompl_1_1base_1_1SO2StateSpace_1_1StateType.html" title="The definition of a state in SO(2)">ompl::base::SO2StateSpace::StateType</a>&gt;(0)-&gt;setIdentity();
</pre></div> The code above can be equivalently written as: <div class="fragment"><pre class="fragment"><span class="comment">// define the individual state spaces</span>
<a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> so2(<span class="keyword">new</span> <a class="code" href="classompl_1_1base_1_1SO2StateSpace.html" title="A state space representing SO(2). The distance function and interpolation take into account angle wra...">ompl::base::SO2StateSpace</a>());
<a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> so3(<span class="keyword">new</span> <a class="code" href="classompl_1_1base_1_1SO3StateSpace.html" title="A state space representing SO(3). The internal representation is done with quaternions. The distance between states is the angle between quaternions and interpolation is done with slerp.">ompl::base::SO3StateSpace</a>());

<span class="comment">// construct a compound state space using the overloaded operator+</span>
<a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> space = so2 + so3;

<span class="comment">// the ompl::base::ScopedState helps only with one cast here, since we still need to</span>
<span class="comment">// manually cast the components of the state to what we want them to be.</span>
<a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;ompl::base::CompoundStateSpace&gt;</a> state(space);
state-&gt;<a class="code" href="classompl_1_1base_1_1State.html#ae4ed5c095a6b2d4a5c946b91bc65e9cb" title="Cast this instance to a desired type.">as</a>&lt;<a class="code" href="classompl_1_1base_1_1SO2StateSpace_1_1StateType.html" title="The definition of a state in SO(2)">ompl::base::SO2StateSpace::StateType</a>&gt;(0)-&gt;setIdentity();
</pre></div> States can also be printed to streams: <div class="fragment"><pre class="fragment"><a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;&gt;</a> state(space);
std::cout &lt;&lt; state;
</pre></div> Sometimes it may be useful to extract parts of a state, or assign only to some parts of a state, especially when using compound state spaces: <div class="fragment"><pre class="fragment"><span class="comment">// an SE2 state space is in fact a compound state space consisting of R^2 and SO2</span>
<a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> space(<span class="keyword">new</span> <a class="code" href="classompl_1_1base_1_1SE2StateSpace.html" title="A state space representing SE(2)">ompl::base::SE2StateSpace</a>());
<span class="comment">// define a full state for this state space</span>
<a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;ompl::base::SE2StateSpace&gt;</a> fullState(space);
<span class="comment">// set the state to a random value</span>
fullState.random();

<span class="comment">// construct a state that corresponds to the position component of SE2</span>
<a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;&gt;</a> pos(space-&gt;as&lt;<a class="code" href="classompl_1_1base_1_1SE2StateSpace.html" title="A state space representing SE(2)">ompl::base::SE2StateSpace</a>&gt;()-&gt;<a class="code" href="classompl_1_1base_1_1CompoundStateSpace.html#a6b39c8d168cc33fde93263e20544f258" title="Get a specific subspace from the compound state space.">getSubSpace</a>(0));

<span class="comment">// copy the position</span>
pos &lt;&lt; fullState;

<span class="comment">// equivalently, this can be done too:</span>
fullState &gt;&gt; pos;

<span class="comment">// if we now modify pos somehow, we can set it back in the full state:</span>
pos &gt;&gt; fullState;
</pre></div> </li>
<li>Expert version:<br/>
 For a state space type of type T, the result of <a class="el" href="classompl_1_1base_1_1StateSpace.html#a65ed00dd1909446bb79542c3670d6efd" title="Allocate a state that can store a point in the described space.">ompl::base::StateSpace::allocState()</a> can be casted to T::StateType* to gain access to the state's members. To ease this functionality, the <a class="el" href="classompl_1_1base_1_1State.html#ae4c61a06169a1f19107fe3efc33d556b" title="Cast this instance to a desired type.">ompl::base::State::as()</a> functions have been defined. <div class="fragment"><pre class="fragment"><a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> space(<span class="keyword">new</span> <a class="code" href="classompl_1_1base_1_1RealVectorStateSpace.html" title="A state space representing Rn. The distance function is the L2 norm.">ompl::base::RealVectorStateSpace</a>(1));
<a class="code" href="classompl_1_1base_1_1State.html" title="Definition of an abstract state.">ompl::base::State</a> *state = space-&gt;allocState();
state-&gt;<a class="code" href="classompl_1_1base_1_1State.html#ae4ed5c095a6b2d4a5c946b91bc65e9cb" title="Cast this instance to a desired type.">as</a>&lt;<a class="code" href="classompl_1_1base_1_1RealVectorStateSpace_1_1StateType.html" title="The definition of a state in Rn">ompl::base::RealVectorStateSpace::StateType</a>&gt;()-&gt;values[0] = 0.1;
<a class="code" href="classompl_1_1base_1_1State.html" title="Definition of an abstract state.">ompl::base::State</a> *copy = space-&gt;allocState();
space-&gt;copyState(copy, state);
<span class="keywordflow">if</span> (!space-&gt;equalStates(copy, state))
   <span class="keywordflow">throw</span> <a class="code" href="classompl_1_1Exception.html" title="The exception type for ompl.">ompl::Exception</a>(<span class="stringliteral">&quot;This should not happen&quot;</span>);
space-&gt;freeState(state);
space-&gt;freeState(copy);
</pre></div></li>
</ul>
<h2><a class="anchor" id="stateAndSpaceOperatorsCopy"></a>
Operators for States and State Spaces</h2>
<p>These operators are intended to simplify code that manipulates states and state spaces. They rely on the fact that state spaces have unique names. Here are some examples for using these operators: </p>
<div class="fragment"><pre class="fragment">           <span class="comment">// Assume X, Y, Z, W are state space instances, none of</span>
           <span class="comment">// which inherits from ompl::base::CompoundStateSpace.</span>
           <span class="comment">// Denote a compound state space as C[...], where &quot;...&quot; is the</span>
           <span class="comment">// list of subspaces.</span>

           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> X;
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> Y;
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> Z;
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> W;

           <span class="comment">// the following line will construct a state space C1 = C[X, Y]</span>
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> C1 = X + Y;

           <span class="comment">// the following line will construct a state space C2 = C[X, Y, Z]</span>
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> C2 = C1 + Z;

           <span class="comment">// the following line will leave C2 as C[X, Y, Z]</span>
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> C2 = C1 + C2;

           <span class="comment">// the following line will construct a state space C2 = C[X, Y, Z, W]</span>
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> C2 = C2 + W;

           <span class="comment">// the following line will construct a state space C3 = C[X, Z, Y]</span>
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> C3 = X + Z + Y;

           <span class="comment">// the following line will construct a state space C4 = C[Z, W]</span>
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> C4 = C2 - C1;

           <span class="comment">// the following line will construct a state space C5 = W</span>
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> C5 = C2 - C3;

           <span class="comment">// the following line will construct an empty state space C6 = C[]</span>
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> C6 = X - X;

           <span class="comment">// the following line will construct an empty state space C7 = Y</span>
           <a class="code" href="classompl_1_1base_1_1StateSpacePtr.html" title="A boost shared pointer wrapper for ompl::base::StateSpace.">ompl::base::StateSpacePtr</a> C7 = Y + C6;
</pre></div><p> These state spaces can be used when operating with states: </p>
<div class="fragment"><pre class="fragment">           <a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;&gt;</a> sX(X);
           <a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;&gt;</a> sXY(X + Y);
           <a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;&gt;</a> sY(Y);
           <a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;&gt;</a> sZX(Z + X);
           <a class="code" href="classompl_1_1base_1_1ScopedState.html" title="Definition of a scoped state.">ompl::base::ScopedState&lt;&gt;</a> sXZW(X + Z + W);

           <span class="comment">// the following line will copy the content of the state sX to</span>
           <span class="comment">// the corresponding locations in sXZW. The components of the state</span>
           <span class="comment">// corresponding to the Z and W state spaces are not touched</span>
           sX &gt;&gt; sXZW;

           <span class="comment">// the following line will initialize the X component of sXY with</span>
           <span class="comment">// the X component of sXZW;</span>
           sXY &lt;&lt; sXZW;

           <span class="comment">// the following line will initialize both components of sZX, using</span>
           <span class="comment">// the X and Z components of sXZW;</span>
           sZX &lt;&lt; sXZW;

           <span class="comment">// the following line compares the concatenation of states sX and sY with sXY</span>
           <span class="comment">// the concatenation will automatically construct the state space X + Y and a state</span>
           <span class="comment">// from that state space containing the information from sX and sY. Since sXY is</span>
           <span class="comment">// constructed from the state space X + Y, the two are comparable.</span>
           <span class="keywordtype">bool</span> eq = (sX ^ sY) == sXY;
</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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</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> &bull;
  <a href="http://www.cs.rice.edu">Department of Computer Science</a> &bull;
  <a href="http://www.rice.edu">Rice University</a><br>
  <div class="gray">Generated on Sun Oct 9 2011 23:04:30 by&#160;<a href="http://www.doxygen.org/index.html">doxygen</a> 1.7.4</div>
</div>
</div>
</body>
</html>