MechanismState

Index

The MechanismState type

immutable MechanismState{X<:Number, M<:Number, C<:Number}

A MechanismState stores state information for an entire Mechanism. It contains the joint configuration and velocity vectors $q$ and $v$, as well as cache variables that depend on $q$ and $v$ and are aimed at preventing double work.

Type parameters:

  • X: the scalar type of the $q$ and $v$ vectors.

  • M: the scalar type of the Mechanism

  • C: the scalar type of the cache variables (== promote_type(X, M))

source

Functions

configuration(state, joint)

Return the part of the configuration vector $q$ associated with joint.

source
configuration(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.

source
global_coordinates!(state, q0, ϕ)

Convert local coordinates $phi$ centered around $q_0$ to (global) configuration vector $q$.

source
local_coordinates!(state, ϕ, ϕd, q0)

Compute local coordinates $phi$ centered around (global) configuration vector $q_0$, as well as their time derivatives $\dot{\phi}$.

source
num_positions(state)

Return the length of the joint configuration vector $q$.

source
num_velocities(state)

Return the length of the joint velocity vector $v$.

source
rand_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.

source
rand_velocity!(state)

Randomize the velocity vector $v$. Invalidates cache variables.

source
relative_transform(state, from, to)

Return the homogeneous transform from from to to.

source
relative_twist(state, bodyFrame, baseFrame)

Return the twist of bodyFrame with respect to baseFrame, expressed in the Mechanism's root frame.

source
relative_twist(state, body, base)

Return the twist of body with respect to base, expressed in the Mechanism's root frame.

source
set_configuration!(state, q)

Set the configuration vector $q$. Invalidates cache variables.

source
set_configuration!(state, joint, q)

Set the part of the configuration vector associated with joint. Invalidates cache variables.

source
set_velocity!(state, v)

Set the velocity vector $v$. Invalidates cache variables.

source
set_velocity!(state, joint, v)

Set the part of the velocity vector associated with joint. Invalidates cache variables.

source
setdirty!(state)

Invalidate all cache variables.

source
velocity(state, joint)

Return the part of the velocity vector $v$ associated with joint.

source
velocity(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.

source
zero!(state)

Zero both the configuration and velocity. Invalidates cache variables.

See zero_configuration!, zero_velocity!.

source
zero_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.

source
zero_velocity!(state)

Zero the velocity vector $v$. Invalidates cache variables.

source
Base.Random.rand!Method.
rand!(state)

Randomize both the configuration and velocity. Invalidates cache variables.

source
non_tree_joints(state)

Return the Joints that are not part of the underlying Mechanism's spanning tree as an iterable collection.

source