mechanisms.components.storage

Storage components: springs with an energy V(y) ≥ 0 and the force f = −∂V/∂y.

The deflection is y = x − x_ref, so a spring pulls x towards x_ref. Gains are Params: stage scope (live) for stiffnesses and shapes, episode for limits and exponents.

Classes

ContactSpring(coord, stiffness[, smoothing])

One-sided spring on a signed distance d: pushes out only when d < 0 (contact).

GaussianSpring(coord, strength, sigma)

Repulsive Gaussian, V = A σ² exp(−‖y‖²/2σ²) and f = A exp(−‖y‖²/2σ²) y.

Gravity(robot[, gravity])

Gravity on a robot's point masses: V = −Σ m_i gᵀ p_i, f_i = m_i g (a physical component).

LimitSpring(coord, stiffness, lower, upper)

Zero force inside [lower, upper] and linear outside, per axis (a joint-limit spring).

LinearSpring(coord, stiffness)

Linear spring, V = ½ yᵀ K y and f = −K y.

PolynomialSpring(coord, stiffness, order, ...)

Spring with stiffness k = K (d / d₀)^n: f = −k y, V = K d^(n+2) / ((n+2) d₀ⁿ).

SigmoidSpring(coord, k_min, k_max, ...[, ...])

Spring stiffening with distance: f = −k(d) y, k(d) = k_min + (k_max − k_min) σ(α(d − d₀)).

TanhSpring(coord, stiffness, max_force)

Saturating spring, per axis: f = −F tanh(k y / F), within ±F on each axis.