17 #ifndef MESSAGES_UTILITY_H
18 #define MESSAGES_UTILITY_H
24 #include "gazebo/msgs/MessageTypes.hh"
53 const std::string &_data =
"");
59 void Init(google::protobuf::Message &_message,
const std::string &_id =
"");
64 void Stamp(msgs::Header *_header);
69 void Stamp(msgs::Time *_time);
73 std::string Package(
const std::string &type,
74 const google::protobuf::Message &message);
81 msgs::Vector3d
Convert(
const math::Vector3 &_v);
87 msgs::Quaternion
Convert(
const math::Quaternion &_q);
93 msgs::Pose
Convert(
const math::Pose &_p);
99 msgs::Color
Convert(
const common::Color &_c);
105 msgs::Time
Convert(
const common::Time &_t);
111 msgs::PlaneGeom
Convert(
const math::Plane &_p);
117 math::Vector3
Convert(
const msgs::Vector3d &_v);
123 math::Quaternion
Convert(
const msgs::Quaternion &_q);
129 math::Pose
Convert(
const msgs::Pose &_p);
135 void Set(common::Image &_img,
const msgs::Image &_msg);
141 common::Color
Convert(
const msgs::Color &_c);
147 common::Time
Convert(
const msgs::Time &_t);
153 math::Plane
Convert(
const msgs::PlaneGeom &_p);
159 void Set(msgs::Image *_msg,
const common::Image &_i);
165 void Set(msgs::Vector3d *_pt,
const math::Vector3 &_v);
171 void Set(msgs::Vector2d *_pt,
const math::Vector2d &_v);
177 void Set(msgs::Quaternion *_q,
const math::Quaternion &_v);
183 void Set(msgs::Pose *_p,
const math::Pose &_v);
189 void Set(msgs::Color *_c,
const common::Color &_v);
195 void Set(msgs::Time *_t,
const common::Time &_v);
201 void Set(msgs::SphericalCoordinates *_s,
202 const common::SphericalCoordinates &_v);
208 void Set(msgs::PlaneGeom *_p,
const math::Plane &_v);
260 const google::protobuf::FieldDescriptor *GetFD(
261 google::protobuf::Message &message,
const std::string &name);
268 msgs::Header *
GetHeader(google::protobuf::Message &_message);