Drake
FrameIdVector Class Reference

Represents an ordered set of frame identifiers. More...

#include <drake/geometry/frame_id_vector.h>

Public Types

typedef std::vector< FrameId >::const_iterator ConstIterator
 

Public Member Functions

 FrameIdVector (SourceId source_id)
 Constructor for an empty id vector. More...
 
 FrameIdVector (SourceId source_id, const std::vector< FrameId > &ids)
 Constructor which initializes the frame ids by copying the given ids. More...
 
SourceId get_source_id () const
 Reports the source id for this data. More...
 
int size () const
 Reports the number of ids stored in the vector. More...
 
FrameId get_frame_id (int i) const
 Returns the iᵗʰ frame id. More...
 
int GetIndex (FrameId frame_id) const
 Returns the index of the given frame id. More...
 
void AddFrameId (FrameId frame_id)
 Appends the given frame identifier to the set. More...
 
void AddFrameIds (const std::vector< FrameId > &ids)
 Appends the given set of frame ids to the set. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 FrameIdVector (const FrameIdVector &)=default
 
FrameIdVectoroperator= (const FrameIdVector &)=default
 
 FrameIdVector (FrameIdVector &&)=default
 
FrameIdVectoroperator= (FrameIdVector &&)=default
 
Support for range-based loop iteration
ConstIterator begin () const
 
ConstIterator end () const
 

Detailed Description

Represents an ordered set of frame identifiers.

Instances of this class work in conjunction with instances of FramePoseVector and FrameVelocityVector to communicate frame kinematics to GeometryWorld and GeometrySystem. Considered together, they represent a "struct-of-arrays" paradigm. The iᵗʰ value in the FrameIdVector is the frame identifier whose position is specified by the iᵗʰ value in the corresponding FramePoseVector (and analogously for the FrameVelocityVector).

The geometry source can use arbitrary logic to define the order of the ids. However, all frames registered by the source must be included. Omitting a registered frame id is considered an error (and will cause an exception when GeometryWorld/GeometrySystem evaluates the data.

Member Typedef Documentation

typedef std::vector<FrameId>::const_iterator ConstIterator

Constructor & Destructor Documentation

FrameIdVector ( const FrameIdVector )
default
FrameIdVector ( FrameIdVector &&  )
default
FrameIdVector ( SourceId  source_id)
explicit

Constructor for an empty id vector.

Parameters
source_idThe id for the geometry source reporting frame kinematics.
FrameIdVector ( SourceId  source_id,
const std::vector< FrameId > &  ids 
)

Constructor which initializes the frame ids by copying the given ids.

In Debug builds, the input ids will be tested for duplicates; an exception is thrown if duplicates are found.

Parameters
source_idThe id for the geometry source reporting frame kinematics.
idsThe vector of ids which are copied into this vector.
Exceptions
std::logic_error(in Debug) if any of the ids are duplicated.

Here is the call graph for this function:

Member Function Documentation

void AddFrameId ( FrameId  frame_id)

Appends the given frame identifier to the set.

Parameters
frame_idThe frame identifier to add.
Exceptions
std::logic_errorif the frame_id already exists in the vector.

Here is the caller graph for this function:

void AddFrameIds ( const std::vector< FrameId > &  ids)

Appends the given set of frame ids to the set.

In Debug build, the resultant set is tested for duplicate frame ids.

Parameters
idsThe ordered set of frame ids to append to the current set.
Exceptions
std::logic_errorif there are duplicate ids in the resultant set.

Here is the call graph for this function:

Here is the caller graph for this function:

ConstIterator begin ( ) const
inline
ConstIterator end ( ) const
inline
FrameId get_frame_id ( int  i) const
inline

Returns the iᵗʰ frame id.

Here is the call graph for this function:

SourceId get_source_id ( ) const
inline

Reports the source id for this data.

Here is the caller graph for this function:

int GetIndex ( FrameId  frame_id) const

Returns the index of the given frame id.

Exceptions
std::logic_errorif the frame id is not in the set.

Here is the call graph for this function:

Here is the caller graph for this function:

FrameIdVector& operator= ( const FrameIdVector )
default
FrameIdVector& operator= ( FrameIdVector &&  )
default
int size ( ) const
inline

Reports the number of ids stored in the vector.

Here is the caller graph for this function:


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