Drake
InternalFrame Class Reference

This is the internal representation of a GeometryFrame. More...

#include <drake/geometry/internal_frame.h>

Public Member Functions

 InternalFrame ()
 Default constructor. More...
 
 InternalFrame (SourceId source_id, FrameId frame_id, const std::string &name, int frame_group, FrameIndex index, FrameId parent_id, int clique)
 Full constructor. More...
 
bool operator== (const InternalFrame &other) const
 Compares two InternalFrame instances for "equality". More...
 
bool operator!= (const InternalFrame &other) const
 Compares two InternalFrame instances for inequality. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 InternalFrame (const InternalFrame &)=default
 
InternalFrameoperator= (const InternalFrame &)=default
 
 InternalFrame (InternalFrame &&)=default
 
InternalFrameoperator= (InternalFrame &&)=default
 
Frame properties
SourceId source_id () const
 Returns the source id that registered the frame. More...
 
FrameId id () const
 Returns the globally unique identifier for this frame. More...
 
const std::string & name () const
 Returns the name of this frame. More...
 
int frame_group () const
 Returns the frame group of this frame. More...
 
FrameIndex index () const
 Returns the index of this frame in the full scene graph. More...
 
int clique () const
 Returns the clique associated with this frame. More...
 

Scene Graph topology

bool has_parent (FrameId parent) const
 Returns true if this frame has the given id as its parent. More...
 
bool is_world () const
 Returns true if this frame is the one and only world frame. More...
 
FrameId parent_frame_id () const
 Returns the id of this frame's parent frame. More...
 
const std::unordered_set< FrameId > & child_frames () const
 Returns a list of ids of the frames that have this frame as a parent frame. More...
 
const std::unordered_set< GeometryId > & child_geometries () const
 Returns a list of ids of the geometries that are directly attached to this frame. More...
 
int num_child_geometries () const
 The number of total geometries attached to this frame. More...
 
bool has_child (FrameId frame_id) const
 Returns true if this frame considers the given frame_id to be a child. More...
 
void add_child (FrameId frame_id)
 Adds the given frame_id to the set of frames that this frame considers to be children. More...
 
bool has_child (GeometryId geometry_id) const
 Returns true if this frame considers the given geometry_id to be rigidly affixed to it. More...
 
void add_child (GeometryId geometry_id)
 Adds the given geometry_id to the set of geometries that this frame considers to be children. More...
 
void remove_child (GeometryId geometry_id)
 Removes the given geometry_id from the set of geometries that this frame considers to be children. More...
 
static FrameId world_frame_id ()
 The identifier used for identifying the single world frame in all instances of SceneGraph. More...
 
static int world_frame_group ()
 Reports the reserved frame group for the world frame. More...
 
static int world_frame_clique ()
 Reports the reserved clique for the world frame. More...
 

Detailed Description

This is the internal representation of a GeometryFrame.

It includes the user-specified data (name and frame group), excludes the pose data, and then includes topology data.

It is not intended to be used outside of the geometry library. To instantiate frames in SceneGraph, use the drake::geometry::GeometryFrame class in conjunction with the SceneGraph::RegisterFrame() methods.

This class works with InternalGeometry. The relationships between frames and geometries are stored in these classes but these classes have no logic to enforce a coherent picture. For example, an InternalFrame F can claim to have another frame G as its child, such that G's frame id appears F's list of child frame ids. However, this class does not guarantee that the instance of InternalFrame for G correctly reports F's id as its parent frame. It relies on GeometryState to enforce those invariants. The same can be said of child InternalGeometry instances.

Constructor & Destructor Documentation

◆ InternalFrame() [1/4]

InternalFrame ( const InternalFrame )
default

◆ InternalFrame() [2/4]

InternalFrame ( InternalFrame &&  )
default

◆ InternalFrame() [3/4]

Default constructor.

The parent identifier and pose index will be invalid.

◆ InternalFrame() [4/4]

InternalFrame ( SourceId  source_id,
FrameId  frame_id,
const std::string &  name,
int  frame_group,
FrameIndex  index,
FrameId  parent_id,
int  clique 
)

