Parasol Planning Library (PPL)
MultiBody Class Reference

#include <MultiBody.h>

Public Types

Local Types
enum class  Type { Active , Passive , Internal }
 The types of MultiBody that we can support. More...
 

Public Member Functions

Construction
 MultiBody (const MultiBody::Type _type)
 
 MultiBody (XMLNode &_node)
 Parse a multibody from an XML node. More...
 
 MultiBody (const MultiBody &)
 Copy. More...
 
 MultiBody (MultiBody &&)
 Move. More...
 
 ~MultiBody ()
 
void InitializeDOFs (const Boundary *const _b)
 
Assignment
MultiBodyoperator= (const MultiBody &)
 Copy. More...
 
MultiBodyoperator= (MultiBody &&)
 Move. More...
 
MultiBody Properties
MultiBody::Type GetType () const noexcept
 Get the type for this MultiBody. More...
 
bool IsActive () const noexcept
 Is this MultiBody an active type? More...
 
bool IsPassive () const noexcept
 Is this MultiBody a non-active type? More...
 
bool IsInternal () const noexcept
 Is this MultiBody an internal type? More...
 
bool IsComposite () const noexcept
 
size_t DOF () const noexcept
 Get the number of DOF for this multibody. More...
 
size_t PosDOF () const noexcept
 Get the number of positional DOF for this multibody's base. More...
 
size_t OrientationDOF () const noexcept
 Get the number of orientational DOF for this multibody's base. More...
 
size_t JointDOF () const noexcept
 Get the number of joint DOF for this multibody. More...
 
const std::vector< double > & GetCurrentDOFs () const noexcept
 Get the current DOFs for this configuration, as set by Configure(). More...
 
std::vector< double > GetCurrentCfg () noexcept
 Get the current configuration dofs (no velocity), as set by Configure(). More...
 
Body Accessors
size_t GetNumBodies () const noexcept
 Get the number of bodies in this multibody. More...
 
const std::vector< Body > & GetBodies () const noexcept
 Get all of the internal bodies. More...
 
std::vector< const Body * > GetEndEffectors () const noexcept
 
BodyGetBody (const size_t _i) noexcept
 
const BodyGetBody (const size_t _i) const noexcept
 
size_t AddBody (Body &&_body)
 
BodyGetBase () noexcept
 Get the base body. More...
 
const BodyGetBase () const noexcept
 
void SetBaseBody (const size_t _index)
 
Body::Type GetBaseType () const noexcept
 Get the body type of the base body. More...
 
Body::MovementType GetBaseMovementType () const noexcept
 Get the movement type of the base body. More...
 
double GetWeight () const
 Get the weight of the MultiBody. More...
 
Geometric Properties
const Vector3d & GetCenterOfMass () const noexcept
 Get the center of mass. More...
 
double GetBoundingSphereRadius () const noexcept
 Get the bounding sphere radius. More...
 
Connections
const std::vector< std::unique_ptr< Connection > > & GetJoints () const noexcept
 Get the Connections in this multibody. More...
 
ConnectionGetJoint (const size_t _i) noexcept
 
const DofTypeGetDOFType (const size_t _i) const noexcept
 Get the DOF type for a specific degree of freedom. More...
 
const std::vector< DofInfo > & GetDofInfo () const noexcept
 Get the DOF info for a specific degree of freedom. More...
 
void UpdateJointLimits () noexcept
 
Configuration Methods
void Configure (const Cfg &_c)
 
void Configure (const std::vector< double > &_v)
 
void PushToNearestValidConfiguration ()
 
I/O
void Read (std::istream &_is, CountingStreamBuffer &_cbs)
 
void Write (std::ostream &_os) const
 

Detailed Description

A geometric object in workspace (such as an obstacle or robot) with one or more sub-components, referred to as Bodies.

Member Enumeration Documentation

◆ Type

enum MultiBody::Type
strong

The types of MultiBody that we can support.

Enumerator
Active 

Movable object.

Passive 

Static visible object.

Internal 

Static invisible object.

Constructor & Destructor Documentation

◆ MultiBody() [1/4]

MultiBody::MultiBody ( const MultiBody::Type  _type)

Construct a multibody.

Parameters
_typeThe multibody type.

◆ MultiBody() [2/4]

MultiBody::MultiBody ( XMLNode _node)

Parse a multibody from an XML node.

◆ MultiBody() [3/4]

MultiBody::MultiBody ( const MultiBody _other)

Copy.

◆ MultiBody() [4/4]

MultiBody::MultiBody ( MultiBody &&  _other)

Move.

◆ ~MultiBody()

MultiBody::~MultiBody ( )
default

Member Function Documentation

◆ AddBody()

size_t MultiBody::AddBody ( Body &&  _body)

Add a body.

Parameters
_bodyThe body to add.
Returns
The index of the added body.

@TODO Adjust our body tracking so that we don't have to add bodies in index order.

◆ Configure() [1/2]

void MultiBody::Configure ( const Cfg _c)

Place a robot at a given configuration.

Parameters
_cThe configuration to use.

◆ Configure() [2/2]

void MultiBody::Configure ( const std::vector< double > &  _v)

Place a robot at a given configuration.

Parameters
_vThe DOF values to use.

◆ DOF()

size_t MultiBody::DOF ( ) const
noexcept

Get the number of DOF for this multibody.

