Drake

Data structure to store the topological information associated with an entire MultibodyTree. More...
#include <drake/multibody/multibody_tree/multibody_tree_topology.h>
Public Member Functions  
MultibodyTreeTopology ()  
Default constructor creates an empty, invalid topology. More...  
int  get_num_bodies () const 
Returns the number of bodies in the multibody tree. More...  
int  get_num_frames () const 
Returns the number of physical frames in the multibody tree. More...  
int  get_num_mobilizers () const 
Returns the number of mobilizers in the multibody tree. More...  
int  get_num_body_nodes () const 
Returns the number of tree nodes. This must equal the number of bodies. More...  
int  get_tree_height () const 
Returns the number of tree levels in the topology. More...  
const FrameTopology &  get_frame (FrameIndex index) const 
Returns a constant reference to the corresponding FrameTopology given the FrameIndex. More...  
const BodyTopology &  get_body (BodyIndex index) const 
Returns a constant reference to the corresponding BodyTopology given a BodyIndex. More...  
const MobilizerTopology &  get_mobilizer (MobilizerIndex index) const 
Returns a constant reference to the corresponding BodyTopology given a BodyIndex. More...  
const BodyNodeTopology &  get_body_node (BodyNodeIndex index) const 
Returns a constant reference to the corresponding BodyNodeTopology given a BodyNodeIndex. More...  
std::pair< BodyIndex, FrameIndex >  add_body () 
Creates and adds a new BodyTopology to this MultibodyTreeTopology. More...  
FrameIndex  add_frame (BodyIndex body_index) 
Creates and adds a new FrameTopology, associated with the given body_index, to this MultibodyTreeTopology. More...  
MobilizerIndex  add_mobilizer (FrameIndex in_frame, FrameIndex out_frame, int num_positions, int num_velocities) 
Creates and adds a new MobilizerTopology connecting the inboard and outboard multibody frames identified by indexes in_frame and out_frame , respectively. More...  
void  Finalize () 
This method must be called by MultibodyTree::Finalize() after all topological elements in the tree (corresponding to joints, bodies, force elements, constraints) were added and before any computations are performed. More...  
bool  is_valid () const 
Returns true if Finalize() was already called on this topology. More...  
int  get_num_positions () const 
Returns the total number of generalized positions in the model. More...  
int  get_num_velocities () const 
Returns the total number of generalized velocities in the model. More...  
int  get_num_states () const 
Returns the total size of the state vector in the model. More...  
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable  
MultibodyTreeTopology (const MultibodyTreeTopology &)=default  
MultibodyTreeTopology &  operator= (const MultibodyTreeTopology &)=default 
MultibodyTreeTopology (MultibodyTreeTopology &&)=default  
MultibodyTreeTopology &  operator= (MultibodyTreeTopology &&)=default 
Data structure to store the topological information associated with an entire MultibodyTree.

default 

default 

inline 
Default constructor creates an empty, invalid topology.
The minimum valid topology for a minimum valid MultibodyTree contains at least the BodyTopology for the world. The topology for the world body does not get added until MultibodyTree construction, which creates a world body and adds it to the tree.

inline 
Creates and adds a new BodyTopology to this MultibodyTreeTopology.
The BodyTopology will be assigned a new, unique BodyIndex and FrameIndex values.
std::logic_error  if Finalize() was already called on this topology. 

inline 
Creates and adds a new FrameTopology, associated with the given body_index, to this MultibodyTreeTopology.
std::logic_error  if Finalize() was already called on this topology. 

inline 
Creates and adds a new MobilizerTopology connecting the inboard and outboard multibody frames identified by indexes in_frame
and out_frame
, respectively.
The created topology will correspond to that of a Mobilizer with num_positions
and num_velocities
.
std::runtime_error  if either in_frame or out_frame do not index frame topologies in this MultibodyTreeTopology. 
a  std::runtime_error if in_frame == out_frame . 
a  std::runtime_error if in_frame and out_frame already are connected by another mobilizer. More than one mobilizer between two frames is not allowed. 
std::logic_error  if Finalize() was already called on this topology. 

inline 
This method must be called by MultibodyTree::Finalize() after all topological elements in the tree (corresponding to joints, bodies, force elements, constraints) were added and before any computations are performed.
It essentially compiles all the necessary "topological information", i.e. how bodies, joints and, any other elements connect with each other, and performs all the required preprocessing to perform computations at a later stage. This preprocessing includes:
If the finalize stage is successful, the this
topology is validated, meaning it is uptodate after this call. No more multibody tree elements can be added after a call to Finalize().
std::logic_error  If users attempt to call this method on an already finalized topology. 

inline 
Returns a constant reference to the corresponding BodyTopology given a BodyIndex.

inline 
Returns a constant reference to the corresponding BodyNodeTopology given a BodyNodeIndex.

inline 
Returns a constant reference to the corresponding FrameTopology given the FrameIndex.

inline 
Returns a constant reference to the corresponding BodyTopology given a BodyIndex.

inline 
Returns the number of bodies in the multibody tree.
This includes the "world" body and therefore the minimum number of bodies after MultibodyTree::Finalize() will always be one, not zero.

inline 
Returns the number of tree nodes. This must equal the number of bodies.

inline 
Returns the number of physical frames in the multibody tree.

inline 
Returns the number of mobilizers in the multibody tree.
Since the "world" body does not have a mobilizer, the number of mobilizers will always equal the number of bodies minus one.

inline 
Returns the total number of generalized positions in the model.

inline 
Returns the total size of the state vector in the model.

inline 
Returns the total number of generalized velocities in the model.

inline 
Returns the number of tree levels in the topology.

inline 
Returns true
if Finalize() was already called on this
topology.

default 

default 