17 #ifndef GAZEBO_PHYSICS_INERTIAL_HH_ 18 #define GAZEBO_PHYSICS_INERTIAL_HH_ 23 #include <ignition/math/Inertial.hh> 25 #include <ignition/math/Vector3.hh> 26 #include <ignition/math/Quaternion.hh> 27 #include <ignition/math/Matrix3.hh> 38 class InertialPrivate;
52 public:
explicit Inertial(
const double _mass);
57 public:
Inertial(
const ignition::math::Inertiald &_inertial);
68 public:
void Load(sdf::ElementPtr _sdf);
72 public:
void UpdateParameters(sdf::ElementPtr _sdf);
78 public: ignition::math::Inertiald Ign()
const;
82 public:
void SetMass(
const double _m);
86 public:
double Mass()
const;
95 public:
void SetInertiaMatrix(
96 const double _ixx,
const double _iyy,
const double _izz,
97 const double _ixy,
const double _ixz,
const double iyz);
103 public:
void SetCoG(
const double _cx,
const double _cy,
const double _cz);
107 public:
void SetCoG(
const ignition::math::Vector3d &_center);
117 public:
void SetCoG(
const double _cx,
const double _cy,
const double _cz,
118 const double _rx,
const double _ry,
const double _rz);
122 public:
void SetCoG(
const ignition::math::Pose3d &_c);
126 public:
const ignition::math::Vector3d &CoG()
const;
131 public: ignition::math::Pose3d Pose()
const;
135 public:
const ignition::math::Vector3d &PrincipalMoments()
const;
139 public:
const ignition::math::Vector3d &ProductsOfInertia()
const;
143 public:
double IXX()
const;
147 public:
double IYY()
const;
151 public:
double IZZ()
const;
155 public:
double IXY()
const;
159 public:
double IXZ()
const;
163 public:
double IYZ()
const;
167 public:
void SetIXX(
const double _v);
171 public:
void SetIYY(
const double _v);
175 public:
void SetIZZ(
const double _v);
179 public:
void SetIXY(
const double _v);
183 public:
void SetIXZ(
const double _v);
187 public:
void SetIYZ(
const double _v);
191 public:
void Rotate(
const ignition::math::Quaterniond &_rot);
201 public:
Inertial &operator=(
const ignition::math::Inertiald &_inertial);
219 public:
void ProcessMsg(
const msgs::Inertial &_msg);
229 public: ignition::math::Matrix3d MOI(
230 const ignition::math::Pose3d &_pose)
const;
238 const ignition::math::Pose3d &_frameOffset)
const;
246 const ignition::math::Vector3d &_frameOffset)
const;
254 _out <<
"Mass[" << _inertial.
Mass() <<
"] CoG[" 255 << _inertial.
CoG() <<
"]\n";
267 public: ignition::math::Matrix3d MOI()
const;
271 public:
void SetMOI(
const ignition::math::Matrix3d &_moi);
275 private: std::unique_ptr<InertialPrivate> dataPtr;
const ignition::math::Vector3d & PrincipalMoments() const
Get the principal moments of inertia (Ixx, Iyy, Izz).
Forward declarations for the common classes.
Definition: Animation.hh:26
const ignition::math::Vector3d & ProductsOfInertia() const
Get the products of inertia (Ixy, Ixz, Iyz).
const ignition::math::Vector3d & CoG() const
Get the center of gravity.
double Mass() const
Get the mass.
A class for inertial information about a link.
Definition: Inertial.hh:45
friend std::ostream & operator<<(std::ostream &_out, const gazebo::physics::Inertial &_inertial)
Output operator.
Definition: Inertial.hh:251