Parasol Planning Library (PPL)
Chain Class Referencefinal

#include <Chain.h>

Public Types

Local Types
typedef std::deque< const Connection * > JointList
 
typedef JointList::const_iterator iterator
 

Public Member Functions

Modifiers

All modifiers return a self-reference for easy function chaining (bad pun intended).

ChainReverse () noexcept
 Reverse the traversal order of this chain. More...
 
ChainAppend (const Chain &_other) noexcept
 
Iteration

Iterate over the bodies in the chain in traversal order.

iterator begin () const noexcept
 
iterator end () const noexcept
 
Queries
const BodyGetFrontBody () const noexcept
 
const BodyGetBackBody () const noexcept
 
const ConnectionGetFirstJoint () const noexcept
 Get the first joint. More...
 
const ConnectionGetLastJoint () const noexcept
 Get the last joint. More...
 
bool IsForward () const noexcept
 Is this chain oriented in the same way as the multibody? More...
 
size_t GetNumJoints () const noexcept
 Get the number of joints in the chain. More...
 
size_t Size () const noexcept
 Get the number of objects in the chain (joints and bodies). More...
 
bool IsSingleLink () const noexcept
 Check if the current chain has only one link. More...
 

Generation

Methods for generating chains of a multibody.

static std::vector< ChainDecompose (const MultiBody *const _mb)
 
std::pair< Chain, ChainBisect () const noexcept
 

Detailed Description

A chain represents some subset of a linked multibody. It defines a set of joints, traversal ordering (relative to the multibody base), and possibly a front and/or back body. It must contain at least one link between the front/back bodies and joints.

For multibodies with branchings and/or closures, Decompose will return a Chain for each linear segment. Splitting joints (where the multibody has been broken into chains) are repeated so that it is clear where chains connect (also true for bisect).

This object assumes that the represented multibody will not change structure. If it does, any chains built from the previous version will likely be invalid.

Member Typedef Documentation

◆ iterator

typedef JointList::const_iterator Chain::iterator

◆ JointList

typedef std::deque<const Connection*> Chain::JointList

Member Function Documentation

◆ Append()

Chain & Chain::Append ( const Chain _other)
noexcept

Merge another chain into this one. The two chains must have the same traversal order, and the other chain's root must be connected to this chain's end.

Parameters
_otherThe chain to append to this one.

◆ begin()

Chain::iterator Chain::begin ( ) const
noexcept

◆ Bisect()

std::pair< Chain, Chain > Chain::Bisect ( ) const
noexcept

Bisect this chain to produce two subchains which both contain the splitting joint. Their order will be the same as this. If this chain has an odd number of joints, the first subchain will take the extra one.

◆ Decompose()

std::vector< Chain > Chain::Decompose ( const MultiBody *const  _mb)
static

Decompose a multibody into a set of linear chains. Splitting joints will be present in each chain that contains them.

Parameters
_mbThe multibody to decompose.
Returns
A set of Chains representing linear subsets of _mb.
Todo:
Expand to support joints with more than one forward or backward connection. For now we only support chain robots.

◆ end()

Chain::iterator Chain::end ( ) const
noexcept

◆ GetBackBody()

const Body * Chain::GetBackBody ( ) const
noexcept

Get the body at the back of the chain (w.r.t. traversal order). Will be null if this chain ends with a joint.

◆ GetFirstJoint()

const Connection * Chain::GetFirstJoint ( ) const
noexcept

Get the first joint.

◆ GetFrontBody()

const Body * Chain::GetFrontBody ( ) const
noexcept

Get the body at the front of the chain (w.r.t. traversal order). Will be null if this chain begins with a joint.

◆ GetLastJoint()

const Connection * Chain::GetLastJoint ( ) const
noexcept

Get the last joint.

◆ GetNumJoints()

size_t Chain::GetNumJoints ( ) const
noexcept

Get the number of joints in the chain.

◆ IsForward()

bool Chain::IsForward ( ) const
noexcept

Is this chain oriented in the same way as the multibody?

◆ IsSingleLink()

bool Chain::IsSingleLink ( ) const
noexcept

Check if the current chain has only one link.

◆ Reverse()

Chain & Chain::Reverse ( )
noexcept

Reverse the traversal order of this chain.

◆ Size()

size_t Chain::Size ( ) const
noexcept

Get the number of objects in the chain (joints and bodies).


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