Skip to content

raisim::Tendon ​

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

A scalar transmission: routed spatial length or a weighted sum of scalar joints. Positive tension shortens the tendon; positive actuation force lengthens it. Geometry is massless. Optional armature adds inertia only along tendon length. World owns tendons and removes them when a referenced object is removed.

Nested classes ​

  • struct Drive — Actuator acting along the tendon.
  • struct JointGradient — Length gradient with respect to one joint of a fixed tendon.
  • struct JointTerm — One term of a fixed tendon: length += coefficient * q(joint). Only revolute and prismatic joints are supported.
  • struct PathElement — One element of a spatial tendon route. Create elements with the static factory functions.
  • struct PointGradient — Length gradient with respect to one world-space application point.
  • struct Properties — Passive and limit parameters of a tendon. Forces are in tendon coordinates (N for spatial tendons). Validated by setProperties().
  • struct Site — An attachment point on a body (or in the world frame) used by spatial tendon paths.
  • struct VisualSegment — A straight piece of the routed tendon in world coordinates.

Public types ​

Type ​

cpp
enum class Type

Spatial: routed through sites/obstacles (World::addSpatialTendon()). Fixed: weighted sum of joint coordinates (World::addFixedTendon()).

Enumerator
Spatial
Fixed

Constructors & destructor ​

~Tendon ​

cpp
~Tendon()

Tendon ​

cpp
Tendon(const Tendon &) = delete

Public member functions ​

operator= ​

cpp
Tendon &operator=(const Tendon &) = delete

getType ​

cpp
Type getType() const

Returns whether this is a spatial or a fixed tendon.

getName ​

cpp
const std::string &getName() const

Returns the tendon's unique name.

setName ​

cpp
void setName(const std::string &name)

Rename the tendon.

Parameters

ParameterDescription
name (in)new name; must be non-empty and unique among the world's tendons (throws std::invalid_argument otherwise).

getProperties ​

cpp
const Properties &getProperties() const

Returns the current properties. NaN spring bounds are replaced by the reference length.

setProperties ​

cpp
void setProperties(const Properties &properties)

Replace the tendon properties and wake the attached bodies.

Parameters

ParameterDescription
properties (in)new properties. Throws std::invalid_argument if invalid. NaN/NaN spring bounds use getReferenceLength().

getDrive ​

cpp
const Drive &getDrive() const

Returns the current drive settings.

setDrive ​

cpp
void setDrive(const Drive &drive)

Replace the drive settings and wake the attached bodies.

Parameters

ParameterDescription
drive (in)must have finite force/targets and nonnegative gains/activation time (throws std::invalid_argument otherwise).

setTension ​

cpp
void setTension(double tension)

Set the feedforward drive force to -tension (positive tension shortens the tendon).

Parameters

ParameterDescription
tension (in)tension (N for spatial tendons), finite

setActuationForce ​

cpp
void setActuationForce(double force)

Set the feedforward drive force (Drive::force); positive lengthens the tendon.

Parameters

ParameterDescription
force (in)force (N for spatial tendons), finite

setEnabled ​

cpp
void setEnabled(bool enabled)

Enable or disable the tendon. A disabled tendon applies no force.

Parameters

ParameterDescription
enabled (in)true to enable

isEnabled ​

cpp
bool isEnabled() const

Returns true if the tendon is enabled.

updateGeometry ​

cpp
void updateGeometry(bool visuals=false)

Refresh length, velocity, gradients and (on request) visual segments at current state. Simulation-side: mutates the tendon, so call it only from the thread that steps the world.

Parameters

ParameterDescription
visuals (in)also refresh getVisualSegments()

computeVisualSegments ​

cpp
void computeVisualSegments(std::vector<VisualSegment> &segments) const

Route segments at the current object poses, written to a caller-owned buffer. Does not touch the tendon's own length, gradients or visual cache; safe for renderers.

Parameters

ParameterDescription
segments (out)cleared and filled with the route segments

getLength ​

cpp
double getLength() const

Returns the tendon length at the last geometry update (m for spatial tendons).

getVelocity ​

cpp
double getVelocity() const

Returns the rate of change of the tendon length.

getReferenceLength ​

cpp
double getReferenceLength() const

Returns the length when the tendon was created.

getForce ​

cpp
double getForce() const

Returns the sum of all tendon force contributions in the last step; positive lengthens the tendon. Last-step signed total tendon force.

getTension ​

cpp
double getTension() const

Returns -getForce(); positive when the tendon pulls.

getActuationForce ​

cpp
double getActuationForce() const

Returns the drive's contribution to the last-step force.

getLimitForce ​

cpp
double getLimitForce() const

Returns the length limits' contribution to the last-step force.

getFrictionForce ​

cpp
double getFrictionForce() const

Returns the friction loss's contribution to the last-step force.

getPotentialEnergy ​

cpp
double getPotentialEnergy() const

Returns spring energy 0.5*stiffness*e^2, where e is the length's distance outside [springLower, springUpper] (J).

getKineticEnergy ​

cpp
double getKineticEnergy() const

Returns armature kinetic energy 0.5*armature*velocity^2 (J).

getPath ​

cpp
const std::vector<PathElement> &getPath() const

Returns the route of a spatial tendon (empty for fixed tendons).

getJoints ​

cpp
const std::vector<JointTerm> &getJoints() const

Returns the joint terms of a fixed tendon (empty for spatial tendons).

getPointGradients ​

cpp
const std::vector<PointGradient> &getPointGradients() const

Returns the length gradients w.r.t. application points from the last geometry update.

getJointGradients ​

cpp
const std::vector<JointGradient> &getJointGradients() const

Returns the length gradients w.r.t. the joints of a fixed tendon.

getVisualSegments ​

cpp
const std::vector<VisualSegment> &getVisualSegments() const

Returns the segments cached by the last updateGeometry(true) call.

RaiSim — physics for robotics and AI.