Ignition Msgs

API Reference

5.8.1
Utility.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef IGNITION_MSGS_UTILITY_HH_
18 #define IGNITION_MSGS_UTILITY_HH_
19 
20 #include <string>
21 #include <utility>
22 #include <vector>
23 
25 #include <ignition/math/Color.hh>
27 #include <ignition/math/Pose3.hh>
28 #include <ignition/math/Plane.hh>
29 #include <ignition/math/Vector3.hh>
30 
31 #include "ignition/msgs/config.hh"
32 #include "ignition/msgs/Export.hh"
34 
38 
39 namespace ignition
40 {
41  namespace msgs
42  {
43  // Inline bracket to help doxygen filtering.
44  inline namespace IGNITION_MSGS_VERSION_NAMESPACE {
45  //
49  IGNITION_MSGS_VISIBLE
51 
55  IGNITION_MSGS_VISIBLE
57 
61  IGNITION_MSGS_VISIBLE
63 
67  IGNITION_MSGS_VISIBLE
69 
73  IGNITION_MSGS_VISIBLE
75 
79  IGNITION_MSGS_VISIBLE
81 
85  IGNITION_MSGS_VISIBLE
87 
92  IGNITION_MSGS_VISIBLE
94 
99  IGNITION_MSGS_VISIBLE
101 
105  IGNITION_MSGS_VISIBLE
107 
111  IGNITION_MSGS_VISIBLE
112  bool Convert(const msgs::Boolean &_m);
113 
117  IGNITION_MSGS_VISIBLE
118  int32_t Convert(const msgs::Int32 &_m);
119 
123  IGNITION_MSGS_VISIBLE
124  uint32_t Convert(const msgs::UInt32 &_m);
125 
129  IGNITION_MSGS_VISIBLE
130  int64_t Convert(const msgs::Int64 &_m);
131 
135  IGNITION_MSGS_VISIBLE
136  uint64_t Convert(const msgs::UInt64 &_m);
137 
141  IGNITION_MSGS_VISIBLE
142  double Convert(const msgs::Double &_m);
143 
147  IGNITION_MSGS_VISIBLE
148  float Convert(const msgs::Float &_m);
149 
153  IGNITION_MSGS_VISIBLE
155 
159  IGNITION_MSGS_VISIBLE
161 
165  IGNITION_MSGS_VISIBLE
167 
171  IGNITION_MSGS_VISIBLE
173 
177  IGNITION_MSGS_VISIBLE
179 
183  IGNITION_MSGS_VISIBLE
185 
189  IGNITION_MSGS_VISIBLE
191 
195  IGNITION_MSGS_VISIBLE
197 
201  IGNITION_MSGS_VISIBLE
203 
207  IGNITION_MSGS_VISIBLE
208  msgs::Boolean Convert(const bool &_b);
209 
213  IGNITION_MSGS_VISIBLE
214  msgs::Int32 Convert(const int32_t &_i);
215 
219  IGNITION_MSGS_VISIBLE
220  msgs::UInt32 Convert(const uint32_t &_u);
221 
225  IGNITION_MSGS_VISIBLE
226  msgs::Int64 Convert(const int64_t &_i);
227 
231  IGNITION_MSGS_VISIBLE
232  msgs::UInt64 Convert(const uint64_t &_u);
233 
237  IGNITION_MSGS_VISIBLE
238  msgs::Double Convert(const double &_d);
239 
243  IGNITION_MSGS_VISIBLE
244  msgs::Float Convert(const float &_f);
245 
250  IGNITION_MSGS_VISIBLE
252 
257  IGNITION_MSGS_VISIBLE
259 
263  IGNITION_MSGS_VISIBLE
265 
269  IGNITION_MSGS_VISIBLE
271 
275  IGNITION_MSGS_VISIBLE
277 
280  // \param[in] _t PixelFormatType enum value.
282  IGNITION_MSGS_VISIBLE
284 
289  IGNITION_MSGS_VISIBLE
291 
296  IGNITION_MSGS_VISIBLE
298 
302  IGNITION_MSGS_VISIBLE
304 
308  IGNITION_MSGS_VISIBLE
310 
314  IGNITION_MSGS_VISIBLE
316 
320  IGNITION_MSGS_VISIBLE
321  void Set(msgs::Pose *_p, const ignition::math::Pose3d &_v);
322 
326  IGNITION_MSGS_VISIBLE
327  void Set(msgs::Color *_c, const math::Color &_v);
328 
332  IGNITION_MSGS_VISIBLE
333  void Set(msgs::Inertial *_i, const math::Inertiald &_m);
334 
338  IGNITION_MSGS_VISIBLE
339  void Set(msgs::Inertial *_i, const math::MassMatrix3d &_m);
340 
344  IGNITION_MSGS_VISIBLE
346 
350  IGNITION_MSGS_VISIBLE
351  void Set(msgs::StringMsg *_p, const std::string &_v);
352 
356  IGNITION_MSGS_VISIBLE
357  void Set(msgs::Boolean *_p, const bool &_v);
358 
362  IGNITION_MSGS_VISIBLE
363  void Set(msgs::Int32 *_p, const int32_t &_v);
364 
368  IGNITION_MSGS_VISIBLE
369  void Set(msgs::UInt32 *_p, const uint32_t &_v);
370 
374  IGNITION_MSGS_VISIBLE
375  void Set(msgs::Int64 *_p, const int64_t &_v);
376 
380  IGNITION_MSGS_VISIBLE
381  void Set(msgs::UInt64 *_p, const uint64_t &_v);
382 
386  IGNITION_MSGS_VISIBLE
387  void Set(msgs::Double *_p, const double &_v);
388 
392  IGNITION_MSGS_VISIBLE
393  void Set(msgs::Float *_p, const float &_v);
394 
398  IGNITION_MSGS_VISIBLE
400 
416  IGNITION_MSGS_VISIBLE
418  const std::string &_frameId, bool _memoryAligned,
421 
424  // \param[in] _t Type of the discovery message.
426  IGNITION_MSGS_VISIBLE
428 
440  IGNITION_MSGS_VISIBLE
441  bool ConvertFuelMetadata(const std::string &_modelConfigStr,
442  msgs::FuelMetadata &_meta);
443 
455  IGNITION_MSGS_VISIBLE
457  std::string &_modelConfigStr);
458  }
459  }
460 }
461 #endif
Definition: axis_aligned_box.pb.h:85
Definition: boolean.pb.h:84
Definition: color.pb.h:84
Definition: double.pb.h:84
Definition: float.pb.h:84
Definition: fuel_metadata.pb.h:1181
Definition: inertial.pb.h:85
Definition: int32.pb.h:84
Definition: int64.pb.h:84
Definition: planegeom.pb.h:86
Definition: pointcloud_packed.pb.h:346
Definition: pose.pb.h:86
Definition: quaternion.pb.h:84
Definition: stringmsg.pb.h:84
Definition: uint32.pb.h:84
Definition: uint64.pb.h:84
Definition: vector2d.pb.h:84
Definition: vector3d.pb.h:84
#define IGNITION_MSGS_VERSION_NAMESPACE
Definition: config.hh:11
msgs::Geometry::Type ConvertGeometryType(const std::string &_str)
Convert a string to a msgs::Geometry::Type enum.
void Set(msgs::Vector3d *_pt, const ignition::math::Vector3d &_v)
Set a msgs::Vector3d from an ignition::math::Vector3d.
ignition::math::Vector3d Convert(const msgs::Vector3d &_v)
Convert a msgs::Vector3d to an ignition::math::Vector.
msgs::Material::ShaderType ConvertShaderType(const std::string &_str)
Convert a string to a msgs::Material::ShaderType enum.
std::string ToString(const msgs::Discovery::Type &_t)
Convert a Discovery::Type to a string. This can be used for debugging purposes.
msgs::PixelFormatType ConvertPixelFormatType(const std::string &_str)
Convert a string to a msgs::PixelFormatType enum.
Material_ShaderType
Definition: material.pb.h:117
msgs::Joint::Type ConvertJointType(const std::string &_str)
Convert a string to a msgs::Joint::Type enum.
Joint_Type
Definition: joint.pb.h:93
PointCloudPacked_Field_DataType
Definition: pointcloud_packed.pb.h:86
bool ConvertFuelMetadata(const std::string &_modelConfigStr, msgs::FuelMetadata &_meta)
Convert the contents of a model.config file, in the form of an XML string, to a FuelMetadata message.
void InitPointCloudPacked(msgs::PointCloudPacked &_msg, const std::string &_frameId, bool _memoryAligned, const std::vector< std::pair< std::string, msgs::PointCloudPacked::Field::DataType >> &_fields)
This function will set the header and field members of a PointCloudPacked message....
Geometry_Type
Definition: geometry.pb.h:91
Discovery_Type
Definition: discovery.pb.h:128
PixelFormatType
Definition: image.pb.h:82