public class KinematicTree
extends java.lang.Object
Each body node corresponds to a single ConnectableBody which is
also a cut vertex of a graph in which the bodies are vertices and the
constrainers connecting them are edges. Each joint node corresponds to the
sub-graph of bodies and constrainers separated by the body nodes (i.e., cut
vertices). This arrangement means that setting coordinates values for the
joints within a joint node can be done independently of the constrainers in
the other joint nodes, which allows the setting of coordinate values for
different joints in the tree to be done in a computationally efficient way.
In the simplest case, a joint node contains a single joint or constraint and will then have a single child node and connect the two bodies associated with its parent and child nodes. The joint's coordinates, if present, will uniquely determine the pose of the child body relative to the parent. In more complex cases, a joint node may contain multiple joints and/or constraints and joint coordinates within the node may not be independent. An iterative solve procedure must then be used to determine the coordinate values that result from setting one or more coordinates within the node. This procedure will also determine the poses of the child bodies with respect to the parent.
Where appropriate, the tree's root node is set to represent the
structures least mobile body. This will be ground if the structure is
actually connected to ground; otherwise, other rules are used to determined
the root node as specified in the documentation for findRootNode(java.util.List<artisynth.core.mechmodels.KinematicTree.JointNode>, java.util.HashMap<artisynth.core.mechmodels.ConnectableBody, artisynth.core.mechmodels.KinematicTree.BodyInfo>).
| Modifier and Type | Field and Description |
|---|---|
static boolean |
debug |
static RigidBody |
Ground
Special rigid body instance representing ground.
|
| Constructor and Description |
|---|
KinematicTree()
Create an empty kinematic tree.
|
KinematicTree(artisynth.core.mechmodels.KinematicTree.BodyNode root)
Create a tree based on a specific root node.
|
| Modifier and Type | Method and Description |
|---|---|
static KinematicTree |
findTree(BodyConnector bcon,
java.util.Collection<? extends Constrainer> extraConstrainers)
Finds the kinematic tree associated with a given body connector.
|
static KinematicTree |
findTree(ConnectableBody body,
java.util.Collection<? extends Constrainer> extraConstrainers)
Finds the kinematic tree associated with a given body.
|
static java.util.List<KinematicTree> |
findTreesForBodies(java.util.Collection<? extends ConnectableBody> bodies,
java.util.Collection<ConstrainerBase> extraConstrainers)
Finds all the kinematic trees associated with a set of bodies.
|
java.util.ArrayList<ConnectableBody> |
getBodies()
Get a list of all the bodies in this tree.
|
artisynth.core.mechmodels.KinematicTree.BodyNode |
getRoot()
Queries the root node of this tree.
|
public static final RigidBody Ground
public static boolean debug
public KinematicTree()
public KinematicTree(artisynth.core.mechmodels.KinematicTree.BodyNode root)
public artisynth.core.mechmodels.KinematicTree.BodyNode getRoot()
public java.util.ArrayList<ConnectableBody> getBodies()
public static KinematicTree findTree(ConnectableBody body, java.util.Collection<? extends Constrainer> extraConstrainers)
public static KinematicTree findTree(BodyConnector bcon, java.util.Collection<? extends Constrainer> extraConstrainers)
public static java.util.List<KinematicTree> findTreesForBodies(java.util.Collection<? extends ConnectableBody> bodies, java.util.Collection<ConstrainerBase> extraConstrainers)