Skip to content

raisim::CustomLengthConstraint ​

class · #include <raisim/constraints/CustomLengthConstraint.hpp>

Inherits: raisim::LengthConstraint

A length constraint that applies a user-specified tension (see setTension(); created by World::addCustomWire()).

Constructors & destructor ​

CustomLengthConstraint ​

cpp
CustomLengthConstraint(
    Object *obj1,
    size_t localIdx1,
    Vec<3> pos1_b,
    Object *obj2,
    size_t localIdx2,
    Vec<3> pos2_b,
    double length)

Use World::addCustomWire() instead of constructing it directly.

Parameters

ParameterDescription
obj1 (in)first object
localIdx1 (in)local body index on obj1
pos1_b (in)mount position in obj1's body frame
obj2 (in)second object
localIdx2 (in)local body index on obj2
pos2_b (in)mount position in obj2's body frame
length (in)rest length (m)

~CustomLengthConstraint ​

cpp
~CustomLengthConstraint() = default

Public member functions ​

setTension ​

cpp
void setTension(double tension)

set the tension of the wire. It stays applied until changed.

Parameters

ParameterDescription
tension (in)the applied tension (N). If this number is positive, then the force is acting such a way that brings the two objects together. Must be finite (throws std::invalid_argument otherwise)

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

RaiSim — physics for robotics and AI.