Drake
drake::geometry Namespace Reference

Namespaces

 optimization
 
 proximity
 
 render
 

Classes

class  Box
 Definition of a box. More...
 
class  Capsule
 Definition of a capsule. More...
 
class  CollisionFilterDeclaration
 Class for articulating changes to the configuration of SceneGraph's "collision filters"; collision filters limit the scope of various proximity queries. More...
 
class  CollisionFilterManager
 Class for configuring "collision filters"; collision filters limit the scope of various proximity queries. More...
 
class  ContactSurface
 The ContactSurface characterizes the intersection of two geometries M and N as a contact surface with a scalar field and a vector field, whose purpose is to support the hydroelastic pressure field contact model as described in: More...
 
class  Convex
 Definition of a convex surface mesh. More...
 
class  Cylinder
 Definition of a cylinder. More...
 
class  DrakeVisualizer
 A system that publishes LCM messages compatible with the drake_visualizer application representing the current state of a SceneGraph instance (whose QueryObject-valued output port is connected to this system's input port). More...
 
struct  DrakeVisualizerParams
 The set of parameters for configuring DrakeVisualizer. More...
 
class  DrakeVisualizerTest
 
class  Ellipsoid
 Definition of an ellipsoid. More...
 
class  FrameKinematicsVector
 A FrameKinematicsVector is used to report kinematics data for registered frames (identified by unique FrameId values) to SceneGraph. More...
 
class  GeometryFrame
 This simple class carries the definition of a frame used in the SceneGraph. More...
 
class  GeometryId
 Type used to identify geometry instances in SceneGraph. More...
 
class  GeometryInstance
 A geometry instance combines a geometry definition (i.e., a shape of some sort), a pose (relative to a parent "frame" P), material information, and an opaque collection of metadata. More...
 
class  GeometryProperties
 The base class for defining a set of geometry properties. More...
 
class  GeometrySet
 The GeometrySet, as its name implies, is a convenience class for defining a set of geometries. More...
 
class  GeometrySetTester
 
class  GeometryState
 The context-dependent state of SceneGraph. More...
 
class  GeometryVersion
 A version numbering class that reports revisions of SceneGraph's geometric data. More...
 
class  HalfSpace
 Definition of a half space. More...
 
class  IllustrationProperties
 The set of properties for geometry used in an "illustration" role. More...
 
class  Mesh
 Definition of a general (possibly non-convex) triangular surface mesh. More...
 
class  MeshFieldLinear
 MeshFieldLinear represents a continuous piecewise-linear scalar field f defined on a (triangular or tetrahedral) mesh; the field value changes linearly within each element E (triangle or tetrahedron), and the gradient ∇f is constant within each element. More...
 
struct  PenetrationAsPointPair
 A characterization of the intersection of two penetrating geometries. More...
 
class  PerceptionProperties
 The set of properties for geometry used in a "perception" role. More...
 
struct  promoted_numerical
 Given the two scalar types U and T, returns the most "promoted" type. More...
 
class  ProximityProperties
 The set of properties for geometry used in a proximity role. More...
 
class  QueryObject
 The QueryObject serves as a mechanism to perform geometry queries on the world's geometry. More...
 
class  Rgba
 Defines RGBA (red, green, blue, alpha) values on the range [0, 1]. More...
 
class  SceneGraph
 SceneGraph serves as the nexus for all geometry (and geometry-based operations) in a Diagram. More...
 
class  SceneGraphInspector
 The SceneGraphInspector serves as a mechanism to query the topological structure of a SceneGraph instance. More...
 
class  Shape
 The base interface for all shape specifications. More...
 
class  ShapeName
 Class that reports the name of the type of shape being reified (e.g., Sphere, Box, etc.) More...
 
class  ShapeReifier
 The interface for converting shape descriptions to real shapes. More...
 
struct  ShapeTag
 Simple struct for instantiating the type-specific Shape functionality. More...
 
struct  SignedDistancePair
 The data for reporting the signed distance between two geometries, A and B. More...
 
struct  SignedDistanceToPoint
 The data for reporting the signed distance from a query point to a geometry. More...
 
class  Sphere
 Definition of sphere. More...
 
class  SurfaceFace
 SurfaceFace represents a triangular face in a SurfaceMesh. More...
 
class  SurfaceMesh
 SurfaceMesh represents a triangulated surface. More...
 
class  SurfaceMeshTester
 
class  SurfaceVertex
 SurfaceVertex represents a vertex in SurfaceMesh. More...
 
class  VolumeElement
 VolumeElement represents a tetrahedral element in a VolumeMesh. More...
 
class  VolumeMesh
 VolumeMesh represents a tetrahedral volume mesh. More...
 
class  VolumeMeshTester
 
class  VolumeVertex
 VolumeVertex represents a vertex in VolumeMesh. More...
 

Typedefs

using DrakeVisualizerd = DrakeVisualizer< double >
 A convenient alias for the DrakeVisualizer class when using the double scalar type. More...
 
template<typename T >
using FramePoseVector = FrameKinematicsVector< math::RigidTransform< T > >
 Class for communicating pose information to SceneGraph for registered frames. More...
 
using SourceId = drake::Identifier< class SourceTag >
 Type used to identify geometry sources in SceneGraph. More...
 
using FrameId = drake::Identifier< class FrameTag >
 Type used to identify geometry frames in SceneGraph. More...
 
using FrameIndex = TypeSafeIndex< class GeometryTag >
 Index into the ordered vector of all registered frames – by convention, the world frame's index is always zero. More...
 
template<typename T , typename U >
using promoted_numerical_t = typename promoted_numerical< T, U >::type
 
using SurfaceVertexIndex = TypeSafeIndex< class SurfaceVertexTag >
 Index used to identify a vertex in a surface mesh. More...
 
using SurfaceFaceIndex = TypeSafeIndex< class SurfaceFaceTag >
 Index for identifying a triangular face in a surface mesh. More...
 
template<typename FieldValue , typename T >
using SurfaceMeshFieldLinear = MeshFieldLinear< FieldValue, SurfaceMesh< T > >
 A convenience alias for instantiating a MeshFieldLinear on a SurfaceMesh. More...
 
using VolumeVertexIndex = TypeSafeIndex< class VolumeVertexTag >
 Index used to identify a vertex in a volume mesh. More...
 
using VolumeElementIndex = TypeSafeIndex< class VolumeElementTag >
 Index for identifying a tetrahedral element in a volume mesh. More...
 
template<typename FieldValue , typename T >
using VolumeMeshFieldLinear = MeshFieldLinear< FieldValue, VolumeMesh< T > >
 A convenience alias for instantiating a MeshFieldLinear on a VolumeMesh. More...
 
Structures for maintaining the entity relationships
using FrameIdSet = std::unordered_set< FrameId >
 Collection of unique frame ids. More...
 

Enumerations

enum  Role { kUnassigned = 0x0, kProximity = 0x1, kIllustration = 0x2, kPerception = 0x4 }
 General enumeration for indicating geometry role. More...
 
enum  RoleAssign { kNew, kReplace }
 The operations that can be performed on the given properties when assigning roles to geometry. More...
 

Functions

SurfaceMesh< double > ReadObjToSurfaceMesh (const std::string &filename, double scale=1.0, std::function< void(std::string_view)> on_warning={})
 Constructs a surface mesh from a Wavefront .obj file and optionally scales coordinates by the given scale factor. More...
 
SurfaceMesh< double > ReadObjToSurfaceMesh (std::istream *input_stream, double scale=1.0, std::function< void(std::string_view)> on_warning={})
 Overload of ReadObjToSurfaceMesh(const std::string&, double) with the Wavefront .obj file given in std::istream. More...
 
bool operator== (const VolumeElement &e1, const VolumeElement &e2)
 
bool operator!= (const VolumeElement &e1, const VolumeElement &e2)
 
void AddRigidHydroelasticProperties (double resolution_hint, ProximityProperties *properties)
 Adds properties to the given set of proximity properties sufficient to cause the associated geometry to generate a rigid hydroelastic representation. More...
 
void AddRigidHydroelasticProperties (ProximityProperties *properties)
 Overload, intended for shapes that don't get tessellated in their hydroelastic representation (e.g., HalfSpace and Mesh). More...
 
void AddSoftHydroelasticProperties (double resolution_hint, ProximityProperties *properties)
 Adds properties to the given set of proximity properties sufficient to cause the associated geometry to generate a soft hydroelastic representation. More...
 
void AddSoftHydroelasticProperties (ProximityProperties *properties)
 Overload, intended for shapes that don't get tessellated in their hydroelastic representation (e.g., HalfSpace). More...
 
void AddSoftHydroelasticPropertiesForHalfSpace (double slab_thickness, ProximityProperties *properties)
 Soft half spaces are handled as a special case; they do not get tessellated. More...
 
Geometry role to string conversions

These are simply convenience functions for converting the Role enumeration into a human-readable string.

std::string to_string (const Role &role)
 
std::ostream & operator<< (std::ostream &out, const Role &role)
 
Convenience functions

A collection of functions to help facilitate working with properties.

IllustrationProperties MakePhongIllustrationProperties (const Vector4< double > &diffuse)
 Constructs an IllustrationProperties instance compatible with a simple "phong" material using only the given diffuse color. More...
 
Contact Material Utility Functions

AddContactMaterial() adds contact material properties to the given set of proximity properties. Only the parameters that carry values will be added to the given set of properties; no default values will be provided. Downstream consumers of the contact materials can optionally provide defaults for missing properties.

For legacy and backwards compatibility purposes, two overloads for AddContactMaterial() are provided. One supports all contact material properties except point_stiffness, and the other includes it. Users are encouraged to use the overload that contains the argument for point_stiffness.

These functions will throw an error if:

  • elastic_modulus is not positive
  • dissipation is negative
  • point_stiffness is not positive
  • Any of the contact material properties have already been defined in properties.
void AddContactMaterial (const std::optional< double > &elastic_modulus, const std::optional< double > &dissipation, const std::optional< double > &point_stiffness, const std::optional< multibody::CoulombFriction< double >> &friction, ProximityProperties *properties)
 
void AddContactMaterial (const std::optional< double > &elastic_modulus, const std::optional< double > &dissipation, const std::optional< multibody::CoulombFriction< double >> &friction, ProximityProperties *properties)
 

Typedef Documentation

◆ DrakeVisualizerd

A convenient alias for the DrakeVisualizer class when using the double scalar type.

◆ FrameId

using FrameId = drake::Identifier<class FrameTag>

Type used to identify geometry frames in SceneGraph.

◆ FrameIdSet

using FrameIdSet = std::unordered_set<FrameId>

Collection of unique frame ids.

◆ FrameIndex

using FrameIndex = TypeSafeIndex<class GeometryTag>

Index into the ordered vector of all registered frames – by convention, the world frame's index is always zero.

◆ FramePoseVector

Class for communicating pose information to SceneGraph for registered frames.

Template Parameters
TThe scalar type, which must be one of the default scalars.

◆ promoted_numerical_t

using promoted_numerical_t = typename promoted_numerical<T, U>::type

◆ SourceId

using SourceId = drake::Identifier<class SourceTag>

Type used to identify geometry sources in SceneGraph.

◆ SurfaceFaceIndex

using SurfaceFaceIndex = TypeSafeIndex<class SurfaceFaceTag>

Index for identifying a triangular face in a surface mesh.

◆ SurfaceMeshFieldLinear

A convenience alias for instantiating a MeshFieldLinear on a SurfaceMesh.

Template Parameters
FieldValueA valid Eigen scalar or vector of valid Eigen scalars for the field value.
TA valid Eigen scalar for mesh coordinates.

◆ SurfaceVertexIndex

using SurfaceVertexIndex = TypeSafeIndex<class SurfaceVertexTag>

Index used to identify a vertex in a surface mesh.

◆ VolumeElementIndex

using VolumeElementIndex = TypeSafeIndex<class VolumeElementTag>

Index for identifying a tetrahedral element in a volume mesh.

◆ VolumeMeshFieldLinear

A convenience alias for instantiating a MeshFieldLinear on a VolumeMesh.

Template Parameters
FieldValueA valid Eigen scalar or vector of valid Eigen scalars for the field value.
TA valid Eigen scalar for mesh coordinates.

◆ VolumeVertexIndex

using VolumeVertexIndex = TypeSafeIndex<class VolumeVertexTag>

Index used to identify a vertex in a volume mesh.

Enumeration Type Documentation

◆ Role

enum Role
strong

General enumeration for indicating geometry role.

Enumerator
kUnassigned 
kProximity 
kIllustration 
kPerception 

◆ RoleAssign

enum RoleAssign
strong

The operations that can be performed on the given properties when assigning roles to geometry.

Enumerator
kNew 

Assign the properties to a geometry that doesn't already have the role.

kReplace 

Replace the existing role properties completely.

Function Documentation

◆ AddContactMaterial() [1/2]

void drake::geometry::AddContactMaterial ( const std::optional< double > &  elastic_modulus,
const std::optional< double > &  dissipation,
const std::optional< double > &  point_stiffness,
const std::optional< multibody::CoulombFriction< double >> &  friction,
ProximityProperties properties 
)
Exceptions
std::exceptionif any parameter doesn't satisfy the requirements listed in Contact Material Utility Functions.

◆ AddContactMaterial() [2/2]

void drake::geometry::AddContactMaterial ( const std::optional< double > &  elastic_modulus,
const std::optional< double > &  dissipation,
const std::optional< multibody::CoulombFriction< double >> &  friction,
ProximityProperties properties 
)
Warning
Please use the overload of AddContactMaterial() that includes the argument for point_stiffness rather than this one.

◆ AddRigidHydroelasticProperties() [1/2]

void drake::geometry::AddRigidHydroelasticProperties ( double  resolution_hint,
ProximityProperties properties 
)

Adds properties to the given set of proximity properties sufficient to cause the associated geometry to generate a rigid hydroelastic representation.

Parameters
resolution_hintIf the geometry is to be tessellated, it is the parameter that guides the level of mesh refinement. See MODULE_NOT_WRITTEN_YET. This will be ignored for geometry types that don't require tessellation.
[in,out]propertiesThe properties will be added to this property set.
Exceptions
std::exceptionIf properties already has properties with the names that this function would need to add.
Precondition
0 < resolution_hint < ∞ and properties is not nullptr.

◆ AddRigidHydroelasticProperties() [2/2]

void drake::geometry::AddRigidHydroelasticProperties ( ProximityProperties properties)

Overload, intended for shapes that don't get tessellated in their hydroelastic representation (e.g., HalfSpace and Mesh).

See MODULE_NOT_WRITTEN_YET.

◆ AddSoftHydroelasticProperties() [1/2]

void drake::geometry::AddSoftHydroelasticProperties ( double  resolution_hint,
ProximityProperties properties 
)

Adds properties to the given set of proximity properties sufficient to cause the associated geometry to generate a soft hydroelastic representation.

The geometry's pressure field will be the function p(e) = Ee, where E is the elastic modulus stored in the given properties.

Parameters
resolution_hintIf the geometry is to be tessellated, it is the parameter that guides the level of mesh refinement. This will be ignored for geometry types that don't require tessellation.
[in,out]propertiesThe properties will be added to this property set.
Exceptions
std::exceptionIf properties already has properties with the names that this function would need to add.
Precondition
0 < resolution_hint < ∞, properties is not nullptr, and properties contains a valid elastic modulus value.

◆ AddSoftHydroelasticProperties() [2/2]

void drake::geometry::AddSoftHydroelasticProperties ( ProximityProperties properties)

Overload, intended for shapes that don't get tessellated in their hydroelastic representation (e.g., HalfSpace).

See MODULE_NOT_WRITTEN_YET.

◆ AddSoftHydroelasticPropertiesForHalfSpace()

void drake::geometry::AddSoftHydroelasticPropertiesForHalfSpace ( double  slab_thickness,
ProximityProperties properties 
)

Soft half spaces are handled as a special case; they do not get tessellated.

Instead, they are treated as infinite slabs with a finite thickness. This variant is required for hydroelastic half spaces.

Parameters
slab_thicknessThe distance from the half space boundary to its rigid core (this helps define the extent field of the half space).
[out]propertiesThe properties will be added to this property set.
Exceptions
std::exceptionIf properties already has properties with the names that this function would need to add.
Precondition
0 < slab_thickness < ∞ .

◆ MakePhongIllustrationProperties()

IllustrationProperties drake::geometry::MakePhongIllustrationProperties ( const Vector4< double > &  diffuse)

Constructs an IllustrationProperties instance compatible with a simple "phong" material using only the given diffuse color.

◆ operator!=()

bool drake::geometry::operator!= ( const VolumeElement e1,
const VolumeElement e2 
)

◆ operator<<()

std::ostream& drake::geometry::operator<< ( std::ostream &  out,
const Role role 
)

◆ operator==()

bool drake::geometry::operator== ( const VolumeElement e1,
const VolumeElement e2 
)

◆ ReadObjToSurfaceMesh() [1/2]

SurfaceMesh<double> drake::geometry::ReadObjToSurfaceMesh ( const std::string &  filename,
double  scale = 1.0,
std::function< void(std::string_view)>  on_warning = {} 
)

Constructs a surface mesh from a Wavefront .obj file and optionally scales coordinates by the given scale factor.

Polygons will be triangulated if they are not triangles already. All objects in the .obj file will be merged into the surface mesh. See https://en.wikipedia.org/wiki/Wavefront_.obj_file for the file format.

Parameters
filenameA valid file name with absolute path or relative path.
scaleAn optional scale to coordinates.
on_warningAn optional callback that will receive warning message(s) encountered while reading the mesh. When not provided, drake::log() will be used.
Exceptions
std::exceptionif filename doesn't have a valid file path, or the file has no faces.
Returns
surface mesh

◆ ReadObjToSurfaceMesh() [2/2]

SurfaceMesh<double> drake::geometry::ReadObjToSurfaceMesh ( std::istream *  input_stream,
double  scale = 1.0,
std::function< void(std::string_view)>  on_warning = {} 
)

Overload of ReadObjToSurfaceMesh(const std::string&, double) with the Wavefront .obj file given in std::istream.

◆ to_string()

std::string drake::geometry::to_string ( const Role role)