Single-Body Objects¶
SingleBodyObject API (Parent class)¶
-
class raisim::SingleBodyObject : public raisim::Object¶
this class is only for inheritance
Subclassed by raisim::Box, raisim::Capsule, raisim::Compound, raisim::Cone, raisim::Cylinder, raisim::Ground, raisim::HeightMap, raisim::Mesh, raisim::Sphere
Public Functions
-
inline Eigen::Vector4d getQuaternion() const¶
returns the quaternion in Eigen::Vector4d
- Returns
the orientation of the object
-
inline void getQuaternion(Vec<4> &quat) const¶
returns the quaternion in raisim::Vec<4>
- Parameters
quat – [out] the orientation of the object
-
inline Eigen::Matrix3d getRotationMatrix() const¶
returns the rotation matrix in Eigen::Matrix3d
- Returns
the orientation of the object
-
inline void getRotationMatrix(Mat<3, 3> &rotation) const¶
returns the quaternion in raisim::Mat<3,3>
- Parameters
rotation – [out] the orientation of the object
-
inline Eigen::Vector3d getPosition() const¶
returns the body position in Eigen::Vector3d. Currently, all body positions are the same as the COM position
- Returns
the position of the object
-
inline Eigen::Vector3d getComPosition() const¶
returns the body position in Eigen::Vector3d. Currently, all body positions are the same as the COM position
- Returns
the position of the object
-
inline const raisim::Vec<3> &getComPosition_rs() const¶
returns the body position in raisim::Vec<3>. Currently, all body positions are the same as the COM position
- Returns
the position of the object
-
inline const raisim::Vec<3> &getBodyToComPosition_rs() const¶
returns the body position in raisim::Vec<3>. Currently, all body positions are the same as the COM position
- Returns
the position of the object
-
inline Eigen::Vector3d getLinearVelocity() const¶
returns the linear velocity
- Returns
the linear velocity of the object
-
inline void getLinearVelocity(Vec<3> &linVel)¶
returns the linear velocity
- Parameters
linVel – [out] the linear velocity of the object
-
inline Eigen::Vector3d getAngularVelocity() const¶
returns the angular velocity
- Returns
the angular velocity of the object
-
inline void getAngularVelocity(Vec<3> &angVel)¶
returns the angular velocity
- Parameters
angVel – [out] the angular velocity of the object
-
double getKineticEnergy() const¶
returns the kinetic energy
- Returns
the kinetic energy of the object
-
double getPotentialEnergy(const Vec<3> &gravity) const¶
returns the potential energy w.r.t. z=0 and the given gravitational acceleration param[in] gravity gravitational acceleration
- Returns
the potential energy of the object
-
double getEnergy(const Vec<3> &gravity) const¶
equivalent to getKineticEnergy() + getPotentialEnergy(gravity) param[in] gravity gravitational acceleration
- Returns
the sum of the potential and gravitational energy of the object
-
Eigen::Vector3d getLinearMomentum() const¶
returns the linear momentum of the object
- Returns
the linear momentum of the object
-
virtual double getMass(size_t localIdx = 0) const override¶
returns the mass of the object. The localIdx is unused
- Returns
the linear momentum of the object
-
inline void setMass(double mass)¶
set the mass of the object.
- Parameters
mass – [in] set the mass of the object
-
inline Eigen::Matrix3d getInertiaMatrix_B() const¶
get the inertia matrix in the body frame. This value is constant.
- Returns
the inertia matrix in the body frame
-
inline Eigen::Matrix3d getInertiaMatrix_W() const¶
get the inertia matrix in the world frame. This value changes as the body rotates.
- Returns
the inertia matrix in the world frame
-
inline const raisim::Mat<3, 3> &getInertiaMatrix_B_rs() const¶
get the inertia matrix in the body frame (raisim matrix type). This value is constant.
- Returns
the inertia matrix in the body frame
-
inline const raisim::Mat<3, 3> &getInertiaMatrix_W_rs() const¶
get the inertia matrix in the world frame (raisim matrix type). This value changes as the body rotates.
- Returns
the inertia matrix in the world frame
-
virtual ObjectType getObjectType() const final¶
get the object type. Possible types are SPHERE, BOX, CYLINDER, CONE, CAPSULE, MESH, HALFSPACE, COMPOUND, HEIGHTMAP, ARTICULATED_SYSTEM
- Returns
the object type
-
virtual void setExternalForce(size_t localIdx, const Vec<3> &force) final¶
apply forces at the Center of Mass
-
virtual void setExternalTorque(size_t localIdx, const Vec<3> &torque) final¶
apply torque on a body
-
virtual void setExternalForce(size_t localIdx, const Vec<3> &pos, const Vec<3> &force) final¶
apply force (expressed in the world frame) at specific location of the body (expressed in the body frame)
-
virtual void setConstraintForce(size_t localIdx, const Vec<3> &pos, const Vec<3> &force) final¶
apply spring force (expressed in the world frame) at specific location of the body (expressed in the body frame)
-
virtual void getContactPointVel(size_t pointId, Vec<3> &vel) const final¶
get the contact point velocity in the world frame.
- Parameters
pointId – [in] the contact index. This is an index of a contact in the contact vector that you can retrieve from getContacts().
vel – [out] the contact point velocity in the world frame
-
inline Eigen::Vector4d getQuaternion() const¶
Sphere API¶
-
class raisim::Sphere : public raisim::SingleBodyObject¶
Box API¶
-
class raisim::Box : public raisim::SingleBodyObject¶
Capsule API¶
-
class raisim::Capsule : public raisim::SingleBodyObject¶
Cylinder API¶
-
class raisim::Cylinder : public raisim::SingleBodyObject¶
Ground API¶
-
class raisim::Ground : public raisim::SingleBodyObject¶
Public Functions
-
inline double getHeight()¶
returns the height of the plane
- Returns
the height
-
inline double getHeight()¶