msgs.h
00001 /* 00002 * Copyright 2011 Nate Koenig & Andrew Howard 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 * 00016 */ 00017 #ifndef MESSAGES_UTILITY_HH 00018 #define MESSAGES_UTILITY_HH 00019 00020 #include "msgs/MessageTypes.hh" 00021 #include "sdf/sdf.h" 00022 00023 #include "math/MathTypes.hh" 00024 #include "math/Vector3.hh" 00025 #include "math/Pose.hh" 00026 #include "math/Plane.hh" 00027 #include "math/Box.hh" 00028 00029 #include "common/Color.hh" 00030 #include "common/Time.hh" 00031 00032 namespace gazebo 00033 { 00036 namespace msgs 00037 { 00041 00046 msgs::Request *CreateRequest(const std::string &_request, 00047 const std::string &_data = ""); 00048 00049 00053 void Init(google::protobuf::Message &_message, const std::string &_id=""); 00054 00057 void Stamp(msgs::Header *_header); 00058 00061 void Stamp(msgs::Time *_time); 00062 00064 std::string Package(const std::string &type, 00065 const google::protobuf::Message &message); 00067 00071 msgs::Vector3d Convert(const math::Vector3 &_v); 00072 00076 msgs::Quaternion Convert(const math::Quaternion &_q); 00077 00081 msgs::Pose Convert(const math::Pose &_p); 00082 00086 msgs::Color Convert(const common::Color &_c); 00087 00091 msgs::Time Convert(const common::Time &_t); 00092 00096 msgs::PlaneGeom Convert(const math::Plane &_p); 00097 00101 math::Vector3 Convert(const msgs::Vector3d &_v); 00102 00106 math::Quaternion Convert(const msgs::Quaternion &_q); 00107 00111 math::Pose Convert(const msgs::Pose &_p); 00112 00116 common::Color Convert(const msgs::Color &_c); 00117 00121 common::Time Convert(const msgs::Time &_t); 00122 00126 math::Plane Convert(const msgs::PlaneGeom &_p); 00127 00131 void Set(msgs::Vector3d *_pt, const math::Vector3 &_v); 00132 00136 void Set(msgs::Vector2d *_pt, const math::Vector2d &_v); 00137 00141 void Set(msgs::Quaternion *_q, const math::Quaternion &_v); 00142 00146 void Set(msgs::Pose *_p, const math::Pose &_v); 00147 00151 void Set(msgs::Color *_c, const common::Color &_v); 00152 00156 void Set(msgs::Time *_t, const common::Time &_v); 00157 00161 void Set(msgs::PlaneGeom *_p, const math::Plane &_v); 00162 00166 msgs::TrackVisual TrackVisualFromSDF( sdf::ElementPtr _sdf ); 00167 00171 msgs::GUI GUIFromSDF(sdf::ElementPtr _sdf); 00172 00176 msgs::Light LightFromSDF(sdf::ElementPtr _sdf); 00177 00181 msgs::Visual VisualFromSDF(sdf::ElementPtr _sdf); 00182 00186 msgs::Fog FogFromSDF(sdf::ElementPtr _sdf); 00187 00191 msgs::Scene SceneFromSDF(sdf::ElementPtr _sdf); 00192 00194 const google::protobuf::FieldDescriptor *GetFD(google::protobuf::Message &message, const std::string &name); 00196 00200 msgs::Header *GetHeader(google::protobuf::Message &_message); 00201 00203 } 00204 } 00205 00206 #endif

1.7.5.1