Mechanisms
Index
RigidBodyDynamics.MechanismRigidBodyDynamics.Graphs.pathRigidBodyDynamics.attach!RigidBodyDynamics.attach!RigidBodyDynamics.bodiesRigidBodyDynamics.body_fixed_frame_definitionRigidBodyDynamics.body_fixed_frame_to_bodyRigidBodyDynamics.fixed_transformRigidBodyDynamics.in_jointsRigidBodyDynamics.joint_to_parentRigidBodyDynamics.jointsRigidBodyDynamics.joints_to_childrenRigidBodyDynamics.maximal_coordinatesRigidBodyDynamics.non_tree_jointsRigidBodyDynamics.num_positionsRigidBodyDynamics.num_velocitiesRigidBodyDynamics.out_jointsRigidBodyDynamics.parse_urdfRigidBodyDynamics.predecessorRigidBodyDynamics.rand_chain_mechanismRigidBodyDynamics.rand_floating_tree_mechanismRigidBodyDynamics.rand_tree_mechanismRigidBodyDynamics.rand_tree_mechanismRigidBodyDynamics.rebuild_spanning_tree!RigidBodyDynamics.remove_fixed_tree_joints!RigidBodyDynamics.remove_joint!RigidBodyDynamics.root_bodyRigidBodyDynamics.root_frameRigidBodyDynamics.submechanismRigidBodyDynamics.successorRigidBodyDynamics.tree_joints
The Mechanism type
RigidBodyDynamics.Mechanism — Type.type Mechanism{T<:Number}A Mechanism represents an interconnection of rigid bodies and joints. Mechanisms store the joint layout and inertia parameters, but no state-dependent information.
Creating and modifying Mechanisms
RigidBodyDynamics.parse_urdf — Function.parse_urdf(scalartype, filename)
Create a Mechanism by parsing a URDF file.
RigidBodyDynamics.attach! — Function.attach!(mechanism, predecessor, joint, jointToPredecessor, successor, successorToJoint)Attach successor to predecessor using joint.
See Joint for definitions of the terms successor and predecessor.
The Transform3Ds jointToPredecessor and successorToJoint define where joint is attached to each body. jointToPredecessor should define frame_before(joint) with respect to any frame fixed to predecessor, and likewise successorToJoint should define any frame fixed to successor with respect to frame_after(joint).
predecessor is required to already be among the bodies of the Mechanism.
If successor is not yet a part of the Mechanism, it will be added to the Mechanism. Otherwise, the joint will be treated as a non-tree edge in the Mechanism, effectively creating a loop constraint that will be enforced using Lagrange multipliers (as opposed to using recursive algorithms).
RigidBodyDynamics.attach! — Function.attach!(mechanism, parentbody, childmechanism, childroot_to_parent)
attach!(mechanism, parentbody, childmechanism)
Attach a copy of childmechanism to mechanism. Return mappings from the bodies and joints of the childmechanism to the bodies and joints that were added to mechanism.
Essentially replaces the root body of a copy of childmechanism with parentbody (which belongs to mechanism).
Note: gravitational acceleration for childmechanism is ignored.
RigidBodyDynamics.maximal_coordinates — Method.maximal_coordinates(mechanism)
Return a dynamically equivalent Mechanism, but with a flat tree structure with all bodies attached to the root body with a quaternion floating joint, and with the 'tree edge' joints of the input Mechanism transformed into non-tree edge joints (a constraint enforced using Lagrange multipliers in dynamics!). In addition, return:
a mapping from bodies in the maximal-coordinate
Mechanismto their floating joints.a mapping from bodies in the input
Mechanismto bodies in the returnedMechanisma mapping from joints in the input
Mechanismto joints in the returnedMechanism
RigidBodyDynamics.rand_chain_mechanism — Method.rand_chain_mechanism(t, jointTypes)
Create a random chain Mechanism with the given joint types.
rand_floating_tree_mechanism(t, nonFloatingJointTypes)
Create a random tree Mechanism, with a quaternion floating joint as the first joint (between the root body and the first non-root body).
RigidBodyDynamics.rand_tree_mechanism — Method.rand_tree_mechanism(?, parentselector, jointTypes)
Create a random tree Mechanism with the given joint types. Each new body is attached to a parent selected using the parentselector function.
RigidBodyDynamics.rand_tree_mechanism — Method.rand_tree_mechanism(t, jointTypes)
Create a random tree Mechanism.
remove_fixed_tree_joints!(mechanism)
Remove any fixed joints present as tree edges in mechanism by merging the rigid bodies that these fixed joints join together into bodies with equivalent inertial properties. Return the fixed joints that were removed.
RigidBodyDynamics.remove_joint! — Function.remove_joint!(mechanism, joint)
remove_joint!(mechanism, joint, spanning_tree_next_edge)
Remove a joint from the mechanism. Rebuilds the spanning tree if the joint is part of the current spanning tree.
RigidBodyDynamics.submechanism — Method.submechanism(mechanism, submechanismroot)
Create a new Mechanism from the subtree of mechanism rooted at submechanismroot.
Also return mappings from the bodies and joints of the input mechanism to the bodies and joints of the submechanism.
Any non-tree joint in mechanism will appear in the returned Mechanism if and only if both its successor and its predecessor are part of the subtree.
RigidBodyDynamics.rebuild_spanning_tree! — Function.rebuild_spanning_tree!(mechanism, next_edge)
rebuild_spanning_tree!(mechanism)
Reconstruct the mechanism's spanning tree.
Basic functionality
RigidBodyDynamics.Graphs.path — Method.path(mechanism, from, to)
Return the path from rigid body from to to along edges of the Mechanism's kinematic tree.
RigidBodyDynamics.bodies — Method.bodies(mechanism)
Return the RigidBodys that are part of the Mechanism as an iterable collection.
RigidBodyDynamics.fixed_transform — Method.fixed_transform(mechanism, from, to)
Return the transform from CartesianFrame3D from to to, both of which are rigidly attached to the same RigidBody.
Note: this function is linear in the number of bodies and is not meant to be called in tight loops.
RigidBodyDynamics.in_joints — Method.in_joints(body, mechanism)
Return the joints that have body as their successor.
RigidBodyDynamics.joint_to_parent — Method.joint_to_parent(body, mechanism)
Return the joint that is part of the mechanism's kinematic tree and has body as its successor.
RigidBodyDynamics.joints — Method.joints(mechanism)
Return the Joints that are part of the Mechanism as an iterable collection.
RigidBodyDynamics.joints_to_children — Method.joints_to_children(body, mechanism)
Return the joints that are part of the mechanism's kinematic tree and have body as their predecessor.
RigidBodyDynamics.num_positions — Method.num_positions(mechanism)
Return the dimension of the joint configuration vector $q$.
RigidBodyDynamics.num_velocities — Method.num_velocities(mechanism)
Return the dimension of the joint velocity vector $v$.
RigidBodyDynamics.out_joints — Method.out_joints(body, mechanism)
Return the joints that have body as their predecessor.
RigidBodyDynamics.predecessor — Method.predecessor(joint, mechanism)
Return the body 'before' the joint, i.e. the 'tail' of the joint interpreted as an arrow in the Mechanism's kinematic graph.
See Joint.
RigidBodyDynamics.root_body — Method.root_body(mechanism)
Return the root (stationary 'world') body of the Mechanism.
RigidBodyDynamics.root_frame — Method.root_frame(mechanism)
Return the default frame of the root body.
RigidBodyDynamics.successor — Method.successor(joint, mechanism)
Return the body 'after' the joint, i.e. the 'head' of the joint interpreted as an arrow in the Mechanism's kinematic graph.
See Joint.
RigidBodyDynamics.tree_joints — Method.tree_joints(mechanism)
Return the Joints that are part of the Mechanism's spanning tree as an iterable collection.
body_fixed_frame_definition(mechanism, frame)
Return the definition of body-fixed frame frame, i.e., the Transform3D from frame to the default frame of the body to which it is attached.
Note: this function is linear in the number of bodies and is not meant to be called in tight loops.
See also default_frame, frame_definition.
body_fixed_frame_to_body(mechanism, frame)
Return the RigidBody to which frame is attached.
Note: this function is linear in the number of bodies and is not meant to be called in tight loops.
RigidBodyDynamics.non_tree_joints — Method.non_tree_joints(mechanism)
Return the Joints that are not part of the Mechanism's spanning tree as an iterable collection.