Skip to content

Commit

Permalink
Update stale instructions on subclassing Shape specification (RobotLo…
Browse files Browse the repository at this point in the history
  • Loading branch information
tehbelinda authored Nov 20, 2019
1 parent a388cbb commit 0d445e8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
7 changes: 7 additions & 0 deletions geometry/proximity_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ class GeometryStateCollisionFilterAttorney;
- distance
- ray-intersection
Not all shape queries are fully supported. To add support for a shape:
1. for fcl versions of the specification, modify CopyShapeOrThrow().
2. add an instance of the new shape to the CopySemantics test in
proximity_engine_test.cc.
3. for penetration, test the new shape in the class BoxPenetrationTest of
proximity_engine_test.cc and document its configuration.
<!-- TODO(SeanCurtis-TRI): Fully document the semantics of the proximity
properties that will affect the proximity engine -- hydroelastic semantics,
required properties, etc.
Expand Down
17 changes: 8 additions & 9 deletions geometry/shape_specification.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ struct ShapeTag{};
When you add a new subclass of Shape, you must:
1. add a pure virtual function ImplementGeometry() for the new shape in
ShapeReifier.
2. define ImplementGeometry() for the new shape in the subclasses of
ShapeReifier.
3. modify CopyShapeOrThrow() of ProximityEngine to support the new shape and
add an instance of the new shape to the CopySemantics test in
proximity_engine_test.cc.
4. test the new shape in the class BoxPenetrationTest of
proximity_engine_test.cc
1. add a virtual function ImplementGeometry() for the new shape in
ShapeReifier that invokes the ThrowUnsupportedGeometry method, and add to
the test for it in shape_specification_test.cc.
2. implement ImplementGeometry in derived ShapeReifiers to continue support
if desired, otherwise ensure unimplemented functions are not hidden in new
derivations of ShapeReifier with `using`, for example, `using
ShapeReifier::ImplementGeometry`. Existing subclasses should already have
this.
Otherwise, you might get a runtime error. We do not have an automatic way to
enforce them at compile time.
Expand Down

0 comments on commit 0d445e8

Please sign in to comment.