raisim::CompliantLengthConstraint
class · #include <raisim/constraints/CompliantLengthConstraint.hpp>
Inherits: raisim::LengthConstraint
A length constraint that acts as a linear spring (created by World::addCompliantWire()).
Constructors & destructor
CompliantLengthConstraint
CompliantLengthConstraint(
Object *obj1,
int localIdx1,
Vec<3> pos1_b,
Object *obj2,
int localIdx2,
Vec<3> pos2_b,
double length,
double stiffness)Use World::addCompliantWire() instead of constructing it directly.
Parameters
| Parameter | Description |
|---|---|
obj1 (in) | first object |
localIdx1 (in) | local body index on obj1 (nonnegative) |
pos1_b (in) | mount position in obj1's body frame |
obj2 (in) | second object |
localIdx2 (in) | local body index on obj2 (nonnegative) |
pos2_b (in) | mount position in obj2's body frame |
length (in) | rest length (m) |
stiffness (in) | spring stiffness (N/m), finite and nonnegative. Negative local indices throw std::invalid_argument. |
~CompliantLengthConstraint
~CompliantLengthConstraint() override = defaultPublic member functions
getStiffness
double getStiffness() constReturns Spring stiffness (N/m).
getPotentialEnergy
double getPotentialEnergy() constReturns Stored spring potential energy (J).
getTension
const Vec<3> &getTension() constReturns Current tension vector in world frame.
Inherited members
From raisim::LengthConstraint: getBody1, getBody2, getDistance, getLength, getLocalIdx1, getLocalIdx2, getName, getNorm, getOb1MountPos, getOb2MountPos, getP1, getP2, getStretch, getStretchType, getTendon, getVisualizationWidth, getWireType, isActive, setName, setStretchType, setVisualizationWidth, StretchType, update, WireType
From raisim::Constraints: getColor, lock, lockMutex, setColor, try_lock, unlock, unlockMutex