17 #ifndef MESSAGES_UTILITY_H
18 #define MESSAGES_UTILITY_H
22 #include "msgs/MessageTypes.hh"
49 const std::string &_data =
"");
54 void Init(google::protobuf::Message &_message,
const std::string &_id =
"");
58 void Stamp(msgs::Header *_header);
62 void Stamp(msgs::Time *_time);
65 std::string Package(
const std::string &type,
66 const google::protobuf::Message &message);
72 msgs::Vector3d
Convert(
const math::Vector3 &_v);
77 msgs::Quaternion
Convert(
const math::Quaternion &_q);
82 msgs::Pose
Convert(
const math::Pose &_p);
87 msgs::Color
Convert(
const common::Color &_c);
92 msgs::Time
Convert(
const common::Time &_t);
97 msgs::PlaneGeom
Convert(
const math::Plane &_p);
102 math::Vector3
Convert(
const msgs::Vector3d &_v);
107 math::Quaternion
Convert(
const msgs::Quaternion &_q);
112 math::Pose
Convert(
const msgs::Pose &_p);
117 void Set(common::Image &_img,
const msgs::Image &_msg);
122 common::Color
Convert(
const msgs::Color &_c);
127 common::Time
Convert(
const msgs::Time &_t);
132 math::Plane
Convert(
const msgs::PlaneGeom &_p);
137 void Set(msgs::Image *_msg,
const common::Image &_i);
142 void Set(msgs::Vector3d *_pt,
const math::Vector3 &_v);
147 void Set(msgs::Vector2d *_pt,
const math::Vector2d &_v);
152 void Set(msgs::Quaternion *_q,
const math::Quaternion &_v);
157 void Set(msgs::Pose *_p,
const math::Pose &_v);
162 void Set(msgs::Color *_c,
const common::Color &_v);
167 void Set(msgs::Time *_t,
const common::Time &_v);
172 void Set(msgs::PlaneGeom *_p,
const math::Plane &_v);
206 const google::protobuf::FieldDescriptor *GetFD(
207 google::protobuf::Message &message,
const std::string &name);
213 msgs::Header *
GetHeader(google::protobuf::Message &_message);