Constraints

Length constraints use tendons

A straight length constraint is a spatial tendon with two sites. Use World::addSpatialTendon for hard limits, a length lock, springs, or commanded tension. Routed cables and fixed joint transmissions use the same properties, solver, inspection, rendering, checkpoint, and removal interfaces. See Tendons, Tendon code examples, and Tendon physics.

Migrating the former wire API

The C++ and Python addStiffWire, addCompliantWire, addCustomWire, getWire, getWires, and LengthConstraint types have been removed. Use addSpatialTendon, getTendon, getTendons, and removeTendon. Recompile applications and bindings against matching headers and libraries.

Configure a two-site Tendon with target length L

Former behavior

Tendon properties or command

Stiff, stretch only

upperLimit = L

Stiff, compression only

lowerLimit = L

Stiff, both directions

lowerLimit = upperLimit = L

Compliant, stretch only

stiffness = k; springLower = 0; springUpper = L

Compliant, compression only

stiffness = k; springLower = L; springUpper = +infinity

Compliant, both directions

stiffness = k; springLower = springUpper = L

Custom tension

tendon->setTension(T); positive T pulls

Other properties keep their defaults in this table. A spring interval imposes no hard bound. Add limits explicitly if the model needs both elasticity and a maximum or minimum length. getLength() reports the current transmission coordinate; the configured target is in getProperties(). Call updateGeometry() after manually changing object positions before reading it. getTension() is a signed scalar, positive in tension. getForce() has the opposite sign. Appearance is set through Properties::width and color. The world owns tendons; removal invalidates their pointers and also removes couplings that reference them. Removing an attached object removes its tendons.

Existing RaiSim XML <wire> elements remain readable. The loader converts them immediately into ordinary two-site tendons, including stretch mode, body attachments, nominal length, stiffness, and appearance. A custom wire’s optional tension attribute becomes its tension command; absent commands default to zero. New XML exports write only <tendon> elements. Legacy XML support is an import conversion, with no second runtime type or API.

The mapping preserves the intended physical model, but does not promise identical trajectories. Former compliant wires applied explicit spring forces; tendon springs and damping use the implicit velocity solve described in Tendon physics. Hard bounds also use tendon constraint rows now. Recheck timestep, damping, and tolerances when migrating a tuned simulation.

Pin constraints

Pin constraints impose coincidence of attachment points in closed-loop systems and are specified under URDF <constraints>. They retain their independent API because they constrain vector position, whereas a tendon constrains one scalar transmission coordinate.