◆ GetBase() [1/2]

const Body * MultiBody::GetBase ( ) const
noexcept

◆ GetBase() [2/2]

Body * MultiBody::GetBase ( )
noexcept

Get the base body.

◆ GetBaseMovementType()

Body::MovementType MultiBody::GetBaseMovementType ( ) const
noexcept

Get the movement type of the base body.

◆ GetBaseType()

Body::Type MultiBody::GetBaseType ( ) const
noexcept

Get the body type of the base body.

◆ GetBodies()

const std::vector< Body > & MultiBody::GetBodies ( ) const
noexcept

Get all of the internal bodies.

◆ GetBody() [1/2]

const Body * MultiBody::GetBody ( const size_t  _i) const
noexcept

◆ GetBody() [2/2]

Body * MultiBody::GetBody ( const size_t  _i)
noexcept

Get an internal body.

Parameters
_iThe index of the body.

◆ GetBoundingSphereRadius()

double MultiBody::GetBoundingSphereRadius ( ) const
noexcept

Get the bounding sphere radius.

◆ GetCenterOfMass()

const Vector3d & MultiBody::GetCenterOfMass ( ) const
noexcept

Get the center of mass.

◆ GetCurrentCfg()

std::vector< double > MultiBody::GetCurrentCfg ( )
noexcept

Get the current configuration dofs (no velocity), as set by Configure().

◆ GetCurrentDOFs()

const std::vector< double > & MultiBody::GetCurrentDOFs ( ) const
noexcept

Get the current DOFs for this configuration, as set by Configure().

◆ GetDofInfo()

const vector< DofInfo > & MultiBody::GetDofInfo ( ) const
noexcept

Get the DOF info for a specific degree of freedom.

◆ GetDOFType()

const DofType & MultiBody::GetDOFType ( const size_t  _i) const
noexcept

Get the DOF type for a specific degree of freedom.

◆ GetEndEffectors()

std::vector< const Body * > MultiBody::GetEndEffectors ( ) const
noexcept

Get the set of bodies which are end-effectors (i.e., have no forward connections).

◆ GetJoint()

Connection * MultiBody::GetJoint ( const size_t  _i)
noexcept

Get a specific Connection.

Parameters
_iThe connection index.

◆ GetJoints()

const std::vector< std::unique_ptr< Connection > > & MultiBody::GetJoints ( ) const
noexcept

Get the Connections in this multibody.

◆ GetNumBodies()

size_t MultiBody::GetNumBodies ( ) const
noexcept

Get the number of bodies in this multibody.

◆ GetType()

MultiBody::Type MultiBody::GetType ( ) const
noexcept

Get the type for this MultiBody.

◆ GetWeight()

double MultiBody::GetWeight ( ) const

Get the weight of the MultiBody.

◆ InitializeDOFs()

void MultiBody::InitializeDOFs ( const Boundary *const  _b)

Initialize the DOF information for this multibody.

Parameters
_bThe Boundary for DOF ranges.

◆ IsActive()

bool MultiBody::IsActive ( ) const
noexcept

Is this MultiBody an active type?

◆ IsComposite()

bool MultiBody::IsComposite ( ) const
noexcept

Is this MultiBody a composite body, i.e. having multiple decoupled bases? This is now ONLY used to check if an old version of disassembly planning problem modeling is used! Composite C-Space that conforms to this check is now depricated, and Group configurations should be used.

◆ IsInternal()

bool MultiBody::IsInternal ( ) const
noexcept

Is this MultiBody an internal type?

◆ IsPassive()

bool MultiBody::IsPassive ( ) const
noexcept

Is this MultiBody a non-active type?

◆ JointDOF()

size_t MultiBody::JointDOF ( ) const
noexcept

Get the number of joint DOF for this multibody.

◆ operator=() [1/2]

MultiBody & MultiBody::operator= ( const MultiBody _other)

Copy.

◆ operator=() [2/2]

MultiBody & MultiBody::operator= ( MultiBody &&  _other)

Move.

◆ OrientationDOF()

size_t MultiBody::OrientationDOF ( ) const
noexcept

Get the number of orientational DOF for this multibody's base.

◆ PosDOF()

size_t MultiBody::PosDOF ( ) const
noexcept

Get the number of positional DOF for this multibody's base.

◆ PushToNearestValidConfiguration()

void MultiBody::PushToNearestValidConfiguration ( )

Check if the DOF values are out-of-range. If so, push them to the nearest acceptable configuration and reconfigure the model.

Note
In this context, 'valid' means with respect to the joint limits only. It does not consider collisions or any other validity.

◆ Read()

void MultiBody::Read ( std::istream &  _is,
CountingStreamBuffer _cbs 
)

Read a MultiBody from an input stream and compute information.

Parameters
_isThe input stream to read from.
_cbsCounting stream buffer

◆ SetBaseBody()

void MultiBody::SetBaseBody ( const size_t  _index)

Set the base body.

Parameters
_indexThe index of the body to use as the base.

◆ UpdateJointLimits()

void MultiBody::UpdateJointLimits ( )
noexcept

Update the DOF info from the current values in the connection objects. @TODO Fix this so that we do not double-store the limits both here and in connection.

◆ Write()

void MultiBody::Write ( std::ostream &  _os) const

Write the MultiBody to an output stream.

Parameters
_osThe output stream to write to.

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