ArticulatedSystem API

class ArticulatedSystem : public raisim::Object

A tree of rigid bodies connected by joints (robot), simulated in generalized coordinates.

Usually created from a URDF/MJCF file through World::addArticulatedSystem(). Conventions used below:

  • body (index): a movable body. Links connected by fixed joints are merged into their movable parent, so the body index equals the index of the joint that connects the body to its parent. The body frame is the frame of that parent joint (after the joint transformation).

  • gc (generalized coordinate, size getGeneralizedCoordinateDim()): floating base = position (3) + quaternion (w,x,y,z); spherical joint = quaternion (w,x,y,z); revolute/prismatic = 1 value.

  • gv (generalized velocity, size getDOF()): floating base = linear velocity (3) and angular velocity (3), both in the world frame; spherical joint = angular velocity in the child body frame; revolute/prismatic = 1 value.

  • frame: a CoordinateFrame is defined at every joint, including fixed joints (and sensors).

Public Types

enum Frame

Coordinate frame in which a vector argument is expressed.

Values:

enumerator WORLD_FRAME

World frame.

enumerator PARENT_FRAME

Frame of the parent body of the given body.

enumerator BODY_FRAME

Frame of the given body (its parent joint frame).

enum class IntegrationScheme : int

Time integration scheme (see setIntegrationScheme()).

Values:

enumerator TRAPEZOID

Positions are integrated with the average of the old and new generalized velocity (default).

enumerator SEMI_IMPLICIT

Positions are integrated with the new generalized velocity.

enumerator EULER

Positions are integrated with the old generalized velocity.

enumerator RUNGE_KUTTA_4

Fourth-order Runge-Kutta integration.

Public Functions

inline bool isSecondOrderOrHigher(IntegrationScheme scheme) const
Parameters:

scheme – [in] integration scheme

Returns:

true only for IntegrationScheme::RUNGE_KUTTA_4

ArticulatedSystem(const Child &child, const std::string &resDir, ArticulatedSystemOption options)

Build a system from a programmatically constructed kinematic tree. Users normally go through World::addArticulatedSystem().

Parameters:
  • child – [in] root node of the tree

  • resDir – [in] resource directory used to resolve relative mesh paths

  • options – [in] articulated system options

explicit ArticulatedSystem(const std::string &filePathOrURDFScript, const std::string &resDir = "", const std::vector<std::string> &jointOrder = std::vector<std::string>(), ArticulatedSystemOption options = ArticulatedSystemOption())

Build a system from a URDF file or a URDF string. Users normally go through World::addArticulatedSystem().

Parameters:
  • filePathOrURDFScript – [in] path to a “.urdf”/”.xml” file, or the URDF text itself (an argument containing ‘<’ is treated as URDF text)

  • resDir – [in] resource directory for meshes. If empty, the directory of the file is used

  • jointOrder – [in] optional joint names that set the order in which sibling branches are traversed (and hence the gc/gv ordering). Joints not listed follow in file order

  • options – [in] articulated system options

explicit ArticulatedSystem(const std::string &filePathOrURDFScript, const std::vector<std::string> &modules, const std::string &resDir = "", const std::vector<std::string> &jointOrder = std::vector<std::string>(), ArticulatedSystemOption options = ArticulatedSystemOption())

Build a system from a URDF file extended by module files. The content of each module file is inserted before the closing robot tag, and the merged model is written to “generated_<urdf name>_<module names>.urdf” in the base directory (resDir, or the URDF’s directory) before it is loaded.

Parameters:
  • filePathOrURDFScript – [in] path to the base URDF file (URDF text is not supported here)

  • modules – [in] module files. Each is searched as an absolute path, then relative to the base directory, then in “modules”/”module” next to or one level above the base directory

  • resDir – [in] resource directory for meshes and the base directory of the modules. If empty, the directory of the URDF file is used

  • jointOrder – [in] see the URDF constructor

  • options – [in] articulated system options

ArticulatedSystem(const RaiSimTinyXmlWrapper &c, const std::string &resDir, const std::unordered_map<std::string, RaiSimTinyXmlWrapper> &defaultNode, const std::unordered_map<std::string, std::pair<std::string, Vec<3>>> &mesh, const mjcf::MjcfCompilerSetting &setting, ArticulatedSystemOption options = ArticulatedSystemOption())

Internal: build a system from an MJCF body node. Used by the MJCF world loader.

Parameters:
  • c – [in] MJCF body element

  • resDir – [in] resource directory for meshes

  • defaultNode – [in] MJCF default classes (and assets) keyed by name

  • mesh – [in] MJCF mesh assets: name -> (file, scale)

  • setting – [in] MJCF compiler settings

  • options – [in] articulated system options

inline const raisim::VecDyn &getGeneralizedCoordinate() const
Returns:

generalized coordinate of the system (size getGeneralizedCoordinateDim(); see the class description for the layout)

inline const raisim::VecDyn &getGeneralizedVelocity() const
Returns:

generalized velocity of the system (size getDOF())

inline const raisim::VecDyn &getGeneralizedAcceleration() const
Returns:

generalized acceleration of the system (size getDOF()). The generalized acceleration is computed in the integration step. So this function does not work properly if you have not integrated the world.

void getBaseOrientation(raisim::Vec<4> &quaternion) const

Only for a floating base (fatal otherwise).

Parameters:

quaternion – [out] orientation of the base as a quaternion (w,x,y,z), i.e., gc[3..6]

inline void getBaseOrientation(raisim::Mat<3, 3> &rotataionMatrix) const
Parameters:

rotataionMatrix – [out] world-frame orientation of the base

inline const raisim::Mat<3, 3> &getBaseOrientation() const
Returns:

world-frame orientation of the base

inline void getBasePosition(raisim::Vec<3> &position) const

Only for a floating base (fatal otherwise).

Parameters:

position – [out] world-frame position of the base, i.e., gc[0..2] [m]

inline raisim::Vec<3> getBasePosition() const

Only for a floating base (fatal otherwise).

Returns:

world-frame position of the base, i.e., gc[0..2] [m]

void updateKinematics()

Recompute body poses and velocities from the current gc and gv (quaternions in gc are normalized). unnecessary to call this function if you are simulating your system. integrate1 calls this function Call this function if you want to get kinematic properties but you don’t want to integrate.

inline void setGeneralizedCoordinate(const Eigen::VectorXd &jointState)

set gc of each joint in order. This updates the kinematics and removes previously computed contact points.

Parameters:

jointState – [in] generalized coordinate (size getGeneralizedCoordinateDim())

inline void setGeneralizedCoordinate(const raisim::VecDyn &jointState)

set gc of each joint in order. This updates the kinematics and removes previously computed contact points.

Parameters:

jointState – [in] generalized coordinate (size getGeneralizedCoordinateDim())

inline void setGeneralizedVelocity(const Eigen::VectorXd &jointVel)

set the generalized velocity. This updates the kinematics.

Parameters:

jointVel – [in] the generalized velocity (size getDOF())

inline void setGeneralizedVelocity(const raisim::VecDyn &jointVel)

set the generalized velocity. This updates the kinematics.

Parameters:

jointVel – [in] the generalized velocity (size getDOF())

void setGeneralizedCoordinate(std::initializer_list<double> jointState)

set the generalized coordinate of each joint in order. This updates the kinematics and removes previously computed contact points.

Parameters:

jointState – [in] the generalized coordinate (must have getGeneralizedCoordinateDim() elements; fatal otherwise)

void setGeneralizedVelocity(std::initializer_list<double> jointVel)

set the generalized velocity of each joint in order. This updates the kinematics.

Parameters:

jointVel – [in] the generalized velocity (must have getDOF() elements; fatal otherwise)

void setGeneralizedForce(std::initializer_list<double> tau)

This is feedforward generalized force. In the PD control mode, this differs from the actual generalizedForce the dimension should be the same as dof. Unlike setExternalForce(), it persists until it is set again.

Parameters:

tau – [in] the generalized force. If the built-in PD controller is active, this force is added to the generalized force from the PD controller

inline void setGeneralizedForce(const raisim::VecDyn &tau)

This is feedforward generalized force. In the PD control mode, this differs from the actual generalizedForce the dimension should be the same as dof. Unlike setExternalForce(), it persists until it is set again.

Parameters:

tau – [in] the generalized force. If the built-in PD controller is active, this force is added to the generalized force from the PD controller

inline void setGeneralizedForce(const Eigen::VectorXd &tau)

This is feedforward generalized force. In the PD control mode, this differs from the actual generalizedForce the dimension should be the same as dof. Unlike setExternalForce(), it persists until it is set again.

Parameters:

tau – [in] the generalized force. If the built-in PD controller is active, this force is added to the generalized force from the PD controller

inline void getState(Eigen::VectorXd &genco, Eigen::VectorXd &genvel) const

get both the generalized coordinate and the generalized velocity

Parameters:
inline void getState(VecDyn &genco, VecDyn &genvel) const

get both the generalized coordinate and the generalized velocity

Parameters:
inline void setState(const Eigen::VectorXd &genco, const Eigen::VectorXd &genvel)

set both the generalized coordinate and the generalized velocity. This updates the kinematics and removes previously computed contact points

Parameters:
inline VecDyn getGeneralizedForce() const

Actuation generalized force: the feedforward force (setGeneralizedForce()) plus, in the PD control mode, the PD term (using the position error of the last step and the current velocity), clamped to the actuation limits, plus the actuator torques clipped to their motor operating regions at the current motor speeds. This method a small error when the built-in PD controller is used. The PD controller is implicit (using a continuous, linear model) so we cannot get the true gen force. But if you set the time step small enough, the difference is negligible.