Full constructor.

Parameters
source_idThe identifier of the source this belongs to.
frame_idThe identifier of this frame.
nameThe name of the frame.
frame_groupThe frame's frame group membership.
indexThe index of this frame in the SceneGraph.
parent_idThe id of the parent frame.
cliqueThe clique that will be used to prevent self-collision among geometries rigidly affixed to this frame.

Member Function Documentation

◆ add_child() [1/2]

void add_child ( FrameId  frame_id)
inline

Adds the given frame_id to the set of frames that this frame considers to be children.

◆ add_child() [2/2]

void add_child ( GeometryId  geometry_id)
inline

Adds the given geometry_id to the set of geometries that this frame considers to be children.

◆ child_frames()

const std::unordered_set<FrameId>& child_frames ( ) const
inline

Returns a list of ids of the frames that have this frame as a parent frame.

◆ child_geometries()

const std::unordered_set<GeometryId>& child_geometries ( ) const
inline

Returns a list of ids of the geometries that are directly attached to this frame.

It does not include geometries that are attached to child frames of this frame.

◆ clique()

int clique ( ) const
inline

Returns the clique associated with this frame.

◆ frame_group()

int frame_group ( ) const
inline

Returns the frame group of this frame.

It is an externally defined integer value that can be used to create relationships between frames; it has no internal significance or dependencies.

◆ has_child() [1/2]

bool has_child ( FrameId  frame_id) const
inline

Returns true if this frame considers the given frame_id to be a child.

◆ has_child() [2/2]

bool has_child ( GeometryId  geometry_id) const
inline

Returns true if this frame considers the given geometry_id to be rigidly affixed to it.

◆ has_parent()

bool has_parent ( FrameId  parent) const
inline

Returns true if this frame has the given id as its parent.

◆ id()

FrameId id ( ) const
inline

Returns the globally unique identifier for this frame.

◆ index()

FrameIndex index ( ) const
inline

Returns the index of this frame in the full scene graph.

◆ is_world()

bool is_world ( ) const
inline

Returns true if this frame is the one and only world frame.

◆ name()

const std::string& name ( ) const
inline

Returns the name of this frame.

◆ num_child_geometries()

int num_child_geometries ( ) const
inline

The number of total geometries attached to this frame.

It should be true that this->num_child_geometries() == this->child_geometries().size(). To determine the number of geometries attached to this frame by geometry role, use the GeometryState::GetNumFrameGeometriesByRole() method.

◆ operator!=()

bool operator!= ( const InternalFrame other) const

Compares two InternalFrame instances for inequality.

See operator==() for the definition of equality.

◆ operator=() [1/2]

InternalFrame& operator= ( InternalFrame &&  )
default

◆ operator=() [2/2]

InternalFrame& operator= ( const InternalFrame )
default

◆ operator==()

bool operator== ( const InternalFrame other) const

Compares two InternalFrame instances for "equality".

Two internal frames are considered equal if they have the same frame identifier.

◆ parent_frame_id()

FrameId parent_frame_id ( ) const
inline

Returns the id of this frame's parent frame.

If this is the world frame, it returns its own id (as there is no usable "undefined" identifier value).

◆ remove_child()

void remove_child ( GeometryId  geometry_id)
inline

Removes the given geometry_id from the set of geometries that this frame considers to be children.

Precondition
the id is a valid child of this frame.

◆ source_id()

SourceId source_id ( ) const
inline

Returns the source id that registered the frame.

◆ world_frame_clique()

static int world_frame_clique ( )
inlinestatic

Reports the reserved clique for the world frame.

◆ world_frame_group()

static int world_frame_group ( )
inlinestatic

Reports the reserved frame group for the world frame.

◆ world_frame_id()

FrameId world_frame_id ( )
static

The identifier used for identifying the single world frame in all instances of SceneGraph.

The world frame will eventually have an arbitrary number of child frames and geometries; but there will always only be one world frame.


The documentation for this class was generated from the following files: