17 #ifndef GZ_MSGS_CONVERT_INERTIAL_HH_
18 #define GZ_MSGS_CONVERT_INERTIAL_HH_
24 #include "gz/msgs/inertial.pb.h"
27 #include <gz/math/Inertial.hh>
28 #include <gz/math/MassMatrix3.hh>
32 inline namespace GZ_MSGS_VERSION_NAMESPACE {
37 _msg->set_mass(_data.
Mass());
38 _msg->set_ixx(_data.
Ixx());
39 _msg->set_iyy(_data.
Iyy());
40 _msg->set_izz(_data.
Izz());
41 _msg->set_ixy(_data.
Ixy());
42 _msg->set_ixz(_data.
Ixz());
43 _msg->set_iyz(_data.
Iyz());
44 _msg->mutable_pose()->mutable_orientation()->set_w(1);
60 gz::msgs::Inertial ret;
69 Set(_msg->mutable_pose(), _data.
Pose());
104 Set(&pose_to_set, _msg.pose());
107 if (_msg.fluid_added_mass_size() == 21)
110 _msg.fluid_added_mass(0),
111 _msg.fluid_added_mass(1),
112 _msg.fluid_added_mass(2),
113 _msg.fluid_added_mass(3),
114 _msg.fluid_added_mass(4),
115 _msg.fluid_added_mass(5),
117 _msg.fluid_added_mass(1),
118 _msg.fluid_added_mass(6),
119 _msg.fluid_added_mass(7),
120 _msg.fluid_added_mass(8),
121 _msg.fluid_added_mass(9),
122 _msg.fluid_added_mass(10),
124 _msg.fluid_added_mass(2),
125 _msg.fluid_added_mass(7),
126 _msg.fluid_added_mass(11),
127 _msg.fluid_added_mass(12),
128 _msg.fluid_added_mass(13),
129 _msg.fluid_added_mass(14),
131 _msg.fluid_added_mass(3),
132 _msg.fluid_added_mass(8),
133 _msg.fluid_added_mass(12),
134 _msg.fluid_added_mass(15),
135 _msg.fluid_added_mass(16),
136 _msg.fluid_added_mass(17),
138 _msg.fluid_added_mass(4),
139 _msg.fluid_added_mass(9),
140 _msg.fluid_added_mass(13),
141 _msg.fluid_added_mass(16),
142 _msg.fluid_added_mass(18),
143 _msg.fluid_added_mass(19),
145 _msg.fluid_added_mass(5),
146 _msg.fluid_added_mass(10),
147 _msg.fluid_added_mass(14),
148 _msg.fluid_added_mass(17),
149 _msg.fluid_added_mass(19),
150 _msg.fluid_added_mass(20)
158 gz::msgs::Inertial ret;