Returns:

the generalized force (size getDOF())

inline const VecDyn &getFeedForwardGeneralizedForce() const

get the feedfoward generalized force (which is set by the user)

Returns:

the feedforward generalized force

inline const MatDyn &getMassMatrix()

compute and get the mass matrix at the current configuration. It includes the rotor inertia on its diagonal.

Returns:

the mass matrix (getDOF() x getDOF()). The reference is to internal storage that is overwritten by the next call. Check Object/ArticulatedSystem section in the manual

inline const VecDyn &getNonlinearities(const Vec<3> &gravity)

compute and get the coriolis and the gravitational term (h in M*du + h = tau) at the current state

Parameters:

gravity – [in] gravitational acceleration. You should get this value from the world.getGravity();

Returns:

the coriolis and the gravitational term (size getDOF()). Check Object/ArticulatedSystem section in the manual

inline const MatDyn &getInverseMassMatrix()

get the inverse mass matrix. Note that this is actually damped inverse. It contains the effect of damping, the springs and the PD gains due to the implicit integration. YOU MUST CALL getMassMatrix FIRST BEFORE CALLING THIS METHOD.

Returns:

the inverse mass matrix. Check Object/ArticulatedSystem section in the manual

inline const std::vector<raisim::Vec<3>> &getCompositeCOM() const

get the center of mass of a composite body containing body i and all its children. if you want the COM of the whole robot, just take the first element This only works if you have called getMassMatrix() with the current state

Returns:

world-frame centers of mass of the composite bodies, indexed by body index [m]

inline Vec<3> getCOM() const

get the center of mass of the whole system, computed from the current body COM positions

Returns:

world-frame center of mass of the system [m]

inline const std::vector<raisim::Mat<3, 3>> &getCompositeInertia() const

get the composite inertia of a composite body containing body i and all its children. It is updated by getMassMatrix() (and the integration step).

Returns:

inertia of each composite body about its composite COM, expressed in the world frame, indexed by body index

inline const std::vector<double> &getCompositeMass() const

get the current composite mass of a composite body containing body i and all its children. Call updateMassInfo() after changing body masses.

Returns:

composite masses indexed by body index [kg]

inline Vec<3> getLinearMomentum() const

linear momentum of the whole system

Returns:

world-frame linear momentum [kg m/s]

inline const VecDyn &getGeneralizedMomentum() const

returns the generalized momentum which is M * u It is already computed in “integrate1()” so you don’t have to compute again.

Returns:

the generalized momentum

double getEnergy(const Vec<3> &gravity)
Parameters:

gravity – [in] gravitational acceleration

Returns:

the sum of potential/kinetic energy given the gravitational acceleration [J]. See getKineticEnergy() and getPotentialEnergy()

double getKineticEnergy()

Computes 0.5 * u^T M u. This recomputes the mass matrix (including rotor inertia).

Returns:

the kinetic energy [J].

double getPotentialEnergy(const Vec<3> &gravity) const
Parameters:

gravity – [in] gravitational acceleration

Returns:

the gravitational potential energy, -sum_i m_i * (gravity . com_i), i.e., relative to the world origin [J]

void getAngularMomentum(const Vec<3> &referencePoint, Vec<3> &angularMomentum) const
Parameters:
  • referencePoint – [in] the world-frame reference point about which the angular momentum is computed

  • angularMomentum – [out] world-frame angular momentum about the reference point

void printOutBodyNamesInOrder() const

bodies here means moving bodies. Fixed bodies are optimized out

void printOutMovableJointNamesInOrder() const

print out movable joint names in order

void printOutFrameNamesInOrder() const

frames are attached to every joint coordinate

inline const std::vector<std::string> &getMovableJointNames() const

getMovableJointNames. Note! the order doesn’t correspond to dof since there are joints with multiple dof’s. For a floating base, the first entry is “ROOT”.

Returns:

movable joint names in the joint order.

inline size_t getGeneralizedVelocityIndex(const std::string &name) const

get generalized velocity index of a joint. Fatal if the joint does not exist.

Parameters:

name – [in] movable joint name (“ROOT” for a floating base)

Returns:

index of the joint’s first element in the generalized velocity.

virtual void getPosition(size_t bodyIdx, const Vec<3> &point_B, Vec<3> &point_W) const final

Transform a point from a body frame to the world frame.

Parameters:
  • bodyIdx – [in] The body which contains the point, can be retrieved by getBodyIdx()

  • point_B – [in] The position of the point in the body frame

  • point_W – [out] The position of the point in the world frame

inline CoordinateFrame &getFrameByName(const std::string &nm)

Refer to Object/ArticulatedSystem/Kinematics/Frame in the manual for details

Parameters:

nm – [in] name of the frame (joint name). Fatal if not found

Returns:

the coordinate frame of the given name

inline const CoordinateFrame &getFrameByName(const std::string &nm) const

Const overload of getFrameByName().

Parameters:

nm – [in] name of the frame (joint name). Fatal if not found

Returns:

the coordinate frame of the given name

inline CoordinateFrame &getFrameByLinkName(const std::string &name)

Refer to Object/ArticulatedSystem/Kinematics/Frame in the manual for details

Parameters:

name – [in] name of the urdf link that is a child of the joint. Fatal if not found

Returns:

the coordinate frame of the given link name

inline const CoordinateFrame &getFrameByLinkName(const std::string &name) const

Const overload of getFrameByLinkName().

Parameters:

name – [in] name of the urdf link that is a child of the joint. Fatal if not found

Returns:

the coordinate frame of the given link name

inline size_t getFrameIdxByLinkName(const std::string &name) const

Refer to Object/ArticulatedSystem/Kinematics/Frame in the manual for details

Parameters:

name – [in] name of the urdf link that is a child of the joint

Returns:

the coordinate frame index of the given link name. Returns size_t(-1) if it doesn’t exist

inline CoordinateFrame &getFrameByIdx(size_t idx)

Refer to Object/ArticulatedSystem/Kinematics/Frame in the manual for details

Parameters:

idx – [in] index of the frame. Fatal if out of range

Returns:

the coordinate frame of the given index

inline const CoordinateFrame &getFrameByIdx(size_t idx) const

Const overload of getFrameByIdx().

Parameters:

idx – [in] index of the frame. Fatal if out of range

Returns:

the coordinate frame of the given index

size_t getFrameIdxByName(const std::string &nm) const

Refer to Object/ArticulatedSystem/Kinematics/Frame in the manual for details The frame can be retrieved as as->getFrames[index]. This way is more efficient than above methods that use the frame name

Parameters:

nm – [in] name of the frame

Returns:

the index of the coordinate frame of the given name. Returns size_t(-1) if it doesn’t exist

inline std::vector<CoordinateFrame> &getFrames()

Refer to Object/ArticulatedSystem/Kinematics/Frame in the manual for details The frame can be retrieved as as->getFrames[index]. This way is more efficient than above methods that use the frame name

Returns:

a vector of the coordinate frames

inline const std::vector<CoordinateFrame> &getFrames() const

Const overload of getFrames().

Returns:

a vector of the coordinate frames

void getFramePosition(size_t frameId, Vec<3> &point_W) const
Parameters:
  • frameId – [in] the frame id which can be obtained by getFrameIdxByName()

  • point_W – [out] the position of the frame expressed in the world frame

void getPositionInFrame(size_t frameId, const Vec<3> &localPos, Vec<3> &point_W) const
Parameters:
  • frameId – [in] the frame id which can be obtained by getFrameIdxByName()

  • localPos – [in] local position expressed in the specified frame

  • point_W – [out] the position expressed in the world frame

void getFrameOrientation(size_t frameId, Mat<3, 3> &orientation_W) const
Parameters:
  • frameId – [in] the frame id which can be obtained by getFrameIdxByName()

  • orientation_W – [out] the orientation of the frame relative to the world frame

void getFrameVelocity(size_t frameId, Vec<3> &vel_W) const
Parameters:
  • frameId – [in] the frame id which can be obtained by getFrameIdxByName()

  • vel_W – [out] the linear velocity of the frame expressed in the world frame

void getFrameAngularVelocity(size_t frameId, Vec<3> &angVel_W) const
Parameters:
  • frameId – [in] the frame id which can be obtained by getFrameIdxByName()

  • angVel_W – [out] the angular velocity of the frame expressed in the world frame

inline void getFramePosition(const std::string &frameName, Vec<3> &point_W) const
Parameters:
  • frameName – [in] the frame name (defined in the urdf)

  • point_W – [out] the position of the frame expressed in the world frame

inline void getFrameOrientation(const std::string &frameName, Mat<3, 3> &orientation_W) const
Parameters:
  • frameName – [in] the frame name (defined in the urdf)

  • orientation_W – [out] the orientation of the frame relative to the world frame

inline void getFrameVelocity(const std::string &frameName, Vec<3> &vel_W) const
Parameters:
  • frameName – [in] the frame name (defined in the urdf)

  • vel_W – [out] the linear velocity of the frame expressed in the world frame

inline void getFrameAngularVelocity(const std::string &frameName, Vec<3> &angVel_W) const
Parameters:
  • frameName – [in] the frame name (defined in the urdf)

  • angVel_W – [out] the angular velocity of the frame relative to the world frame

void getFramePosition(const CoordinateFrame &frame, Vec<3> &point_W) const
Parameters:
  • frame – [in] custom frame defined by the user

  • point_W – [out] the position of the frame relative to the world frame

void getFrameOrientation(const CoordinateFrame &frame, Mat<3, 3> &orientation_W) const
Parameters:
  • frame – [in] custom frame defined by the user

  • orientation_W – [out] the orientation of the frame relative to the world frame

