MechanismState
Index
RigidBodyDynamics.MechanismStateBase.copyto!Base.copyto!Base.copyto!Random.rand!RigidBodyDynamics.additional_stateRigidBodyDynamics.bias_accelerationRigidBodyDynamics.bias_accelerationRigidBodyDynamics.configurationRigidBodyDynamics.configurationRigidBodyDynamics.configuration_index_to_joint_idRigidBodyDynamics.configuration_rangeRigidBodyDynamics.constraint_rangeRigidBodyDynamics.crb_inertiaRigidBodyDynamics.global_coordinates!RigidBodyDynamics.gravitational_potential_energyRigidBodyDynamics.joint_transformRigidBodyDynamics.local_coordinates!RigidBodyDynamics.normalize_configuration!RigidBodyDynamics.num_additional_statesRigidBodyDynamics.num_positionsRigidBodyDynamics.num_velocitiesRigidBodyDynamics.principal_value!RigidBodyDynamics.rand_configuration!RigidBodyDynamics.rand_velocity!RigidBodyDynamics.relative_transformRigidBodyDynamics.relative_twistRigidBodyDynamics.relative_twistRigidBodyDynamics.reset_contact_state!RigidBodyDynamics.set_additional_state!RigidBodyDynamics.set_configuration!RigidBodyDynamics.set_configuration!RigidBodyDynamics.set_velocity!RigidBodyDynamics.set_velocity!RigidBodyDynamics.setdirty!RigidBodyDynamics.spatial_inertiaRigidBodyDynamics.supportsRigidBodyDynamics.transform_to_rootRigidBodyDynamics.twistRigidBodyDynamics.twist_wrt_worldRigidBodyDynamics.velocityRigidBodyDynamics.velocityRigidBodyDynamics.velocity_index_to_joint_idRigidBodyDynamics.velocity_rangeRigidBodyDynamics.zero!RigidBodyDynamics.zero_configuration!RigidBodyDynamics.zero_velocity!
The MechanismState type
RigidBodyDynamics.MechanismState — Typestruct MechanismState{X, M, C, JointCollection}A MechanismState stores state information for an entire Mechanism. It contains the joint configuration and velocity vectors $q$ and $v$, and a vector of additional states $s$. In addition, it stores cache variables that depend on $q$ and $v$ and are aimed at preventing double work.
Type parameters:
X: the scalar type of the $q$, $v$, and $s$ vectors.M: the scalar type of theMechanismC: the scalar type of the cache variables (== promote_type(X, M))JointCollection: the type of thetreejointsandnontreejointsmembers (aTypeSortedCollectionsubtype)
Functions
Base.copyto! — Methodcopyto!(dest, src)
Copy state information in state dest to vector src (ordered [q; v; s]).
Base.copyto! — Methodcopyto!(dest, src)
Copy state information in vector src (ordered [q; v; s]) to state dest.
Base.copyto! — Methodcopyto!(dest, src)
Copy (minimal representation of) state src to state dest.
Random.rand! — Methodrand!(state)
Randomize both the configuration and velocity. Invalidates cache variables.
RigidBodyDynamics.additional_state — Methodadditional_state(state)
Return the vector of additional states $s$.
RigidBodyDynamics.bias_acceleration — Functionbias_acceleration(state, joint)
bias_acceleration(state, joint, safe)
Return the bias acceleration across the given joint, i.e. the spatial acceleration of frame_after(joint) with respect to frame_before(joint), expressed in the root frame of the mechanism when all joint accelerations are zero.
RigidBodyDynamics.bias_acceleration — Functionbias_acceleration(state, body)
bias_acceleration(state, body, safe)
Return the bias acceleration of the given body with respect to the world, i.e. the spatial acceleration of default_frame(body) with respect to the root frame of the mechanism, expressed in the root frame, when all joint accelerations are zero.
RigidBodyDynamics.configuration — Methodconfiguration(state, joint)
Return the part of the configuration vector $q$ associated with joint.
RigidBodyDynamics.configuration — Methodconfiguration(state)
Return the configuration vector $q$.
Note that this returns a reference to the underlying data in state. The user is responsible for calling setdirty! after modifying this vector to ensure that dependent cache variables are invalidated.
RigidBodyDynamics.configuration_index_to_joint_id — Methodconfiguration_index_to_joint_id(state, qindex)
Return the JointID of the joint associated with the given index into the configuration vector $q$.
RigidBodyDynamics.configuration_range — Methodconfiguration_range(state, joint)
Return the range of indices into the joint configuration vector $q$ corresponding to joint joint.
RigidBodyDynamics.constraint_range — Methodconstraint_range(state, joint)
Return the range of row indices into the constraint Jacobian corresponding to joint joint.
RigidBodyDynamics.crb_inertia — Functioncrb_inertia(state, body)
crb_inertia(state, body, safe)
Return the composite rigid body inertia body expressed in the root frame of the mechanism.
RigidBodyDynamics.global_coordinates! — Methodglobal_coordinates!(state, q0, ϕ)
Convert local coordinates $\phi$ centered around $q_0$ to (global) configuration vector $q$.
RigidBodyDynamics.gravitational_potential_energy — Functiongravitational_potential_energy(state, body)
gravitational_potential_energy(state, body, safe)
Return the gravitational potential energy in the given state, computed as the negation of the dot product of the gravitational force and the center of mass expressed in the Mechanism's root frame.
RigidBodyDynamics.joint_transform — Functionjoint_transform(state, joint)
joint_transform(state, joint, safe)
Return the joint transform for the given joint, i.e. the transform from frame_after(joint) to frame_before(joint).
RigidBodyDynamics.local_coordinates! — Methodlocal_coordinates!(ϕ, ϕd, state, q0)
Compute local coordinates $\phi$ centered around (global) configuration vector $q_0$, as well as their time derivatives $\dot{\phi}$.
RigidBodyDynamics.normalize_configuration! — Methodnormalize_configuration!(state)
Project the configuration vector $q$ onto the configuration manifold.
For example:
- for a part of $q$ corresponding to a revolute joint, this method is a no-op;
- for a part of $q$ corresponding to a spherical joint that uses a unit quaternion
to parameterize the orientation of its successor with respect to its predecessor, normalize_configuration! will renormalize the quaternion so that it is indeed of unit length.
This method does not ensure that the configuration or velocity satisfy joint configuration or velocity limits/bounds.
RigidBodyDynamics.num_additional_states — Methodnum_additional_states(state)
Return the length of the vector of additional states $s$ (currently used for stateful contact models).
RigidBodyDynamics.num_positions — Methodnum_positions(state)
Return the length of the joint configuration vector $q$.
RigidBodyDynamics.num_velocities — Methodnum_velocities(state)
Return the length of the joint velocity vector $v$.
RigidBodyDynamics.principal_value! — Methodprincipal_value!(state)
Applies the principalvalue functions from [Rotations.jl](https://github.com/FugroRoames/Rotations.jl/blob/d080990517f89b56c37962ad53a7fd24bd94b9f7/src/principalvalue.jl) to joint angles. This currently only applies to SPQuatFloating joints.
For example:
- for a part of $q$ corresponding to a revolute joint, this method is a no-op;
- for a part of $q$ corresponding to a
SPQuatFloatingjoint this function applies
`principal_value the orientation.
RigidBodyDynamics.rand_configuration! — Methodrand_configuration!(state)
Randomize the configuration vector $q$. The distribution depends on the particular joint types present in the associated Mechanism. The resulting $q$ is guaranteed to be on the Mechanism's configuration manifold. Invalidates cache variables.
RigidBodyDynamics.rand_velocity! — Methodrand_velocity!(state)
Randomize the velocity vector $v$. Invalidates cache variables.
RigidBodyDynamics.relative_transform — Methodrelative_transform(state, from, to)
Return the homogeneous transform from from to to.
RigidBodyDynamics.relative_twist — Methodrelative_twist(state, body_frame, base_frame)
Return the twist of body_frame with respect to base_frame, expressed in the Mechanism's root frame.
RigidBodyDynamics.relative_twist — Methodrelative_twist(state, body, base)
Return the twist of body with respect to base, expressed in the Mechanism's root frame.
RigidBodyDynamics.reset_contact_state! — Methodreset_contact_state!(state)
Reset all contact state variables.
RigidBodyDynamics.set_additional_state! — Methodset_additional_state!(state, s)
Set the vector of additional states $s$.
RigidBodyDynamics.set_configuration! — Methodset_configuration!(state, q)
Set the configuration vector $q$. Invalidates cache variables.
RigidBodyDynamics.set_configuration! — Methodset_configuration!(state, joint, config)
Set the part of the configuration vector associated with joint. Invalidates cache variables.
RigidBodyDynamics.set_velocity! — Methodset_velocity!(state, v)
Set the velocity vector $v$. Invalidates cache variables.
RigidBodyDynamics.set_velocity! — Methodset_velocity!(state, joint, vel)
Set the part of the velocity vector associated with joint. Invalidates cache variables.
RigidBodyDynamics.setdirty! — Methodsetdirty!(state)
Invalidate all cache variables.
RigidBodyDynamics.spatial_inertia — Functionspatial_inertia(state, body)
spatial_inertia(state, body, safe)
Return the spatial inertia of body expressed in the root frame of the mechanism.
RigidBodyDynamics.supports — Methodsupports(joint, body, state)
Return whether joint supports body, i.e., joint is a tree joint on the path between body and the root.
RigidBodyDynamics.transform_to_root — Functiontransform_to_root(state, body)
transform_to_root(state, body, safe)
Return the transform from default_frame(body) to the root frame of the mechanism.
RigidBodyDynamics.twist — Functiontwist(state, joint)
twist(state, joint, safe)
Return the joint twist for the given joint, i.e. the twist of frame_after(joint) with respect to frame_before(joint), expressed in the root frame of the mechanism.
RigidBodyDynamics.twist_wrt_world — Functiontwist_wrt_world(state, body)
twist_wrt_world(state, body, safe)
Return the twist of default_frame(body) with respect to the root frame of the mechanism, expressed in the root frame.
RigidBodyDynamics.velocity — Methodvelocity(state, joint)
Return the part of the velocity vector $v$ associated with joint.
RigidBodyDynamics.velocity — Methodvelocity(state)
Return the velocity vector $v$.
Note that this function returns a read-write reference to a field in state. The user is responsible for calling setdirty! after modifying this vector to ensure that dependent cache variables are invalidated.
RigidBodyDynamics.velocity_index_to_joint_id — Methodvelocity_index_to_joint_id(state, qindex)
Return the JointID of the joint associated with the given index into the velocity vector $v$.
RigidBodyDynamics.velocity_range — Methodvelocity_range(state, joint)
Return the range of indices into the joint velocity vector $v$ corresponding to joint joint.
RigidBodyDynamics.zero! — Methodzero!(state)
Zero both the configuration and velocity. Invalidates cache variables.
RigidBodyDynamics.zero_configuration! — Methodzero_configuration!(state)
'Zero' the configuration vector $q$. Invalidates cache variables.
Note that when the Mechanism contains e.g. quaternion-parameterized joints, $q$ may not actually be set to all zeros; the quaternion part of the configuration vector would be set to identity. The contract is that each of the joint transforms should be an identity transform.
RigidBodyDynamics.zero_velocity! — Methodzero_velocity!(state)
Zero the velocity vector $v$. Invalidates cache variables.