Class KneeJointR

Defined in Program listing for file mechanics/src/joints/KneeJointR.hpp

class KneeJointR : public NewtonEulerJointR

This class implements a knee joint between one or two Newton/Euler Dynamical system.

Subclassed by PivotJointR

Public Functions


Empty constructor.

The relation may be initialized later by setPoint, setAbsolute, and setBasePositions.

KneeJointR(SP::SiconosVector P, bool absoluteRef, SP::NewtonEulerDS d1 = SP::NewtonEulerDS(), SP::NewtonEulerDS d2 = SP::NewtonEulerDS())

Constructor based on one or two dynamical systems and a point.

  • d1 – first DynamicalSystem linked by the joint.

  • d2 – second DynamicalSystem linked by the joint, or NULL for absolute frame.

  • P – SiconosVector of size 3 that defines the point around which rotation is allowed.

  • absoluteRef – if true, P is in the absolute frame, otherwise P is in d1 frame.

inline virtual ~KneeJointR()


virtual void setBasePositions(SP::SiconosVector q1, SP::SiconosVector q2 = SP::SiconosVector())

Initialize the joint constants based on the provided base positions.

  • q1 – A SiconosVector of size 7 indicating translation and orientation in inertial coordinates.

  • q2 – An optional SiconosVector of size 7 indicating translation and orientation; if null, the inertial frame will be considered as the second base.

void checkInitPos(SP::SiconosVector q1, SP::SiconosVector q2)

Perform some checks on the initial conditions.

inline virtual unsigned int numberOfConstraints()

Get the number of constraints defined in the joint.


the number of constraints

inline virtual unsigned int numberOfDoF()

Get the number of degrees of freedom defined in the joint.


the number of degrees of freedom (DoF)

inline virtual DoF_Type typeOfDoF(unsigned int axis)

Return the type of a degree of freedom of this joint.


the type of the degree of freedom (DoF)

virtual void computeh(double time, const BlockVector &q0, SiconosVector &y)

to compute the output y = h(t,q,z) of the Relation

  • time – current time value

  • q – coordinates of the dynamical systems involved in the relation

  • y – the resulting vector