void getFrameVelocity(const CoordinateFrame &frame, Vec<3> &vel_W) const
Parameters:
  • frame – [in] custom frame defined by the user

  • vel_W – [out] the linear velocity of the frame expressed to the world frame

void getFrameAngularVelocity(const CoordinateFrame &frame, Vec<3> &angVel_W) const
Parameters:
  • frame – [in] custom frame defined by the user

  • angVel_W – [out] the angular velocity of the frame expressed to the world frame

inline void getFrameAcceleration(const std::string &frameName, Vec<3> &acc_W) const

YOU NEED TO ENABLE INVERSEDYNAMICS COMPUTATION TO USE THIS METHOD (setComputeInverseDynamics(true)) This reports specific force: the time derivative of world-frame frame velocity minus gravity. Rotating it into the frame (premultiplying by the transpose of the frame’s rotation matrix) gives the ideal accelerometer reading before sensor bias and noise. This is not the same as {(time derivative of body velocity expressed in the body frame) expressed in the world frame}

Parameters:
  • frameName – [in] name of the frame

  • acc_W – [out] the frame’s specific force (linear acceleration minus gravity) expressed in the world frame

inline void getFrameAcceleration(const CoordinateFrame &frame, Vec<3> &acc_W) const

YOU NEED TO ENABLE INVERSEDYNAMICS COMPUTATION TO USE THIS METHOD (setComputeInverseDynamics(true)) This reports specific force: the time derivative of world-frame frame velocity minus gravity. Rotating it into the frame gives the ideal accelerometer reading before sensor bias and noise.

Parameters:
  • frame – [in] custom frame defined by the user

  • acc_W – [out] the frame’s specific force expressed in the world frame

inline virtual void getPosition(size_t bodyIdx, Vec<3> &pos_w) const final
Parameters:
  • bodyIdx – [in] the body index. Note that body index and the joint index are the same because every body has one parent joint. It can be retrieved by getBodyIdx()

  • pos_w – [out] world-frame position of the joint (after its own joint transformation)

void getPositionInBodyCoordinate(size_t bodyIdx, const Vec<3> &pos_W, Vec<3> &pos_B)
Parameters:
  • bodyIdx – [in] the body index. Note that body index and the joint index are the same because every body has one parent joint. It can be retrieved by getBodyIdx()

  • pos_W – [in] the position in the world coordinate. This position does not have to be physically on the body.

  • pos_B – [out] the position in the body frame

inline virtual void getOrientation(size_t bodyIdx, Mat<3, 3> &rot) const final
Parameters:
  • bodyIdx – [in] the body index. Note that body index and the joint index are the same because every body has one parent joint. It can be retrieved by getBodyIdx()

  • rot – [out] world-frame orientation of the joint (after its own joint transformation)

inline virtual void getVelocity(size_t bodyIdx, Vec<3> &vel_w) const final
Parameters:
  • bodyIdx – [in] the body index. Note that body index and the joint index are the same because every body has one parent joint. It can be retrieved by getBodyIdx()

  • vel_w – [out] world-frame linear velocity of the joint (after its own joint transformation)

inline void getAngularVelocity(size_t bodyIdx, Vec<3> &angVel_w) const
Parameters:
  • bodyIdx – [in] the body index. Note that body index and the joint index are the same because every body has one parent joint. It can be retrieved by getBodyIdx()

  • angVel_w – [out] world-frame angular velocity of the body

void getSparseJacobian(size_t bodyIdx, const Vec<3> &point_W, SparseJacobian &jaco) const
Parameters:
  • bodyIdx – [in] the body index. Note that body index and the joint index are the same because every body has one parent joint. It can be retrieved by getBodyIdx()

  • point_W – [in] the point expressed in the world frame. If you want to use a point expressed in the body frame, use the overload taking a Frame

  • jaco – [out] the positional Jacobian. v = J * u. v is the linear velocity expressed in the world frame and u is the generalized velocity. Only the columns of the joints between the body and the root are stored (jaco.idx holds their gv indices)

void getSparseJacobian(size_t bodyIdx, Frame frame, const Vec<3> &point, SparseJacobian &jaco) const
Parameters:
  • bodyIdx – [in] the body index. Note that body index and the joint index are the same because every body has one parent joint. It can be retrieved by getBodyIdx()

  • frame – [in] the frame in which the position of the point is expressed in

  • point – [in] the position of the point, expressed in frame (relative to the origin of that frame)

  • jaco – [out] the positional Jacobian. v = J * u. v is the linear velocity expressed in the world frame and u is the generalized velocity

void getSparseRotationalJacobian(size_t bodyIdx, SparseJacobian &jaco) const
Parameters:
  • bodyIdx – [in] the body index. Note that body index and the joint index are the same because every body has one parent joint. It can be retrieved by getBodyIdx()

  • jaco – [out] the rotational Jacobian. omega = J * u. omgea is the angular velocity expressed in the world frame and u is the generalized velocity

void getTimeDerivativeOfSparseJacobian(size_t bodyIdx, Frame frame, const Vec<3> &point, SparseJacobian &jaco) const
Parameters:
  • bodyIdx – [in] the body index. Note that body index and the joint index are the same because every body has one parent joint. It can be retrieved by getBodyIdx()

  • frame – [in] the frame in which the position of the point is expressed

  • point – [in] the position of the point of interest

  • jaco – [out] the time derivative of the positional Jacobian. a = dJ * u + J * du. a is the linear acceleration expressed in the world frame, u is the generalized velocity and d denotes the time derivative

void getTimeDerivativeOfSparseRotationalJacobian(size_t bodyIdx, SparseJacobian &jaco) const
Parameters:
  • bodyIdx – [in] the body index. Note that body index and the joint index are the same because every body has one parent joint. It can be retrieved by getBodyIdx()

  • jaco – [out] the rotational Jacobian. alpha = dJ * u + J * du. alpha is the angular acceleration expressed in the world frame, u is the generalized velocity and d denotes the time derivative

inline void getDenseJacobian(size_t bodyIdx, const Vec<3> &point_W, Eigen::MatrixXd &jaco) const

This method only fills out non-zero elements. Make sure that the jaco is setZero() once in the initialization!

Parameters:
  • bodyIdx – [in] the body index. Note that body index and the joint index are the same because every body has one parent joint

  • point_W – [in] the point expressed in the world frame. If you want to use a point expressed in the body frame, use getDenseFrameJacobian()

  • jaco – [out] the dense positional Jacobian. It must be pre-sized to 3 x getDOF()

inline void getDenseRotationalJacobian(size_t bodyIdx, Eigen::MatrixXd &jaco) const

This method only fills out non-zero elements. Make sure that the jaco is setZero() once in the initialization!

Parameters:
  • bodyIdx – [in] the body index. it can be retrieved by getBodyIdx()

  • jaco – [out] the dense rotational Jacobian (omega_W = J * u). It must be pre-sized to 3 x getDOF()

inline void getDenseFrameJacobian(size_t frameIdx, Eigen::MatrixXd &jaco) const

This method only fills out non-zero elements. Make sure that the jaco is setZero() once in the initialization!

Parameters:
  • frameIdx – [in] the frame index. it can be retrieved by getFrameIdxByName()

  • jaco – [out] the dense positional Jacobian of the frame origin. It must be pre-sized to 3 x getDOF()

inline void getDenseFrameJacobian(const std::string &frameName, Eigen::MatrixXd &jaco) const

This method only fills out non-zero elements. Make sure that the jaco is setZero() once in the initialization!

Parameters:
  • frameName – [in] the frame name. (defined in the URDF)

  • jaco – [out] the dense positional Jacobian of the frame origin. It must be pre-sized to 3 x getDOF()

inline void getDenseFrameRotationalJacobian(size_t frameIdx, Eigen::MatrixXd &jaco) const

This method only fills out non-zero elements. Make sure that the jaco is setZero() once in the initialization!

Parameters:
  • frameIdx – [in] the frame index. it can be retrieved by getFrameIdxByName()

  • jaco – [out] the dense rotational Jacobian. It must be pre-sized to 3 x getDOF()

inline void getDenseFrameRotationalJacobian(const std::string &frameName, Eigen::MatrixXd &jaco) const

This method only fills out non-zero elements. Make sure that the jaco is setZero() once in the initialization!

Parameters:
  • frameName – [in] the frame name. (defined in the URDF)

  • jaco – [out] the dense rotational Jacobian. It must be pre-sized to 3 x getDOF()

inline IKResult solveIK(const std::string &frameName, const Vec<3> &targetPosition)

Solve inverse kinematics for a named frame using the current articulated-system state, frame FK, the positional Jacobian of the frame origin and (for orientation targets) a finite-difference rotational Jacobian. By default, the solution is applied on success. The returned solution is a generalized coordinate vector. Currently supports dls, pinv, svd, and transpose inverse methods. Uses default IKOptions (position only).

Parameters:
  • frameName – [in] frame name (see getFrameIdxByName())

  • targetPosition – [in] world-frame target position of the frame origin [m]

Returns:

the solver result. An unknown frame yields success == false and a message

inline IKResult solveIK(const std::string &frameName, const Vec<3> &targetPosition, const IKOptions &options)

Position-only inverse kinematics for a named frame. options.useOrientation is ignored (no orientation target is given).

Parameters:
  • frameName – [in] frame name (see getFrameIdxByName())

  • targetPosition – [in] world-frame target position of the frame origin [m]

  • options – [in] solver options

Returns:

the solver result

