A popular approach to modeling rigid-body systems is to describe the system in terms of its component parts via a system model. See Chapter 4 of Rigid Body Dynamics Algorithms for more details on modeling rigid-body systems. This project supports three types of system models:
RigidBodyTreeModel
: The classic system model using in Rigid Body Dynamics Algorithms wherein the nodes of the connectivity graph representing the system model are the individual rigid-bodies in the system and the arcs of the graph represent the joints connecting the bodies. The model is capable of representing arbitrary rigid-body systems, including systems with loop constraints such as those induced by actuation sub-mechanisms. However, recursive algorithms can only be applied to this model if it is a kinematic tree (i.e., no loops).ReflectedInertiaTreeModel
: A system model that is similar to theRigidBodyTreeModel
in that the nodes of the connectivity graph representing the system model are the individual rigid-bodies in the system and the arcs of the graph represent the joints connecting the bodies. However, the model is only capable of representing kinematic trees (i.e., no loops). The dynamic effects of any loop constraints must be approximated via reflected inertia. This model works reasonably well for systems with geared transmissions, but typically has poor accuracy otherwise.ClusterTreeModel
: This system model is based on the concept of Local Constraint Embedding. The nodes of this connectivity graph represent collections of rigid-bodies related to one another by a loop constraint. These collections are referred to as clusters. The arcs of the graph represent the joints connecting the clusters, referred to as cluster joints. This model is capable of representing arbitrary rigid-body systems, including systems with loop constraints. Because all cluster connectivity graphs are kinematic trees (no loops in the graph), recursive algorithms can always be applied to this model.
All three system models have connectivity tree structures and thus derive from a common base class, TreeModel
.
The first two models are included for benchmarking purposes and are not recommended for general use.
This project does not currently offer support for URDF parsing, so the model has to be constructed manually.
The process for constructing a ClusterTreeModel
proceeds as follows:
- Register all of the bodies contained in a cluster using the
ClusterTreeModel::registerBody
function for each of the bodies.- Function parameters:
name
: A unique name for the body.inertia
: Spatial inertia of the body.parent_name
: The name of the parent body.Xtree
: The tree transforms between the body and its parent. See Chapter 4.2 of Rigid Body Dynamics Algorithms for more details.
- Function parameters:
- Append those bodies to the model using the
ClusterTreeModel::appendRegisteredBodiesAsCluster
function.- Function templates:
ClusterJointType
: The type of generalized joint connecting the bodies in the cluster. See Cluster Joints for more details.... Args
: Variadic template for the arguments to the constructor of theClusterJointType
.
- Function parameters:
name
: A unique name for the cluster.... args
: Arguments to the constructor of theClusterJointType
.
- Function templates:
- NOTE: In cases where the cluster contains a single body, the two steps above can be combined using the
ClusterTreeModel::appendBody
function.- Function templates:
ClusterJointType
: The type of generalized joint connecting the bodies in the cluster.... Args
: Variadic template for the arguments to the constructor of theClusterJointType
.
- Function parameters:
name
: A unique name for the cluster.inertia
: Spatial inertia of the body.parent_name
: The name of the parent body.Xtree
: The tree transforms between the body and its parent.... args
: Arguments to the constructor of theClusterJointType
.
- Function templates:
RigidBodyTree
and ReflectedInertiaTree
models are constructed automatically from ClusterTreeModel
s.
For example, consider the following system model:
Constructing this model would involve the following steps:
- Append Body
$B_1$ by callingClusterTreeModel::appendBody
usingGeneralizedJoint::Revolute
as theGenJointType
template - Append Body
$B_2$ by callingClusterTreeModel::appendBody
usingGeneralizedJoint::Revolute
as theGenJointType
template - Register bodies
$B_3$ ,$B_4$ , and$B_5$ usingClusterTreeModel::registerBody
. Append them as a cluster usingClusterTreeModel::appendRegisteredBodiesAsCluster
withGeneralizedJoint::Generic
as theGenJointType
template. (Note that the generic joint must be used in this case because we have not yet implemented a specialized class for dealing with four bar linkages.) - Append Body
$B_6$ by callingClusterTreeModel::appendBody
usingGeneralizedJoint::Revolute
as theGenJointType
template