Gazebo Gazebo

API Reference

6.16.0
gz/sim/Conversions.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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 GZ_GAZEBO_CONVERSIONS_HH_
18 #define GZ_GAZEBO_CONVERSIONS_HH_
19 
20 #include <gz/msgs/actor.pb.h>
21 #include <gz/msgs/atmosphere.pb.h>
22 #include <gz/msgs/axis.pb.h>
23 #include <gz/msgs/entity.pb.h>
24 #include <gz/msgs/geometry.pb.h>
25 #include <gz/msgs/gui.pb.h>
26 #include <gz/msgs/inertial.pb.h>
27 #include <gz/msgs/light.pb.h>
28 #include <gz/msgs/material.pb.h>
29 #include <gz/msgs/particle_emitter.pb.h>
30 #include <gz/msgs/plugin.pb.h>
31 #include <gz/msgs/plugin_v.pb.h>
32 #include <gz/msgs/physics.pb.h>
33 #include <gz/msgs/scene.pb.h>
34 #include <gz/msgs/sensor.pb.h>
35 #include <gz/msgs/sensor_noise.pb.h>
36 #include <gz/msgs/time.pb.h>
37 #include <gz/msgs/world_stats.pb.h>
38 
39 #include <chrono>
40 #include <string>
41 
42 #include <gz/common/Console.hh>
43 #include <gz/math/Inertial.hh>
44 #include <sdf/Actor.hh>
45 #include <sdf/Atmosphere.hh>
46 #include <sdf/Collision.hh>
47 #include <sdf/Geometry.hh>
48 #include <sdf/Gui.hh>
49 #include <sdf/JointAxis.hh>
50 #include <sdf/Light.hh>
51 #include <sdf/Material.hh>
52 #include <sdf/Noise.hh>
53 #include <sdf/ParticleEmitter.hh>
54 #include <sdf/Plugin.hh>
55 #include <sdf/Physics.hh>
56 #include <sdf/Scene.hh>
57 #include <sdf/Sensor.hh>
58 
59 #include "gz/sim/config.hh"
60 #include "gz/sim/Export.hh"
61 #include "gz/sim/Types.hh"
62 
63 namespace ignition
64 {
65  namespace gazebo
66  {
67  // Inline bracket to help doxygen filtering.
68  inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
73  void IGNITION_GAZEBO_VISIBLE
74  set(msgs::SensorNoise *_msg, const sdf::Noise &_sdf);
75 
80  void IGNITION_GAZEBO_VISIBLE
81  set(msgs::WorldStatistics *_msg, const UpdateInfo &_in);
82 
88  void IGNITION_GAZEBO_VISIBLE
89  set(msgs::Time *_msg, const std::chrono::steady_clock::duration &_in);
90 
95  template<class Out>
96  Out convert(const sdf::Geometry &_in)
97  {
98  (void)_in;
99  Out::ConversionNotImplemented;
100  }
101 
106  template<>
108 
113  template<class Out>
114  Out convert(const msgs::Pose &_in)
115  {
116  (void)_in;
117  Out::ConversionNotImplemented;
118  }
119 
123  template<>
124  math::Pose3d convert(const msgs::Pose &_in);
125 
130  template<class Out>
131  Out convert(const msgs::Geometry &_in)
132  {
133  (void)_in;
134  Out::ConversionNotImplemented;
135  }
136 
141  template<>
143 
148  template<class Out>
149  Out convert(const sdf::Material &_in)
150  {
151  (void)_in;
152  Out::ConversionNotImplemented;
153  }
154 
159  template<>
161 
166  template<class Out>
167  Out convert(const msgs::Material &_in)
168  {
169  (void)_in;
170  Out::ConversionNotImplemented;
171  }
172 
177  template<>
179 
184  template<class Out>
185  Out convert(const sdf::Actor &_in)
186  {
187  (void)_in;
188  Out::ConversionNotImplemented;
189  }
190 
195  template<>
196  msgs::Actor convert(const sdf::Actor &_in);
197 
202  template<class Out>
203  Out convert(const msgs::Actor& _in)
204  {
205  (void)_in;
206  Out::ConversionNotImplemented;
207  }
208 
213  template<>
214  sdf::Actor convert(const msgs::Actor &_in);
215 
220  template<class Out>
221  Out convert(const sdf::Light &_in)
222  {
223  (void)_in;
224  Out::ConversionNotImplemented;
225  }
226 
231  template<>
232  msgs::Light convert(const sdf::Light &_in);
233 
238  std::string IGNITION_GAZEBO_VISIBLE
239  convert(const sdf::LightType &_in);
240 
245  template<class Out>
246  Out convert(const msgs::Light& _in)
247  {
248  (void)_in;
249  Out::ConversionNotImplemented;
250  }
251 
256  template<>
257  sdf::Light convert(const msgs::Light &_in);
258 
262  sdf::LightType IGNITION_GAZEBO_VISIBLE
263  convert(const std::string &_in);
264 
269  template<class Out>
270  Out convert(const sdf::Gui &_in)
271  {
272  (void)_in;
273  Out::ConversionNotImplemented;
274  }
275 
279  template<>
280  msgs::GUI convert(const sdf::Gui &_in);
281 
286  template<class Out>
287  Out convert(const std::chrono::steady_clock::duration &_in)
288  {
289  (void)_in;
290  Out::ConversionNotImplemented;
291  }
292 
297  template<>
298  msgs::Time convert(const std::chrono::steady_clock::duration &_in);
299 
304  template<class Out>
305  Out convert(const msgs::Time &_in)
306  {
307  (void)_in;
308  Out::ConversionNotImplemented;
309  }
310 
315  template<>
316  std::chrono::steady_clock::duration convert(const msgs::Time &_in);
317 
322  template<class Out>
323  Out convert(const math::Inertiald &_in)
324  {
325  (void)_in;
326  Out::ConversionNotImplemented;
327  }
328 
333  template<>
335 
340  template<class Out>
341  Out convert(const msgs::Inertial &_in)
342  {
343  (void)_in;
344  Out::ConversionNotImplemented;
345  }
346 
351  template<>
353 
358  template<class Out>
359  Out convert(const sdf::JointAxis &_in)
360  {
361  (void)_in;
362  Out::ConversionNotImplemented;
363  }
364 
369  template<>
370  msgs::Axis convert(const sdf::JointAxis &_in);
371 
376  template<class Out>
377  Out convert(const msgs::Axis &_in)
378  {
379  (void)_in;
380  Out::ConversionNotImplemented;
381  }
382 
387  template<>
388  sdf::JointAxis convert(const msgs::Axis &_in);
389 
394  template<class Out>
395  Out convert(const sdf::Scene &_in)
396  {
397  (void)_in;
398  Out::ConversionNotImplemented;
399  }
400 
404  template<>
405  msgs::Scene convert(const sdf::Scene &_in);
406 
411  template<class Out>
412  Out convert(const msgs::Scene &_in)
413  {
414  (void)_in;
415  Out::ConversionNotImplemented;
416  }
417 
422  template<>
423  sdf::Scene convert(const msgs::Scene &_in);
424 
429  template<class Out>
430  Out convert(const sdf::Atmosphere &_in)
431  {
432  (void)_in;
433  Out::ConversionNotImplemented;
434  }
435 
440  template<>
442 
447  template<class Out>
448  Out convert(const msgs::Atmosphere &_in)
449  {
450  (void)_in;
451  Out::ConversionNotImplemented;
452  }
453 
458  template<>
460 
461 
466  template<class Out>
467  Out convert(const sdf::Physics &_in)
468  {
469  (void)_in;
470  Out::ConversionNotImplemented;
471  }
472 
477  template<>
478  msgs::Physics convert(const sdf::Physics &_in);
479 
484  template<class Out>
485  Out convert(const msgs::Physics &_in)
486  {
487  (void)_in;
488  Out::ConversionNotImplemented;
489  }
490 
495  template<>
496  sdf::Physics convert(const msgs::Physics &_in);
497 
498 
503  template<class Out>
504  Out convert(const sdf::Sensor &_in)
505  {
506  (void)_in;
507  Out::ConversionNotImplemented;
508  }
509 
514  template<>
515  msgs::Sensor convert(const sdf::Sensor &_in);
516 
521  template<class Out>
522  Out convert(const msgs::Sensor &_in)
523  {
524  (void)_in;
525  Out::ConversionNotImplemented;
526  }
527 
532  template<>
533  sdf::Sensor convert(const msgs::Sensor &_in);
534 
539  template<class Out>
540  Out convert(const msgs::SensorNoise &_in)
541  {
542  (void)_in;
543  Out::ConversionNotImplemented;
544  }
545 
550  template<>
551  sdf::Noise convert(const msgs::SensorNoise &_in);
552 
558  template<class Out>
560  {
561  (void)_in;
562  Out::ConversionNotImplemented;
563  }
564 
569  template<>
570  UpdateInfo convert(const msgs::WorldStatistics &_in);
571 
576  template<class Out>
577  Out convert(const UpdateInfo &_in)
578  {
579  (void)_in;
580  Out::ConversionNotImplemented;
581  }
582 
587  template<>
588  msgs::WorldStatistics convert(const UpdateInfo &_in);
589 
594  template<class Out>
595  Out convert(const sdf::Collision &_in)
596  {
597  (void)_in;
598  Out::ConversionNotImplemented;
599  }
600 
605  template<>
607 
612  template<class Out>
613  Out convert(const msgs::Collision &_in)
614  {
615  (void)_in;
616  Out::ConversionNotImplemented;
617  }
618 
623  template<>
625 
630  template<class Out>
631  Out convert(const std::string &_in)
632  {
633  (void)_in;
634  Out::ConversionNotImplemented;
635  }
636 
640  template<>
642 
647  template<class Out>
649  {
650  (void)_in;
651  Out::ConversionNotImplemented;
652  }
653 
658  template<>
660 
666  template<class Out>
668  {
669  (void)_in;
670  Out::ConversionNotImplemented;
671  }
672 
677  template<>
679 
685  template<class Out>
686  Out convert(const sdf::ParticleEmitter &/*_in*/)
687  {
688  Out::ConversionNotImplemented;
689  }
690 
695  template<>
697 
703  template<class Out>
704  Out convert(const msgs::ParticleEmitter &/*_in*/)
705  {
706  Out::ConversionNotImplemented;
707  }
708 
713  template<>
715 
720  template<class Out>
721  Out convert(const sdf::Element &/*_in*/)
722  {
723  Out::ConversionNotImplemented;
724  }
725 
729  template<>
730  msgs::Plugin convert(const sdf::Element &_in);
731 
736  template<class Out>
737  Out convert(const sdf::Plugin &/*_in*/)
738  {
739  Out::ConversionNotImplemented;
740  }
741 
745  template<>
746  msgs::Plugin convert(const sdf::Plugin &_in);
747 
752  template<class Out>
753  Out convert(const sdf::Plugins &/*_in*/)
754  {
755  Out::ConversionNotImplemented;
756  }
757 
761  template<>
762  msgs::Plugin_V convert(const sdf::Plugins &_in);
763 
768  template<class Out>
769  Out convert(const msgs::Plugin &/*_in*/)
770  {
771  Out::ConversionNotImplemented;
772  }
773 
777  template<>
778  sdf::Plugin convert(const msgs::Plugin &_in);
779 
784  template<class Out>
785  Out convert(const msgs::Plugin_V &/*_in*/)
786  {
787  Out::ConversionNotImplemented;
788  }
789 
793  template<>
794  sdf::Plugins convert(const msgs::Plugin_V &_in);
795  }
796  }
797 }
798 #endif
This library is part of the Gazebo project.
STL class.
Component< std::string, class LightTypeTag, serializers::StringSerializer > LightType
A component that contains the light type. This is a simple wrapper around std::string.
Definition: gz/sim/components/LightType.hh:39
Component< NoData, class CollisionTag > Collision
A component that identifies an entity as being a collision.
Definition: gz/sim/components/Collision.hh:42
Out convert(const sdf::Geometry &_in)
Generic conversion from an SDF geometry to another type.
Definition: gz/sim/Conversions.hh:96
Information passed to systems on the update callback.
Definition: include/gz/sim/Types.hh:38
Component< sdf::Light, class LightTag, serializers::LightSerializer > Light
This component contains light source information. For more information on lights, see SDF's Light ele...
Definition: gz/sim/components/Light.hh:48
Component< sdf::Atmosphere, class AtmosphereTag, serializers::AtmosphereSerializer > Atmosphere
This component holds atmosphere properties of the world.
Definition: gz/sim/components/Atmosphere.hh:44
Component< sdf::Actor, class ActorTag, serializers::ActorSerializer > Actor
This component contains actor source information. For more information on actors, see SDF's Actor ele...
Definition: gz/sim/components/Actor.hh:80
Component< sdf::Geometry, class GeometryTag, serializers::GeometrySerializer > Geometry
This component holds an entity's geometry.
Definition: gz/sim/components/Geometry.hh:46
Component< sdf::Scene, class SceneTag, serializers::SceneSerializer > Scene
This component holds scene properties of the world.
Definition: gz/sim/components/Scene.hh:45
void set(msgs::SensorNoise *_msg, const sdf::Noise &_sdf)
Helper function that sets a mutable msgs::SensorNoise object to the values contained in a sdf::Noise ...
Component< sdf::JointAxis, class JointAxisTag, serializers::JointAxisSerializer > JointAxis
A component that contains the joint axis . This is a simple wrapper around sdf::JointAxis.
Definition: gz/sim/components/JointAxis.hh:43
Component< sdf::Material, class MaterialTag, serializers::MaterialSerializer > Material
This component holds an entity's material.
Definition: gz/sim/components/Material.hh:44
Component< sdf::Physics, class PhysicsTag, serializers::PhysicsSerializer > Physics
A component type that contains the physics properties of the World entity.
Definition: include/gz/sim/components/Physics.hh:50
Component< NoData, class SensorTag > Sensor
A component that identifies an entity as being a sensor.
Definition: gz/sim/components/Sensor.hh:35
Component< msgs::ParticleEmitter, class ParticleEmitterTag, serializers::MsgSerializer > ParticleEmitter
A component that contains a particle emitter.
Definition: include/gz/sim/components/ParticleEmitter.hh:37