inline IKResult solveIK(const std::string &frameName, const Vec<3> &targetPosition, const Mat<3, 3> &targetOrientation, IKOptions options)

Solve inverse kinematics for a named frame with a position and orientation target. This overload always enables the orientation task.

Parameters:
  • frameName – [in] frame name (see getFrameIdxByName())

  • targetPosition – [in] world-frame target position of the frame origin [m]

  • targetOrientation – [in] world-frame target orientation of the frame

  • options – [in] solver options (useOrientation is forced to true)

Returns:

the solver result

inline IKResult solveIK(const std::string &frameName, const Vec<3> &targetPosition, const Mat<3, 3> &targetOrientation)

Position and orientation inverse kinematics for a named frame with default IKOptions.

Parameters:
  • frameName – [in] frame name (see getFrameIdxByName())

  • targetPosition – [in] world-frame target position of the frame origin [m]

  • targetOrientation – [in] world-frame target orientation of the frame

Returns:

the solver result

inline IKResult solveIK(size_t frameIdx, const Vec<3> &targetPosition)

Solve inverse kinematics for a frame index using the current articulated-system state. Uses default IKOptions (position only).

Parameters:
  • frameIdx – [in] frame index (see getFrameIdxByName())

  • targetPosition – [in] world-frame target position of the frame origin [m]

Returns:

the solver result

inline IKResult solveIK(size_t frameIdx, const Vec<3> &targetPosition, const IKOptions &options)

Position-only inverse kinematics for a frame index. options.useOrientation is ignored (no orientation target is given).

Parameters:
  • frameIdx – [in] frame index (see getFrameIdxByName())

  • targetPosition – [in] world-frame target position of the frame origin [m]

  • options – [in] solver options

Returns:

the solver result

IKResult solveIK(size_t frameIdx, const Vec<3> &targetPosition, const Mat<3, 3> &targetOrientation, const IKOptions &options)

Solve inverse kinematics for a frame index with a position and optional orientation target. Set options.useOrientation=true to activate the orientation target. Unless a solution is applied (see IKOptions::applySolution and IKOptions::applyBestOnFailure), the generalized coordinate is restored to its value before the call.

Parameters:
  • frameIdx – [in] frame index (see getFrameIdxByName()). An invalid index yields success == false

  • targetPosition – [in] world-frame target position of the frame origin [m]

  • targetOrientation – [in] world-frame target orientation of the frame

  • options – [in] solver options

Returns:

the solver result

void getVelocity(const SparseJacobian &jaco, Vec<3> &pointVel) const

Computes J * u with the current generalized velocity.

Parameters:
  • jaco – [in] the Jacobian associated with the point of interest

  • pointVel – [out] the velocity of the point expressed in the world frame

virtual void getVelocity(size_t bodyIdx, const Vec<3> &posInBodyFrame, Vec<3> &pointVel) const final
Parameters:
  • bodyIdx – [in] the body index. it can be retrieved by getBodyIdx()

  • posInBodyFrame – [in] the position of the point of interest expressed in the body frame

  • pointVel – [out] the velocity of the point expressed in the world frame

void getVelocity(size_t bodyIdx, Frame frameOfPos, const Vec<3> &pos, Frame frameOfVel, Vec<3> &pointVel) const
Parameters:
  • bodyIdx – [in] the body index. it can be retrieved by getBodyIdx()

  • frameOfPos – [in] the frame in which the provided position is expressed

  • pos – [in] the position of the point of interest

  • frameOfVel – [in] the frame in which the computed velocity is expressed

  • pointVel – [out] the velocity of the point, expressed in frameOfVel

size_t getBodyIdx(const std::string &nm) const

returns the index of the body

Parameters:

nm – [in] name of the body. The body name is the name of the movable link of the body

Returns:

the index of the body. Returns size_t(-1) if the body doesn’t exist. Fatal if nm names a link that was merged into its parent through a fixed joint (use a frame instead).

size_t getDOF() const
Returns:

the degrees of freedom

size_t getGeneralizedVelocityDim() const
Returns:

the dimension of generalized velocity (do the same thing with getDOF)

size_t getGeneralizedCoordinateDim() const
Returns:

the dimension of generalized coordinate

inline void getBodyPose(size_t bodyIdx, Mat<3, 3> &orientation, Vec<3> &position) const

The body pose is the pose of its parent joint (after its joint transformation)

Parameters:
  • bodyIdx – [in] the body index. it can be retrieved by getBodyIdx()

  • orientation – [out] world-frame orientation of the body

  • position – [out] world-frame position of the body [m]

inline void getBodyPosition(size_t bodyIdx, Vec<3> &position) const

The body position is the position of its parent joint (after its joint transformation)

Parameters:
  • bodyIdx – [in] the body index. it can be retrieved by getBodyIdx()

  • position – [out] world-frame position of the body [m]

inline void getBodyOrientation(size_t bodyIdx, Mat<3, 3> &orientation) const

The body orientation is the orientation of its parent joint (after its joint transformation)

Parameters:
  • bodyIdx – [in] the body index. it can be retrieved by getBodyIdx()

  • orientation – [out] world-frame orientation of the body

inline std::vector<raisim::Vec<3>> &getJointPos_P()

The following 5 methods can be used to directly modify dynamic/kinematic properties of the robot. They are made for dynamic randomization. Use them with caution since they will change the the model permenantly. After you change the dynamic properties, call “void updateMassInfo()” to update some precomputed dynamic properties. The loop constraints check the joint placements again in the next step after one of these methods or updateMassInfo() was called; if you keep the returned reference and change the placements through it later, call updateMassInfo() afterwards

Returns:

a reference to joint position relative to its parent, expressed in the parent frame, indexed by body index [m].

inline const std::vector<raisim::Vec<3>> &getJointPos_P() const
Returns:

joint position relative to its parent, expressed in the parent frame, indexed by body index [m].

inline std::vector<raisim::Mat<3, 3>> &getJointOrientation_P()
Returns:

a reference to joint orientation relative to its parent body frame (at zero joint coordinate), indexed by body index.

inline const std::vector<raisim::Mat<3, 3>> &getJointOrientation_P() const
Returns:

joint orientation relative to its parent body frame (at zero joint coordinate), indexed by body index.

inline std::vector<raisim::Vec<3>> &getJointAxis_P()
Returns:

a reference to joint axes, indexed by body index. Each axis is expressed in the joint frame, i.e., the parent body frame rotated by getJointOrientation_P().

inline const std::vector<raisim::Vec<3>> &getJointAxis_P() const
Returns:

joint axes expressed in the joint frame, indexed by body index.

inline const raisim::Vec<3> &getJointAxis(size_t idx) const
Parameters:

idx – [in] body (joint) index

Returns:

a reference to joint axis expressed in the world frame.

inline std::vector<double> &getMass()

You MUST call updateMassInfo() after you change the mass

Returns:

a reference to mass of each body, indexed by body index [kg].

inline const std::vector<double> &getMass() const
Returns:

mass of each body, indexed by body index [kg].

inline std::vector<raisim::Mat<3, 3>> &getInertia()
Returns:

a reference to inertia of each body about its COM, expressed in the body frame, indexed by body index [kg m^2].

inline const std::vector<raisim::Mat<3, 3>> &getInertia() const
Returns:

inertia of each body about its COM, expressed in the body frame, indexed by body index [kg m^2].

inline std::vector<raisim::Vec<3>> &getBodyCOM_B()
Returns:

a reference to the position of the center of the mass of each body in the body frame, indexed by body index [m].

inline const std::vector<raisim::Vec<3>> &getBodyCOM_B() const
Returns:

position of the center of the mass of each body in the body frame, indexed by body index [m].

inline std::vector<raisim::Vec<3>> &getBodyCOM_W()

Updated by updateKinematics() (and therefore by every state setter and integration step).

Returns:

a reference to the position of the center of the mass of each body in the world frame, indexed by body index [m].

inline const std::vector<raisim::Vec<3>> &getBodyCOM_W() const
Returns:

position of the center of the mass of each body in the world frame, indexed by body index [m].

inline raisim::CollisionSet &getCollisionBodies()
Returns:

a reference to the collision bodies. Position and orientation can be set dynamically

inline const raisim::CollisionSet &getCollisionBodies() const
Returns:

the collision bodies of the system

inline const std::vector<std::pair<size_t, size_t>> &getIgnoredCollisionPairs() const
Returns:

body index pairs (smaller index first) registered by ignoreCollisionBetween()

inline raisim::CollisionDefinition &getCollisionBody(const std::string &name)

Fatal if no collision body has the given name.

Parameters:

name – collision body name which is “LINK_NAME” + “/” + “COLLISION_NUMBER”. For example, the first collision body of the link “base” is named as “base/0”

Returns:

a reference to the collision bodies. Position and orientation can be set dynamically

inline const raisim::CollisionDefinition &getCollisionBody(const std::string &name) const

Const overload of getCollisionBody(). Fatal if no collision body has the given name.

Parameters:

name – [in] collision body name

Returns:

the collision body

void updateMassInfo()

This method updates the precomputed composite mass. Call this method after you change link mass. This also updates the composite centers of mass (getCompositeCOM()) without integration

inline virtual double getMass(size_t bodyIdx) const final
Parameters:

bodyIdx – [in] the body index. it can be retrieved by getBodyIdx()

Returns:

mass of the body

inline void setMass(size_t bodyIdx, double value)

