# RigidBodyDynamics : velocity_range

I am trying to understand the relationship between v and q̇ using the functions that provide the Jacobians relating the two and I wonder if someone could explain the meaning of the required velocity ranges?

The docs say:

Return the range of indices into the joint velocity vector v corresponding to joint joint.


E.g. For the second joint in my robot I get:

julia> state.vranges[jointVector[2]]
2:2

julia> velocity_range(state, jointVector[2])
2:2


The range is a set of indices but I don’t understand how a one-dimensional joint can span more than one index at a time. The result is always a one-dimensional Jacobian J = 1.0 which seems to imply that v == q̇ for all my joints (none are planar). Use case: I am using RBD in a state-estimator and I need to compute a number of variables to compare with the corresponding measurements from sensors.

BTW: noticed in test_mechanism_algorithms.jl there was this, which looks like a typo in the arguments:

Jv_to_q̇_j = RigidBodyDynamics.velocity_to_configuration_derivative_jacobian(joint, qj)
Jq̇_to_v_j = RigidBodyDynamics.configuration_derivative_to_velocity_jacobian(joint, qj)


For the Prismatic and Revolute joint types, v = \dot{q}, but that’s not the case for the SinCosRevolute, Planar, QuaternionSpherical, QuaternionFloating, or SPQuatFloating joint types.

The planar, spherical, and floating joint types have multiple indices into the joint velocity vector associated with them. For type stability, the return type of velocity_range is always a UnitRange, even if a joint only has a single velocity variable associated with it (resulting in e.g. the 1-length velocity range 2 : 2 you were seeing).

No, the Jacobian for both mappings only depends on q. The mappings themselves also depend linearly on \dot{q} or v, depending on the direction. But since these dependencies are linear, \dot{q} and v are not needed as arguments for the Jacobian functions.

1 Like

Brilliant!! Very clear now. Many thanks for your help!!