physics.robotics.kinematics
physics.robotics.kinematics
Manipulator kinematics: the Jacobian’s conditioning and damped inverse kinematics (added 2026-10-20).
Functions
| Name | Description |
|---|---|
| calc_dls_joint_rate | Calculate damped joint rate along one Jacobian singular direction. |
| calc_two_link_singular_values | Calculate planar two-link Jacobian singular values. |
calc_dls_joint_rate
physics.robotics.kinematics.calc_dls_joint_rate(
tool_speed,
singular_value,
damping,
)Calculate damped joint rate along one Jacobian singular direction.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| tool_speed | Quantity | Tool speed along the selected direction in meters per second. | required |
| singular_value | Quantity | Nonnegative Jacobian singular value, represented in meters with radians dimensionless. | required |
| damping | Quantity | Nonnegative damping length in meters; it and singular_value cannot both be zero. | required |
Returns
| Name | Type | Description |
|---|---|---|
| tuple | (joint rate in rad/s, realized fraction of the tool motion). |
Notes
Equation: qdot = v sigma/(sigma**2 + damping**2); motion fraction = sigma**2/(sigma**2 + damping**2).
Damped least squares minimizes ||J qdot - v||^2 + lambda^2 ||qdot||^2; along a singular direction with value sigma its gain is
qdot / v = sigma / (sigma^2 + lambda^2) <= 1 / (2 lambda),
with the bound reached at sigma = lambda, and it realizes the fraction sigma^2 / (sigma^2 + lambda^2) of the requested tool motion. With damping zero the gain is the exact inverse, 1 / sigma.
Assumptions: One singular direction and a nonzero denominator; valid nonnegative inputs are caller responsibilities.
Excludes: Joint saturation, full inverse-kinematics iteration, obstacle avoidance, and safety certification.
References
Derivation: Differentiate the scalar regularized least-squares objective to obtain the damped inverse gain.
Wampler, C. W. (1986), Manipulator inverse kinematic solutions based on vector formulations and damped least-squares methods, IEEE Trans. SMC 16(1); Nakamura, Y. and Hanafusa, H. (1986), ASME J. Dyn. Syst.
Examples
>>> rate, share = calc_dls_joint_rate(1 * ureg.meter / ureg.second, 1 * ureg.meter, 1 * ureg.meter)
>>> bool(rate.to("radian/second").magnitude == share)
Truecalc_two_link_singular_values
physics.robotics.kinematics.calc_two_link_singular_values(
upper_arm,
forearm,
elbow_angle,
)Calculate planar two-link Jacobian singular values.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| upper_arm | Quantity | First link length in meters; positive physical lengths are assumed. | required |
| forearm | Quantity | Second link length in meters; positive physical lengths are assumed. | required |
| elbow_angle | Quantity | Elbow angle in angular units, converted to radians. | required |
Returns
| Name | Type | Description |
|---|---|---|
| tuple of Quantity | (sigma_max, sigma_min) in meters per radian of joint motion. |
Notes
Equation: sigma_i = sqrt(eigenvalue_i(J.T J)); det J = l1 l2 sin(q2).
The Jacobian maps joint rates (q1dot, q2dot) to tool velocity (x, y):
J = [[-l1 sin q1 - l2 sin(q1+q2), -l2 sin(q1+q2)],
[ l1 cos q1 + l2 cos(q1+q2), l2 cos(q1+q2)]],
and its singular values depend on q2 only (q1 rotates the whole picture), so q1 = 0 here. det J = l1 l2 sin q2, so the smaller singular value falls to zero as the elbow straightens: the singular pose. A tool speed v in the weakest direction needs a joint-rate vector of norm v / sigma_min.
Assumptions: A rigid planar two-revolute-joint arm; shoulder rotation changes orientation but not singular values.
Excludes: Joint limits, compliance, collision geometry, and safety certification.
References
Derivation: Compute the two eigenvalues of the symmetric matrix J.T J from its trace and determinant, clipping roundoff below zero.
Lynch, K. M. and Park, F. C., Modern Robotics (2017), ch. 5.
Examples
>>> largest, smallest = calc_two_link_singular_values(1 * ureg.meter, 1 * ureg.meter, 0 * ureg.radian)
>>> bool(largest > smallest and smallest == 0 * ureg.meter)
True