set body mass. It is indexed for each body, not for individual link. Check this link (https://raisim.com/sections/ArticulatedSystem.html#introduction) to understand the difference between a link and a body. This does not call updateMassInfo().

Parameters:
  • bodyIdx – [in] body index

  • value – [in] mass [kg]

inline double getTotalMass() const

Uses the composite mass, so call updateMassInfo() after changing body masses.

Returns:

the total mass of the system [kg].

virtual void setExternalForce(size_t bodyIdx, const Vec<3> &force) final

set external forces or torques expressed in the world frame acting on the COM of the body. The external force is applied for a single time step only. You have to apply the force for every time step if you want persistent force

Parameters:
  • bodyIdx – [in] the body index. it can be retrieved by getBodyIdx()

  • force – [in] world-frame force applied to the body (at the center of mass) [N]

void setExternalForce(size_t bodyIdx, Frame frameOfForce, const Vec<3> &force, Frame frameOfPos, const Vec<3> &pos)

set external force acting on the point specified The external force is applied for a single time step only. You have to apply the force for every time step if you want persistent force

Parameters:
inline virtual void setExternalForce(size_t bodyIdx, const Vec<3> &pos, const Vec<3> &force) final

set external force (expressed in the world frame) acting on the point (expressed in the body frame) specified The external force is applied for a single time step only. You have to apply the force for every time step if you want persistent force

Parameters:
  • bodyIdx – [in] the body index. it can be retrieved by getBodyIdx()

  • pos – [in] position at which the force is applied, expressed in the body frame [m]

  • force – [in] the applied force, expressed in the world frame [N]

inline void setExternalForce(const std::string &frame_name, const Vec<3> &force)

set external force (expressed in the world frame) acting on the point specified by the frame The external force is applied for a single time step only. You have to apply the force for every time step if you want persistent force

Parameters:
  • frame_name – [in] the name of the frame where you want to applied the force. The force is applied to the origin of the frame, on the body where the frame is attached to.

  • force – [in] the applied force in the world frame

virtual void setExternalTorque(size_t bodyIdx, const Vec<3> &torque_in_world_frame) final

set external torque. The external torque is applied for a single time step only. You have to apply the force for every time step if you want persistent torque

Parameters:
  • bodyIdx – [in] the body index. it can be retrieved by getBodyIdx()

  • torque_in_world_frame – [in] the applied torque expressed in the world frame [Nm]

inline void setExternalTorqueInBodyFrame(size_t bodyIdx, const Vec<3> &torque_in_body_frame)

set external torque. The external torque is applied for a single time step only. You have to apply the force for every time step if you want persistent torque

Parameters:
  • bodyIdx – [in] the body index. it can be retrieved by getBodyIdx()

  • torque_in_body_frame – [in] the applied torque expressed in the body frame [Nm]

virtual void getContactPointVel(size_t contactId, Vec<3> &vel) const final

returns the contact point velocity. The contactId is the order in the vector from Object::getContacts() It uses the generalized velocity of the contact solver (the post-contact velocity after a step).

Parameters:
  • contactId – [in] index of the contact vector which can be obtained by getContacts()

  • vel – [out] the world-frame contact point velocity

inline void setControlMode(ControlMode::Type mode)

setPdGains() and setPTarget() switch to ControlMode::PD_PLUS_FEEDFORWARD_TORQUE automatically.

Parameters:

mode – [in] control mode. Can be either ControlMode::FORCE_AND_TORQUE or ControlMode::PD_PLUS_FEEDFORWARD_TORQUE

inline ControlMode::Type getControlMode() const
Returns:

control mode. Can be either ControlMode::FORCE_AND_TORQUE or ControlMode::PD_PLUS_FEEDFORWARD_TORQUE

inline void setPdTarget(const Eigen::VectorXd &posTarget, const Eigen::VectorXd &velTarget)

set PD targets. Effective only in ControlMode::PD_PLUS_FEEDFORWARD_TORQUE (this does not change the control mode).

Parameters:
inline void getPdTarget(Eigen::VectorXd &posTarget, Eigen::VectorXd &velTarget)

get PD targets. The outputs must already have the right size (fatal otherwise).

Parameters:
inline void setPdTarget(const raisim::VecDyn &posTarget, const raisim::VecDyn &velTarget)

set PD targets. Effective only in ControlMode::PD_PLUS_FEEDFORWARD_TORQUE (this does not change the control mode).

Parameters:
template<class T>
inline void setPTarget(const T &posTarget)

set P targets. This also switches to ControlMode::PD_PLUS_FEEDFORWARD_TORQUE.

Parameters:

posTarget – [in] position target (dimension == getGeneralizedCoordinateDim())

template<class T>
inline void setDTarget(const T &velTarget)

set D targets.

Parameters:

velTarget – [in] velocity target (dimension == getDOF())

inline void setPdGains(const Eigen::VectorXd &pgain, const Eigen::VectorXd &dgain)

set PD gains. This also switches to ControlMode::PD_PLUS_FEEDFORWARD_TORQUE. The first 6 entries are forced to zero for a floating base.

Parameters:
  • pgain – [in] position gain (dimension == getDOF())

  • dgain – [in] velocity gain (dimension == getDOF())

inline void getPdGains(Eigen::VectorXd &pgain, Eigen::VectorXd &dgain)

get PD gains.

Parameters:
  • pgain – [out] position gain (dimension == getDOF())

  • dgain – [out] velocity gain (dimension == getDOF())

inline void setPdGains(const raisim::VecDyn &pgain, const raisim::VecDyn &dgain)

set PD gains. This also switches to ControlMode::PD_PLUS_FEEDFORWARD_TORQUE. The first 6 entries are forced to zero for a floating base.

Parameters:
  • pgain – [in] position gain (dimension == getDOF())

  • dgain – [in] velocity gain (dimension == getDOF())

template<class T>
inline void setPGains(const T &pgain)

set P gain. The first 6 entries are forced to zero for a floating base. This does not change the control mode.

Parameters:

pgain – [in] position gain (dimension == getDOF())

template<class T>
inline void setDGains(const T &dgain)

set D gains. The first 6 entries are forced to zero for a floating base. This does not change the control mode.

Parameters:

dgain – [in] velocity gain (dimension == getDOF())

inline void setJointDamping(const Eigen::VectorXd &dampingCoefficient)

passive elements at the joints. They can be specified in the URDF file as well. Check Object/ArticulatedSystem/URDF convention in the manual

Parameters:

dampingCoefficient – [in] the damping coefficient vector, acting at each degrees of freedom (dimension == getDOF())

inline void setJointDamping(const raisim::VecDyn &dampingCoefficient)

passive elements at the joints. They can be specified in the URDF file as well. Check Object/ArticulatedSystem/URDF convention in the manual

Parameters:

dampingCoefficient – [in] the damping coefficient vector, acting at each degrees of freedom (dimension == getDOF())

void computeSparseInverse(const MatDyn &M, MatDyn &Minv) noexcept

This computes the inverse mass matrix given the mass matrix. The return type is dense. It exploits the sparsity of the mass matrix to efficiently perform the computation. The outcome also contains effects of the joint damping, the springs and the PD gains (see getInverseMassMatrix())

Parameters:
  • M – [in] mass matrix

  • Minv – [out] inverse mass matrix

inline void massMatrixVecMul(const VecDyn &vec1, VecDyn &vec) const

this method exploits the sparsity of the mass matrix. If the mass matrix is nearly dense, it will be slower than your ordinary matrix multiplication which is probably vectorized vec = M * vec1, where M is the mass matrix last computed (e.g., by getMassMatrix())

Parameters:
  • vec1 – [in] input vector (size getDOF())

  • vec – [out] output vector (size getDOF())

void ignoreCollisionBetween(size_t bodyIdx1, size_t bodyIdx2)

The bodies specified here will not collide. If the system is already in a world, call updateSelfCollisionCache() afterwards.

Parameters:
  • bodyIdx1 – [in] first body index

  • bodyIdx2 – [in] second body index

void updateSelfCollisionCache(World &world)

Refresh contact body metadata in the world contact detector. Call this after changing collision ignore settings at runtime.

Parameters:

world – [in] the world that owns this articulated system

inline ArticulatedSystemOption getOptions() const
Returns:

a copy of the options the system was created with

inline const std::vector<std::string> &getBodyNames() const
Returns:

a vector of body names (following the joint order)

inline std::vector<VisObject> &getVisOb()
Returns:

a vector of visualized bodies

inline const std::vector<VisObject> &getVisOb() const
Returns:

a vector of visualized bodies

inline std::vector<VisObject> &getVisColOb()
Returns:

a vector of visualized collision bodies (same order as getCollisionBodies())

inline const std::vector<VisObject> &getVisColOb() const
Returns:

a vector of visualized collision bodies (same order as getCollisionBodies())

inline void getVisObPose(size_t visObjIdx, Mat<3, 3> &rot, Vec<3> &pos) const
Parameters:
  • visObjIdx – [in] visual object index. Following the order specified by the vector getVisOb()

  • rot – [out] world-frame orientation

  • pos – [out] world-frame position [m]

inline void getVisColObPose(size_t visColObjIdx, Mat<3, 3> &rot, Vec<3> &pos) const
Parameters:
  • visColObjIdx – [in] visual collision object index. Following the order specified by the vector getVisColOb()

  • rot – [out] world-frame orientation

  • pos – [out] world-frame position [m]

inline const std::string &getResourceDir() const
Returns:

the resource directory (for mesh files, textures, etc)

inline const std::string &getRobotDescriptionfFileName() const
Returns:

the file name (with extension) of the robot description file (empty if the robot was not created from a file path)

inline const std::string &getRobotDescriptionfTopDirName() const
Returns:

the name of the directory containing the robot description file (not the full path; empty if the robot was not created from a file)

inline const std::string &getRobotDescriptionFullPath() const
Returns:

the full path to the URDF file (returns empty string if the robot was not specified by a URDF file)

inline const std::string &getRobotDescription() const
Returns:

if the object was instantiated with raw URDF string, it returns the string

inline void exportRobotDescriptionToURDF(const std::string &filePath) const

if the object was instantiated with raw URDF string, it exports the robot description to an URDF file. Fatal if there is no stored description or filePath does not end with “.urdf”.

Parameters:

filePath – [in] Path where the file is generated

inline void setBasePos_e(const Eigen::Vector3d &pos)

set the base position using an eigen vector. For a fixed base, this moves the fixed base pose.

Parameters:

pos – [in] world-frame position of the base [m]

inline void setBaseOrientation_e(const Eigen::Matrix3d &rot)

set the base orientation using an eigen matrix. For a fixed base, this moves the fixed base pose.

Parameters:

rot – [in] world-frame orientation of the base

void setBasePos(const Vec<3> &pos)

set the base position. For a floating base this writes gc[0..2]; for a fixed base, it moves the fixed base.

Parameters:

pos – [in] world-frame position of the base [m]

void setBaseOrientation(const Mat<3, 3> &rot)

set the base orientation using a raisim rotation matrix (i.e., Mat<3,3>). For a fixed base, it rotates the fixed base.

Parameters:

rot – [in] world-frame orientation of the base

void setBaseOrientation(const Vec<4> &quat)

set the base orientation using a raisim quaternion (i.e., Vec<4>). For a fixed base, it rotates the fixed base.

Parameters:

quat – [in] world-frame orientation of the base as a quaternion (w,x,y,z)

void setBaseVelocity(const Vec<3> &vel)

set the base linear velocity (gv[0..2]). Only for a floating base (prints a warning otherwise).

Parameters:

vel – [in] the world-frame linear velocity of the base [m/s]

void setBaseAngularVelocity(const Vec<3> &vel)

set the base angular velocity (gv[3..5]). Only for a floating base (prints a warning otherwise).

Parameters:

vel – [in] the world-frame angular velocity of the base [rad/s]

inline void setActuationLimits(const Eigen::VectorXd &upper, const Eigen::VectorXd &lower)

set limits in actuation force. It can be also specified in the URDF file. The limits clamp the sum of feedforward and PD actuator forces (not external forces or springs).

Parameters:
  • upper – [in] upper joint force/torque limit (dimension == getDOF())

  • lower – [in] lower joint force/torque limit (dimension == getDOF())

inline std::uint64_t getCollisionVisualRevision() const

Revision of collision geometry shown by remote viewers. Offset and shape edits require a fresh initialization record so body-frame markers stay aligned.

inline const VecDyn &getActuationUpperLimits() const
Returns:

the upper joint torque/force limit

inline const VecDyn &getActuationLowerLimits() const
Returns:

the lower joint torque/force limit

void setActuators(const std::vector<ActuatorDefinition> &actuators)

Define the actuators of the robot. An actuator is a motor with its gear; it drives one revolute or prismatic joint, and its motor can also turn with other joints (couplings, see ActuatorDefinition). Actuators can also be defined in the URDF with <actuator> elements.

The actuators are commanded with setActuatorTorques(). Every step, each actuator’s motor torque is clipped to the motor operating region (EM-MOR, the bus-voltage and peak-torque limits) at the motor’s speed at the beginning of the step, and the clipped torque drives the joints for the whole step. The region limits only the torque, not the speed: external forces can drive a motor at any speed. Torques from setGeneralizedForce(), the built-in PD controller, joint damping, springs and friction are added on top and are not clipped by the region.

At the voltage limit the motor acts as a damper of G^2 Kt / (R Kv) at the joint (G the gear ratio), applied explicitly. It settles at the no-load speed for time steps below twice the motor’s mechanical time constant, 2 I R Kv / (G^2 Kt) (I the inertia at the joint, including the reflected rotor inertia); with larger steps the speed oscillates around the no-load speed, with the torque inside the region. Replaces the existing actuators and resets the actuator torques to zero; an empty vector removes all actuators.

Parameters:

actuators – [in] actuators. A joint can be driven by only one actuator.

inline size_t getNumberOfActuators() const
Returns:

the number of actuators

inline const std::vector<std::string> &getActuatorNames() const

The order of the actuators is the order of setActuators() (or of the <actuator> elements of the URDF), and of setActuatorTorques() and getActuatorStates().

Returns:

the actuator names in order

inline const std::vector<ActuatorDefinition> &getActuators() const
Returns:

the actuators as defined in the URDF or by setActuators(), with the bus voltages set since. Every actuator has its name (getActuatorNames()).

size_t getActuatorIndex(const std::string &name) const
Parameters:

name – [in] actuator name (getActuatorNames())

Returns:

the actuator index, or size_t(-1) if there is no actuator with the name

void setActuatorTorques(const Eigen::VectorXd &torques)

Set the torque of every actuator at the output of its gear: the motor torque times the gear ratio. It is the torque on the joint the actuator drives; an actuator with couplings also applies its motor torque times the coupling ratio to each coupled joint. The torques hold until they are set again. Every step, the motor torques are clipped to the motor operating regions at the motor speeds at the beginning of the step and mapped to the joints. They add to everything else; the actuation limits (URDF effort) do not clip them.

Parameters:

torques – [in] actuator torques [Nm or N], ordered like getActuatorNames()

void setActuatorTorque(const std::string &name, double torque)

Set the torque of one actuator (see setActuatorTorques()).

Parameters:
  • name – [in] actuator name (getActuatorNames())

  • torque – [in] actuator torque at the output of its gear [Nm or N]

void setActuatorTorque(size_t index, double torque)

Set the torque of one actuator (see setActuatorTorques()).

Parameters:
  • index – [in] actuator index (getActuatorNames() order)

  • torque – [in] actuator torque at the output of its gear [Nm or N]

inline const std::vector<double> &getActuatorTorques() const
Returns:

the actuator torques set with setActuatorTorques(), ordered like getActuatorNames()

void getActuatorTorqueBounds(VecDyn &lower, VecDyn &upper) const

The torques every actuator can apply now, at the output of its gear: its motor’s operating region at the current motor speed, times its gear ratio. These are the bounds the next step clips setActuatorTorques() to (with the region not enforced, they are infinite). For the motor alone, without the gear, see motorTorqueBounds().

Parameters:
  • lower – [out] lowest admissible actuator torque [Nm or N], ordered like getActuatorNames()

  • upper – [out] highest admissible actuator torque [Nm or N], ordered like getActuatorNames()

void setBusVoltage(double voltage)

Set the bus voltage of the motors of all actuators, e.g., to follow the battery voltage or to randomize it. Only the voltage changes; it is cheap enough to call every step.

Parameters:

voltage – [in] bus voltage [V] (positive)

void setBusVoltage(const std::string &actuatorName, double voltage)

Set the bus voltage of the motor of one actuator.

Parameters:
  • actuatorName – [in] actuator name (getActuatorNames())

  • voltage – [in] bus voltage [V] (positive)

const std::vector<ActuatorState> &getActuatorStates() const

The states are captured at the end of integration. Reading does not mutate the snapshot, and later setState() calls cannot mix a new velocity into the previous step. Concurrent readers are supported while no thread integrates or changes the actuator configuration.

Returns:

the actuator states of the last step, ordered like getActuatorNames(). Use (motorSpeed, motorTorque) to check an actuator’s motor against its operating region.

inline void setMotorOperatingRegionEnforced(bool enforce)

When disabled, actuator torques are added as set with setActuatorTorques(), and getActuatorStates() reports how far they leave the motor operating regions.

Parameters:

enforce – [in] clip motor torques to the motor operating region (default true)

inline bool isMotorOperatingRegionEnforced() const
Returns:

if motor torques are clipped to the motor operating region

void setCollisionBodyShapeParameters(size_t id, const Vec<4> &params)

change collision geom parameters. Only primitive shapes are supported (fatal for meshes); all used parameters must be positive and finite. The collision visual is updated as well.

Parameters:
  • id – [in] collision object id (index in getCollisionBodies())

  • params – [in] collision object parameters (depending on the object) [m]. For a sphere, {radius}. For a cylinder and a capsule, {radius, length} For a box, {x-dim, y-dim, z-dim} (full side lengths)

void setCollisionBodyPositionOffset(size_t id, const Vec<3> &posOffset)

change collision geom offset from the joint position. The collision visual is updated as well.

Parameters:
  • id – [in] collision object id (index in getCollisionBodies())

  • posOffset – [in] the position vector expressed in the joint frame [m]

void setCollisionBodyOrientationOffset(size_t id, const Mat<3, 3> &oriOffset)

change collision geom orientation offset from the joint frame. The collision visual is updated as well.

Parameters:
  • id – [in] collision object id (index in getCollisionBodies())

  • oriOffset – [in] the orientation relative to the joint frame (must be a proper rotation matrix)

inline void setRotorInertia(const VecDyn &rotorInertia)

rotor inertia is a term added to the diagonal of the mass matrix. This approximates the rotor inertia. Note that this is not exactly equivalent in dynamics (due to gyroscopic effect). but it is a commonly used approximation. It can also be expressed in the URDF file

Parameters:

rotorInertia – [in] the rotor inertia (dimension == getDOF())

inline const VecDyn &getRotorInertia() const

rotor inertia is a term added to the diagonal of the mass matrix. This approximates the rotor inertia. Note that this is not exactly equivalent in dynamics (due to gyroscopic effect). but it is a commonly used approximation. It can also be expressed in the URDF file

Returns:

the rotor inertia

inline Joint::Type getJointType(size_t jointIndex)

The joint index is the body index (joint i connects body i to its parent; joint 0 is the base joint). Joints are in the same order as the elements of the generalized velocity, but the indices differ because some joints have multiple degrees of freedom (see getMappingFromBodyIndexToGeneralizedVelocityIndex())

Parameters:

jointIndex – [in] the joint index

Returns:

the joint type

inline Joint::Type getJointType(size_t jointIndex) const

Const overload of getJointType().

Parameters:

jointIndex – [in] the joint (body) index

Returns:

the joint type

inline size_t getNumberOfJoints() const
Returns:

the number of joints (same as the number of bodies)

inline JointRef getJoint(const std::string &name)

returns reference object of the joint. Fatal if no frame has the given name.

Parameters:

name – [in] joint name (frame name, see getFrameIdxByName())

Returns:

a JointRef to the joint. Check the example JointRefAndLinkRef

inline LinkRef getLink(const std::string &name)

returns reference object of the link. Fatal if no body has the given name (links merged into a parent through fixed joints are not bodies).

Parameters:

name – [in] the link name

Returns:

a LinkRef to the link. Check the example JointRefAndLinkRef

inline const std::vector<size_t> &getMappingFromBodyIndexToGeneralizedVelocityIndex() const
Returns:

a mapping that converts body index to gv index (of the first element of the body’s parent joint). The entry of a fixed base is size_t(-1)

inline const std::vector<size_t> &getMappingFromBodyIndexToGeneralizedCoordinateIndex() const
Returns:

a mapping that converts body index to gc index (of the first element of the body’s parent joint). The entry of a fixed base is size_t(-1)

inline virtual ObjectType getObjectType() const final
Returns:

the object type (ARTICULATED_SYSTEM)

virtual BodyType getBodyType(size_t bodyIdx) const final
Parameters:

bodyIdx – [in] body index

Returns:

the body type (STATIC, KINEMATIC, or DYNAMIC) of the specified body. It is always DYNAMIC except for the fixed base (STATIC)

inline virtual BodyType getBodyType() const final
Returns:

the body type (STATIC, KINEMATIC, or DYNAMIC). It is always dynamic

inline void setIntegrationScheme(IntegrationScheme scheme)
Parameters:

scheme – [in] the integration scheme. Can be either TRAPEZOID, SEMI_IMPLICIT, EULER, or RUNGE_KUTTA_4. We recommend TRAPEZOID for systems with many collisions. RUNGE_KUTTA_4 is useful for systems with few contacts and when the integration accuracy is important. In the PD control mode, TRAPEZOID replaces this setting once the system has been in contact (from the step after its first contact), until its state is set again with setState(), setGeneralizedCoordinate() or an applied solveIK() solution. TRAPEZOID also replaces RUNGE_KUTTA_4 while the system has pin, equality or mimic constraints: they are eliminated from the velocity of one step, which the Runge-Kutta stages would leave.

inline std::vector<contact::Single3DContactProblem const*> getJointLimitViolations(const contact::ContactProblems &problemListFromWorld)

usage example: For 1d joints (e.g., revolute or prismatic), you can get the impulse due to the joint limit as robot.getJointLimitViolations()[0]->imp_i[0] For a ball joint, all three components of imp_i represent the torque in the 3d space. The following joint returns the joint/body Id robot.getJointLimitViolations()[0]->jointId.

Parameters:

problemListFromWorld – [in] the contact problem list of the world (*World::getContactProblem())

Returns:

get contact problems associated with violated joint limits. The pointers refer to elements of problemListFromWorld

inline void setJointLimits(const std::vector<raisim::Vec<2>> &jointLimits)

set new joint limits For revolute and prisimatic joints, the joint limit is {lower, upper} [rad or m]. Equal bounds mean no limit. For spherical joint, the joint limit is {angle, NOT_USED}. The limit of a joint is stored at the gv index of its first element One entry per generalized velocity coordinate (getDOF()), including unused entries for coordinates without position limits.

Parameters:

jointLimits – [in] joint limits

inline const std::vector<raisim::Vec<2>> &getJointLimits() const

get the joint limits For revolute and prisimatic joints, the joint limit is {lower, upper} For spherical joint, the joint limit is {angle, NOT_USED}

Returns:

joint limits, one entry per generalized velocity coordinate (getDOF())

inline const VecDyn &getJointVelocityLimits() const

get the joint velocity limits One entry per body, including the root body. A non-finite entry means no limit.

Returns:

joint velocity limits [rad/s or m/s]

inline void setJointVelocityLimits(const VecDyn &velLimits)

set the joint velocity limits One entry per body, including the root body.

Parameters:

velLimits – [in] joint velocity limits

inline virtual void clearExternalForcesAndTorques() final

Clears all external forces and torques set by setExternalForce()/setExternalTorque() for the current step

inline void addSpring(const SpringElement &spring)
Parameters:

spring – [in] Additional spring elements for joints (copied)

inline std::vector<SpringElement> &getSprings()

The implicit spring terms of the mass matrix are refreshed at the next step, so change the springs through the returned reference before that step, and call this method again for later changes.

Returns:

springs Existing spring elements on joints (including those created from joint stiffness in the model file)

inline const std::vector<SpringElement> &getSprings() const
Returns:

springs Existing spring elements on joints

inline const std::vector<size_t> &getParentVector() const
Returns:

parent parent[i] is a parent body id of the i^th body (size_t(-1) for the root)

inline SensorSet *getSensorSet(const std::string &name)
Parameters:

name – [in] sensor set name

Returns:

the sensor set with the given name, or nullptr if not found. Owned by the system

inline SensorSetGroupDataType &getSensorSets()
Returns:

sensor sets on the robot (owned by the system)

inline const SensorSetGroupDataType &getSensorSets() const
Returns:

sensor sets on the robot (owned by the system)

void addConstraints(const std::vector<PinConstraintDefinition> &pinDef, const VecDyn &pinConstraintNominalConfig)

Internal: store pin (loop-closure) constraint definitions; they are built by initializeConstraints().

Parameters:
  • pinDef – [in] pin constraint definitions

  • pinConstraintNominalConfig – [in] generalized coordinate at which the constraints are defined

void addConstraints(const std::vector<PinConstraintDefinition> &pinDef, const std::vector<EqualityConstraintDefinition> &equalityDef, const VecDyn &nominalConfig)

Internal: store pin and equality (loop-closure) constraint definitions; they are built by initializeConstraints().

Parameters:
  • pinDef – [in] pin constraint definitions

  • equalityDef – [in] equality constraint definitions (one or two axes each)

  • nominalConfig – [in] generalized coordinate at which the constraints are defined

inline void addMimicConstraints(const std::vector<MimicConstraintDefinition> &mimicDef)

Internal: store mimic constraint definitions; they are built by initializeConstraints().

Parameters:

mimicDef – [in] mimic constraint definitions

void addMimicConstraint(const std::string &followerJoint, const std::string &leaderJoint, double multiplier = 1., double offset = 0.)

Couple two one-degree-of-freedom (revolute or prismatic) joints: the follower’s position is kept at multiplier * (leader position) + offset, and its velocity at multiplier * (leader velocity). Like pin and equality constraints, it is eliminated exactly before the contact solve. The follower is driven only through the coupling: it should have no actuation of its own. A position error (e.g. an initial configuration that violates the relation) is removed at the same rate as a pin’s. Adding one wakes a sleeping system, and World::exportToXml() records it (the constraints of the robot description come with the description).

Parameters:
  • followerJoint – [in] name of the constrained joint

  • leaderJoint – [in] name of the joint it follows

  • multiplier – [in] ratio between the follower’s and the leader’s position

  • offset – [in] follower position when the leader is at zero

Throws:

std::logic_error – between World::integrate1() and World::integrate2() while this system takes part in the step: the step’s contact problems were made for its old constraints

void initializeConstraints()

Internal: build the pin constraints stored by addConstraints().

inline void setComputeInverseDynamics(bool flag)

If it is true, it also computes inverse dynamics and you can get the following properties: the force and torque (including the constrained directions) at the joint and acceleration of a body (necessary for IMU computation)

Parameters:

flag – [in] True to compute inverse dynamics each update.

inline bool getComputeInverseDynamics() const
Returns:

return if the inverse dynamics is computed

inline const raisim::Vec<3> &getForceAtJointInWorldFrame(size_t jointId) const

YOU MUST CALL raisim::ArticulatedSystem::setComputeInverseDynamics(true) before calling this method. This method returns the force at the specified joint, computed in the last integration step

Parameters:

jointId – [in] the joint id (body index)

Returns:

world-frame force transmitted through the joint [N]

inline const raisim::Vec<3> &getTorqueAtJointInWorldFrame(size_t jointId) const

YOU MUST CALL raisim::ArticulatedSystem::setComputeInverseDynamics(true) before calling this method. This method returns the torque at the specified joint, computed in the last integration step

Parameters:

jointId – [in] the joint id (body index)

Returns:

world-frame torque transmitted through the joint, about the joint position [Nm]

inline int getAllowedNumberOfInternalContactsBetweenTwoBodies() const

Default is 1. This number limits the number of possible contacts between two bodies.

Returns:

the number of possible contacts between two bodies

inline void setAllowedNumberOfInternalContactsBetweenTwoBodies(int count)

Default is 1. This sets the number of possible contacts between two bodies

Parameters:

count – [in] Maximum number of internal contacts between two bodies.

void articulatedBodyAlgorithm(const Vec<3> &gravity, double dt, bool holdActuatorTorques = false)

to be removed. just for testing purposes

Internal (testing only): run the articulated body algorithm for one step.

Parameters:
  • gravity – [in] gravitational acceleration

  • dt – [in] time step [s]

inline const std::vector<MatDyn> &getMinvJT()
Returns:

Internal (testing only).

inline const std::vector<VecDyn> &getj_MinvJT_T1D()
Returns:

Internal (testing only).

inline const raisim::VecDyn &getUdot()
Returns:

Internal (testing only).

void getFullDelassusAndTauStar(double dt)

Internal (testing only).

Parameters:

dt – [in] time step

inline virtual bool getContactSolverSparseAccess(size_t pointId, const SparseJacobian *&J, const MatDyn *&MinvJT, VecDyn *&genVel) final

Internal: sparse counterpart for articulated systems: direct pointers to the per-contact sparse jacobian, the dense (3 x dof) MinvJT (applied transposed) and the generalized velocity, so the contact solver can inline the velocity updates instead of dispatching virtually in the iteration loop on failure the outputs are nulled (see getContactSolverDirectAccess)

Parameters:
  • pointId – [in] contact index

  • J – [out] sparse contact Jacobian

  • MinvJT – [out] dense (3 x dof) M^-1 J^T

  • genVel – [out] solver generalized velocity

Returns:

true if sparse access is supported

void appendJointLimits(contact::ContactProblems &problem) final

Internal: append violated joint limits to the contact problem list.

Parameters:

problem – [inout] contact problems of the world

Public Static Functions

static inline void convertSparseJacobianToDense(const SparseJacobian &sparseJaco, Eigen::MatrixXd &denseJaco)

Only the non-zero columns are written; denseJaco must be pre-sized to 3 x getDOF() and zeroed.

Parameters:
  • sparseJaco – [in] sparse Jacobian (either positional or rotational)

  • denseJaco – [out] the corresponding dense Jacobian

struct IKOptions

Options for solveIK().

Public Members

int maxIterations

Maximum number of solver updates (at least 1 is used).

double positionTolerance

Success threshold on the frame position error [m].

double orientationTolerance

Success threshold on the frame orientation error (rotation-vector norm) [rad]. Used only with useOrientation.

double orientationWeight

Weight of the orientation error relative to the position error. 0 disables the orientation task.

double damping

Damping factor of the “dls” method (lambda; lambda^2 is added to J*J^T).

double stepSize

Scale applied to each update.

double maxStep

The largest absolute component of each generalized-velocity-space update is clamped to this value.

double svdTolerance

Eigenvalue cutoff (applied as svdTolerance^2 to J*J^T) of the “pinv” and “svd” methods.

double finiteDifferenceStep

Step used to compute the rotational Jacobian columns by finite differences.

bool useOrientation

If true, the orientation target is also tracked.

bool applySolution

If true, the converged solution is written to the system’s generalized coordinate. Otherwise, the generalized coordinate is restored to its value before the call.

bool applyBestOnFailure

If true (and applySolution is true), the best iterate is applied when the solver does not converge. Otherwise, a failed solve restores the original generalized coordinate.

bool enforceJointLimits

If true, revolute/prismatic joints with a position limit are clamped to it after every update.

std::string inverseMethod

Update rule: “dls” (damped least squares), “pinv”/”svd” (pseudo-inverse), or “transpose” (Jacobian transpose).

double transposeGain

Gain of the “transpose” method.

std::vector<double> seed

Optional initial generalized coordinate (size getGeneralizedCoordinateDim()). Empty means the current state.

struct IKResult

Result of solveIK().

Public Members

bool success

True if both the position and (if enabled) orientation tolerances were met.

int iterations

Index of the last evaluated iteration.

int bestIteration

Index of the iteration with the lowest residual.

double residual

Combined residual: sqrt(positionResidual^2 + (orientationWeight * orientationResidual)^2).

double positionResidual

Frame position error norm [m].

double orientationResidual

Frame orientation error norm [rad] (0 if the orientation task is disabled).

double bestResidual

Lowest combined residual found.

double bestPositionResidual

Position residual of the best iterate [m].

double bestOrientationResidual

Orientation residual of the best iterate [rad].

std::vector<double> solution

Resulting generalized coordinate. On a failure without applyBestOnFailure, this is the original one.

std::vector<double> bestSolution

Generalized coordinate of the best iterate.

Vec<3> bestFramePosition

World-frame position of the frame at the best iterate [m].

Mat<3, 3> bestFrameOrientation

World-frame orientation of the frame at the best iterate.

std::string message

“ok” on success; otherwise a description of the failure.

struct SpringElement

A linear/torsional spring acting at the joint of a body (see addSpring()).

Public Functions

inline void setSpringMount(const Eigen::Vector4d &qRef)
Parameters:

qRef – [in] spring rest configuration (see q_ref)

inline Eigen::Vector4d getSpringMount()
Returns:

spring rest configuration (see q_ref)

Public Members

size_t childBodyId

Body index of the body whose parent joint the spring acts on.

double stiffness

spring stiffness [Nm/rad or N/m]

Vec<4> q_ref

Rest configuration: q_ref[0] for revolute/prismatic joints, a quaternion (w,x,y,z) for spherical joints.

class LinkRef

Lightweight handle to a body (link) of an ArticulatedSystem, obtained by getLink(). It stores a raw pointer to the system, which must outlive the handle.

Public Functions

inline LinkRef(size_t localId, ArticulatedSystem *system)
Parameters:
  • localId – [in] body index

  • system – [in] the owning articulated system

inline void getPosition(Vec<3> &position) const
Parameters:

position – [out] world-frame position of the body frame origin (its parent joint) [m]

inline void getOrientation(Mat<3, 3> &orientation) const
Parameters:

orientation – [out] world-frame orientation of the body frame

inline void getPose(Vec<3> &position, Mat<3, 3> &orientation) const
Parameters:
  • position – [out] world-frame position of the body frame origin [m]

  • orientation – [out] world-frame orientation of the body frame

inline CollisionDefinition *getCollisionDefinition(const std::string &name)
Parameters:

name – [in] collision body name (e.g., “LINK_NAME/0” for URDF models)

Returns:

the collision body of this link, or nullptr if not found. Owned by the system.

inline VisObject *getVisualObject(const std::string &name)
Parameters:

name – [in] visual object name

Returns:

the visual object of this link, or nullptr if not found. Owned by the system.

inline void setWeight(double weight)

Set the body mass and call ArticulatedSystem::updateMassInfo().

Parameters:

weight – [in] mass [kg]

inline double getWeight() const
Returns:

body mass [kg]

inline void setInertia(const Mat<3, 3> &inertia)
Parameters:

inertia – [in] inertia about the body COM, expressed in the body frame [kg m^2]

inline const Mat<3, 3> &getInertia() const
Returns:

inertia about the body COM, expressed in the body frame [kg m^2]

inline void setComPositionInParentFrame(const Vec<3> &com)

Set the center of mass position. Despite the name, it is expressed in this body’s own frame (the same storage as ArticulatedSystem::getBodyCOM_B()).

Parameters:

com – [in] COM position in the body frame [m]

inline const Vec<3> &getComPositionInParentFrame() const

Despite the name, the returned position is expressed in this body’s own frame (the same storage as ArticulatedSystem::getBodyCOM_B()).

Returns:

COM position in the body frame [m]

inline const std::unordered_map<std::string, CollisionDefinition*> &getCollisionSet() const
Returns:

collision bodies of this link, keyed by name (collected when the LinkRef was created)

inline const std::unordered_map<std::string, VisObject*> &getVisualSet() const
Returns:

visual objects of this link, keyed by name (collected when the LinkRef was created)

class JointRef

Lightweight handle to a joint (coordinate frame) of an ArticulatedSystem, obtained by getJoint(). It stores a raw pointer to the system, which must outlive the handle. Joint-coordinate accessors are fatal for fixed joints.

Public Functions

inline JointRef(size_t frameId, ArticulatedSystem *system)
Parameters:
  • frameId – [in] index of the joint’s coordinate frame (see getFrameIdxByName())

  • system – [in] the owning articulated system

inline void getPosition(Vec<3> &position) const
Parameters:

position – [out] world-frame position of the joint frame [m]

inline Mat<3, 3> getOrientation() const
Returns:

world-frame orientation of the joint frame

inline void getPose(Vec<3> &position, Mat<3, 3> &orientation) const
Parameters:
  • position – [out] world-frame position of the joint frame [m]

  • orientation – [out] world-frame orientation of the joint frame

inline void getJointCoordinate(VecDyn &coordinate) const

Get this joint’s segment of the generalized coordinate.

Parameters:

coordinate – [out] resized to 1 (revolute/prismatic), 4 (spherical, quaternion w,x,y,z) or 7 (floating: position + quaternion). Fatal for a fixed joint.

inline double getJointAngle() const

Only for revolute and prismatic joints (fatal otherwise).

Returns:

joint position [rad or m]

inline const raisim::Vec<3> &getPositionInParentFrame() const

Fatal for a fixed joint.

Returns:

joint position relative to the parent body, expressed in the parent body frame [m] (see ArticulatedSystem::getJointPos_P())

inline const raisim::Vec<3> &getJointAxis() const

Fatal for a fixed joint.

Returns:

joint axis expressed in the joint frame (see ArticulatedSystem::getJointAxis_P())

inline Joint::Type getType() const
Returns:

joint type

inline size_t getIdxInGeneralizedCoordinate() const
Returns:

index of this joint’s first element in the generalized coordinate, or size_t(-1) for a fixed joint

inline Vec<3> getLinearVelocity() const
Returns:

world-frame linear velocity of the joint frame origin [m/s]