Skip to content

Commit 6e792c1

Browse files
1 parent cceea55 commit 6e792c1

File tree

5 files changed

+17
-20
lines changed

5 files changed

+17
-20
lines changed

doxygen_cxx/classdrake_1_1_identifier.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
class drake::Identifier&lt; Tag &gt;</h3>
175175

176176
<p>A simple identifier class. </p>
177-
<dl class="section note"><dt>Note</dt><dd>This is <em>purposely</em> a separate class from <a class="el" href="classdrake_1_1_type_safe_index.html">TypeSafeIndex</a>. For more explanatation, see <a class="el" href="classdrake_1_1_identifier.html#TypeSafeIndexVsIndentifier">this section</a>.</dd></dl>
177+
<dl class="section note"><dt>Note</dt><dd>This is <em>purposely</em> a separate class from <a class="el" href="classdrake_1_1_type_safe_index.html">TypeSafeIndex</a>. For more explanation, see <a class="el" href="classdrake_1_1_identifier.html#TypeSafeIndexVsIdentifier">this section</a>.</dd></dl>
178178
<p>This class serves as an upgrade to the standard practice of passing <code>int</code>s around as unique identifiers (or, as in this case, <code>int64_t</code>s). In the common practice, a method that takes identifiers to different types of objects would have an interface like:</p>
179179
<div class="fragment"><div class="line"><span class="keywordtype">void</span> foo(<a class="code" href="classint64__t.html">int64_t</a> bar_id, <a class="code" href="classint64__t.html">int64_t</a> thing_id);</div></div><!-- fragment --><p>It is possible for a programmer to accidentally switch the two ids in an invocation. This mistake would still be <em>syntactically</em> correct; it will successfully compile but lead to inscrutable run-time errors. This identifier class provides the same speed and efficiency of passing <code>int64_t</code>s, but enforces unique types and limits the valid operations, providing compile-time checking. The function would now look like:</p>
180180
<div class="fragment"><div class="line"><span class="keywordtype">void</span> foo(BarId bar_id, ThingId thing_id)</div></div><!-- fragment --><p>and the compiler will catch instances where the order is reversed.</p>
@@ -195,7 +195,7 @@
195195
<p>It is the designed intent of this class, that ids derived from this class can be passed and returned by value. (Drake's typical calling convention requires passing input arguments by const reference, or by value when moved from. That convention does not apply to this class.)</p>
196196
<p>The following alias will create a unique identifier type for class <code>Foo</code>: </p><div class="fragment"><div class="line"><span class="keyword">using</span> FooId = Identifier&lt;class FooTag&gt;;</div></div><!-- fragment --><p><b>Examples of valid and invalid operations</b></p>
197197
<p>The Identifier guarantees that id instances of different types can't be compared or combined. Efforts to do so will cause a compile-time failure. For example:</p>
198-
<div class="fragment"><div class="line"><span class="keyword">using</span> AId = Identifier&lt;class ATag&gt;;</div><div class="line"><span class="keyword">using</span> BId = Identifier&lt;class BTag&gt;;</div><div class="line">AId a1; <span class="comment">// Compiler error; there is no</span></div><div class="line"> <span class="comment">// default constructor.</span></div><div class="line">AId a2 = AId::get_new_id(); <span class="comment">// Ok.</span></div><div class="line">AId a3(a2); <span class="comment">// Ok.</span></div><div class="line">AId a4 = AId::get_new_id(); <span class="comment">// Ok.</span></div><div class="line">BId b = BId::get_new_id(); <span class="comment">// Ok.</span></div><div class="line"><span class="keywordflow">if</span> ( a2 == 1 ) { ... } <span class="comment">// Compiler error.</span></div><div class="line"><span class="keywordflow">if</span> ( a2 == a4 ) { ... } <span class="comment">// Ok, evaluates to false.</span></div><div class="line"><span class="keywordflow">if</span> ( a2 == a3 ) { ... } <span class="comment">// Ok, evaluates to true.</span></div><div class="line"><span class="keywordflow">if</span> ( a2 == b ) { ... } <span class="comment">// Compiler error.</span></div><div class="line">a4 = a2; <span class="comment">// Ok.</span></div><div class="line">a3 = 7; <span class="comment">// Compiler error.</span></div></div><!-- fragment --><p><a class="anchor" id="TypeSafeIndexVsIndentifier"></a><b><a class="el" href="classdrake_1_1_type_safe_index.html" title="A type-safe non-negative index class.">TypeSafeIndex</a> vs <a class="el" href="classdrake_1_1_identifier.html" title="A simple identifier class.">Identifier</a></b></p>
198+
<div class="fragment"><div class="line"><span class="keyword">using</span> AId = Identifier&lt;class ATag&gt;;</div><div class="line"><span class="keyword">using</span> BId = Identifier&lt;class BTag&gt;;</div><div class="line">AId a1; <span class="comment">// Compiler error; there is no</span></div><div class="line"> <span class="comment">// default constructor.</span></div><div class="line">AId a2 = AId::get_new_id(); <span class="comment">// Ok.</span></div><div class="line">AId a3(a2); <span class="comment">// Ok.</span></div><div class="line">AId a4 = AId::get_new_id(); <span class="comment">// Ok.</span></div><div class="line">BId b = BId::get_new_id(); <span class="comment">// Ok.</span></div><div class="line"><span class="keywordflow">if</span> ( a2 == 1 ) { ... } <span class="comment">// Compiler error.</span></div><div class="line"><span class="keywordflow">if</span> ( a2 == a4 ) { ... } <span class="comment">// Ok, evaluates to false.</span></div><div class="line"><span class="keywordflow">if</span> ( a2 == a3 ) { ... } <span class="comment">// Ok, evaluates to true.</span></div><div class="line"><span class="keywordflow">if</span> ( a2 == b ) { ... } <span class="comment">// Compiler error.</span></div><div class="line">a4 = a2; <span class="comment">// Ok.</span></div><div class="line">a3 = 7; <span class="comment">// Compiler error.</span></div></div><!-- fragment --><p><a class="anchor" id="TypeSafeIndexVsIdentifier"></a><b><a class="el" href="classdrake_1_1_type_safe_index.html" title="A type-safe non-negative index class.">TypeSafeIndex</a> vs <a class="el" href="classdrake_1_1_identifier.html" title="A simple identifier class.">Identifier</a></b></p>
199199
<p>In principle, the <em>identifier</em> is related to the <a class="el" href="classdrake_1_1_type_safe_index.html">TypeSafeIndex</a>. In some sense, both are "type-safe" <code>int</code>s. They differ in their semantics. We can consider <code>ints</code>, indices, and identifiers as a list of <code>int</code> types with <em>decreasing</em> functionality.</p>
200200
<ul>
201201
<li>The int, obviously, has the full range of C++ ints.</li>

doxygen_cxx/classdrake_1_1_type_safe_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
class drake::TypeSafeIndex&lt; Tag &gt;</h3>
171171

172172
<p>A type-safe non-negative index class. </p>
173-
<dl class="section note"><dt>Note</dt><dd>This is <em>purposely</em> a separate class from <a class="el" href="classdrake_1_1_identifier.html" title="A simple identifier class.">Identifier</a>. For more information, see <a class="el" href="classdrake_1_1_identifier.html#TypeSafeIndexVsIndentifier">this section</a>.</dd></dl>
173+
<dl class="section note"><dt>Note</dt><dd>This is <em>purposely</em> a separate class from <a class="el" href="classdrake_1_1_identifier.html" title="A simple identifier class.">Identifier</a>. For more information, see <a class="el" href="classdrake_1_1_identifier.html#TypeSafeIndexVsIdentifier">this section</a>.</dd></dl>
174174
<p>This class serves as an upgrade to the standard practice of passing <code>int</code>s around as indices. In the common practice, a method that takes indices into multiple collections would have an interface like:</p>
175175
<div class="fragment"><div class="line"><span class="keywordtype">void</span> foo(<span class="keywordtype">int</span> bar_index, <span class="keywordtype">int</span> thing_index);</div></div><!-- fragment --><p>It is possible for a programmer to accidentally switch the two index values in an invocation. This mistake would still be <em>syntactically</em> correct; it will successfully compile but lead to inscrutable run-time errors. The type-safe index provides the same speed and efficiency of passing <code>int</code>s, but provides compile-time checking. The function would now look like:</p>
176176
<div class="fragment"><div class="line"><span class="keywordtype">void</span> foo(BarIndex bar_index, ThingIndex thing_index);</div></div><!-- fragment --><p>and the compiler will catch instances where the order is reversed.</p>

doxygen_cxx/classdrake_1_1geometry_1_1_scene_graph.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
</ul>
202202
<h1><a class="anchor" id="geom_sys_inputs"></a>
203203
Inputs</h1>
204-
<p>of kinematics values (e.g., pose, velocity, acceleration, and configuration). If a source registers a frame or a deformable geometry, it must connect to the corresponding ports. Failure to connect to the ports (or to provide valid kinematics values) will lead to runtime exceptions.</p>
204+
<p>For each registered geometry source, there is one input port for each order of kinematics values (i.e., pose and configuration). If a source registers a frame or a deformable geometry, it must connect to the corresponding ports. Failure to connect to the ports (or to provide valid kinematics values) will lead to runtime exceptions.</p>
205205
<p><b>pose port</b>: An abstract-valued port providing an instance of FramePoseVector. For each registered frame, this "pose vector" maps the registered FrameId to a pose value. All registered frames must be accounted for and only frames registered by a source can be included in its output port. See the details in <a class="el" href="classdrake_1_1geometry_1_1_kinematics_vector.html" title="A KinematicsVector is a container class used to report kinematics data for registered frames and geom...">KinematicsVector</a> for details on how to provide values for this port.</p>
206206
<p><b>configuration port</b>: An abstract-valued port providing an instance of GeometryConfigurationVector. For each registered deformable geometry, this "configuration vector" maps the registered <a class="el" href="classdrake_1_1geometry_1_1_geometry_id.html" title="Type used to identify geometry instances in SceneGraph.">GeometryId</a> to its world space configuration (i.e. the vertex positions of its mesh representation in the world frame). All registered deformable geometries must be accounted for and only geometries registered by a source can be included in its output port.</p>
207207
<h1><a class="anchor" id="geom_sys_outputs"></a>

pydrake/pydrake.geometry.html

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10521,11 +10521,10 @@ <h1>pydrake.geometry<a class="headerlink" href="#pydrake-geometry" title="Permal
1052110521
- Implement appropriate <code class="docutils literal notranslate"><span class="pre">Calc*</span></code> methods on the geometry output ports to
1052210522
update geometry pose/configuration values.</p>
1052310523
<p>For each registered geometry source, there is one input port for each
10524-
order of kinematics values (e.g., pose, velocity, acceleration, and
10525-
configuration). If a source registers a frame or a deformable
10526-
geometry, it must connect to the corresponding ports. Failure to
10527-
connect to the ports (or to provide valid kinematics values) will lead
10528-
to runtime exceptions.</p>
10524+
order of kinematics values (i.e., pose and configuration). If a source
10525+
registers a frame or a deformable geometry, it must connect to the
10526+
corresponding ports. Failure to connect to the ports (or to provide
10527+
valid kinematics values) will lead to runtime exceptions.</p>
1052910528
<p><strong>pose port</strong>: An abstract-valued port providing an instance of
1053010529
FramePoseVector. For each registered frame, this “pose vector” maps
1053110530
the registered FrameId to a pose value. All registered frames must be
@@ -11450,11 +11449,10 @@ <h1>pydrake.geometry<a class="headerlink" href="#pydrake-geometry" title="Permal
1145011449
- Implement appropriate <code class="docutils literal notranslate"><span class="pre">Calc*</span></code> methods on the geometry output ports to
1145111450
update geometry pose/configuration values.</p>
1145211451
<p>For each registered geometry source, there is one input port for each
11453-
order of kinematics values (e.g., pose, velocity, acceleration, and
11454-
configuration). If a source registers a frame or a deformable
11455-
geometry, it must connect to the corresponding ports. Failure to
11456-
connect to the ports (or to provide valid kinematics values) will lead
11457-
to runtime exceptions.</p>
11452+
order of kinematics values (i.e., pose and configuration). If a source
11453+
registers a frame or a deformable geometry, it must connect to the
11454+
corresponding ports. Failure to connect to the ports (or to provide
11455+
valid kinematics values) will lead to runtime exceptions.</p>
1145811456
<p><strong>pose port</strong>: An abstract-valued port providing an instance of
1145911457
FramePoseVector. For each registered frame, this “pose vector” maps
1146011458
the registered FrameId to a pose value. All registered frames must be
@@ -12368,11 +12366,10 @@ <h1>pydrake.geometry<a class="headerlink" href="#pydrake-geometry" title="Permal
1236812366
- Implement appropriate <code class="docutils literal notranslate"><span class="pre">Calc*</span></code> methods on the geometry output ports to
1236912367
update geometry pose/configuration values.</p>
1237012368
<p>For each registered geometry source, there is one input port for each
12371-
order of kinematics values (e.g., pose, velocity, acceleration, and
12372-
configuration). If a source registers a frame or a deformable
12373-
geometry, it must connect to the corresponding ports. Failure to
12374-
connect to the ports (or to provide valid kinematics values) will lead
12375-
to runtime exceptions.</p>
12369+
order of kinematics values (i.e., pose and configuration). If a source
12370+
registers a frame or a deformable geometry, it must connect to the
12371+
corresponding ports. Failure to connect to the ports (or to provide
12372+
valid kinematics values) will lead to runtime exceptions.</p>
1237612373
<p><strong>pose port</strong>: An abstract-valued port providing an instance of
1237712374
FramePoseVector. For each registered frame, this “pose vector” maps
1237812375
the registered FrameId to a pose value. All registered frames must be

pydrake/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)