Link.hh
Go to the documentation of this file.
1 /*
2  * Copyright 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 SDF_LINK_HH_
18 #define SDF_LINK_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <ignition/math/Pose3.hh>
23 #include "sdf/Element.hh"
24 #include "sdf/SemanticPose.hh"
25 #include "sdf/Types.hh"
26 #include "sdf/sdf_config.h"
27 #include "sdf/system_util.hh"
28 
29 namespace sdf
30 {
31  // Inline bracket to help doxygen filtering.
32  inline namespace SDF_VERSION_NAMESPACE {
33  //
34 
35  // Forward declarations.
36  class Collision;
37  class Light;
38  class LinkPrivate;
39  class ParticleEmitter;
40  class Sensor;
41  class Visual;
42  class LinkPrivate;
43  struct PoseRelativeToGraph;
44 
46  {
48  public: Link();
49 
52  public: Link(const Link &_link);
53 
56  public: Link(Link &&_link) noexcept;
57 
61  public: Link &operator=(Link &&_link);
62 
66  public: Link &operator=(const Link &_link);
67 
69  public: ~Link();
70 
77  public: Errors Load(ElementPtr _sdf);
78 
82  public: std::string Name() const;
83 
87  public: void SetName(const std::string &_name) const;
88 
91  public: uint64_t VisualCount() const;
92 
98  public: const Visual *VisualByIndex(const uint64_t _index) const;
99 
103  public: bool VisualNameExists(const std::string &_name) const;
104 
108  public: const Visual *VisualByName(const std::string &_name) const;
109 
112  public: uint64_t CollisionCount() const;
113 
119  public: const Collision *CollisionByIndex(const uint64_t _index) const;
120 
124  public: bool CollisionNameExists(const std::string &_name) const;
125 
129  public: const Collision *CollisionByName(const std::string &_name) const;
130 
133  public: uint64_t LightCount() const;
134 
140  public: const Light *LightByIndex(const uint64_t _index) const;
141 
145  public: bool LightNameExists(const std::string &_name) const;
146 
150  public: const Light *LightByName(const std::string &_name) const;
151 
154  public: uint64_t SensorCount() const;
155 
161  public: const Sensor *SensorByIndex(const uint64_t _index) const;
162 
166  public: bool SensorNameExists(const std::string &_name) const;
167 
173  public: const Sensor *SensorByName(const std::string &_name) const;
174 
177  public: uint64_t ParticleEmitterCount() const;
178 
185  public: const ParticleEmitter *ParticleEmitterByIndex(
186  const uint64_t _index) const;
187 
191  public: bool ParticleEmitterNameExists(const std::string &_name) const;
192 
198  public: const ParticleEmitter *ParticleEmitterByName(
199  const std::string &_name) const;
200 
214  public: const ignition::math::Inertiald &Inertial() const;
215 
220  public: bool SetInertial(const ignition::math::Inertiald &_inertial);
221 
225  public: const ignition::math::Pose3d &RawPose() const;
226 
230  public: void SetRawPose(const ignition::math::Pose3d &_pose);
231 
236  public: const std::string &PoseRelativeTo() const;
237 
242  public: void SetPoseRelativeTo(const std::string &_frame);
243 
248  public: sdf::ElementPtr Element() const;
249 
253  public: sdf::SemanticPose SemanticPose() const;
254 
259  private: void SetPoseRelativeToGraph(
260  std::weak_ptr<const PoseRelativeToGraph> _graph);
261 
263  friend class Model;
264 
269  public: bool EnableWind() const;
270 
275  public: void SetEnableWind(bool _enableWind);
276 
278  private: LinkPrivate *dataPtr = nullptr;
279  };
280  }
281 }
282 #endif
sdf::v10::Collision
A collision element descibes the collision properties associated with a link.
Definition: Collision.hh:44
sdf::v10::Visual
Definition: Visual.hh:45
sdf::v10::SemanticPose
SemanticPose is a data structure that can be used by different DOM objects to resolve poses on a Pose...
Definition: SemanticPose.hh:53
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:32
sdf::v10::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:95
Types.hh
SemanticPose.hh
sdf::v10::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:53
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Definition: system_util.hh:48
sdf::v10::Light
Provides a description of a light source.
Definition: Light.hh:62
system_util.hh
sdf::SDF_VERSION_NAMESPACE::Sensor
Information about an SDF sensor.
Definition: Sensor.hh:116
sdf::v10::Element
class SDFORMAT_VISIBLE Element
Definition: Element.hh:49
Element.hh
sdf::v10::Model
Definition: Model.hh:43
sdf::v10::ParticleEmitter
A description of a particle emitter, which can be attached to a link.
Definition: ParticleEmitter.hh:60