Collision.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_COLLISION_HH_
18 #define SDF_COLLISION_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  // Forward declaration.
35  class CollisionPrivate;
36  class Geometry;
37  struct PoseRelativeToGraph;
38 
44  {
46  public: Collision();
47 
50  public: Collision(const Collision &_collision);
51 
54  public: Collision(Collision &&_collision) noexcept;
55 
59  public: Collision &operator=(Collision &&_collision);
60 
64  public: Collision &operator=(const Collision &_collision);
65 
67  public: ~Collision();
68 
75  public: Errors Load(ElementPtr _sdf);
76 
80  public: std::string Name() const;
81 
85  public: void SetName(const std::string &_name) const;
86 
89  public: const Geometry *Geom() const;
90 
93  public: void SetGeom(const Geometry &_geom);
94 
100  public: const ignition::math::Pose3d &Pose() const
101  SDF_DEPRECATED(9.0);
102 
107  public: void SetPose(const ignition::math::Pose3d &_pose)
108  SDF_DEPRECATED(9.0);
109 
114  public: const ignition::math::Pose3d &RawPose() const;
115 
119  public: void SetRawPose(const ignition::math::Pose3d &_pose);
120 
125  public: const std::string &PoseRelativeTo() const;
126 
131  public: void SetPoseRelativeTo(const std::string &_frame);
132 
138  public: const std::string &PoseFrame() const
139  SDF_DEPRECATED(9.0);
140 
146  public: void SetPoseFrame(const std::string &_frame)
147  SDF_DEPRECATED(9.0);
148 
152  public: sdf::SemanticPose SemanticPose() const;
153 
158  public: sdf::ElementPtr Element() const;
159 
164  private: void SetXmlParentName(const std::string &_xmlParentName);
165 
170  private: void SetPoseRelativeToGraph(
171  std::weak_ptr<const PoseRelativeToGraph> _graph);
172 
176  friend class Link;
177 
179  private: CollisionPrivate *dataPtr = nullptr;
180  };
181  }
182 }
183 #endif
Geometry provides access to a shape, such as a Box.
Definition: Geometry.hh:65
class SDFORMAT_VISIBLE Element
Definition: Element.hh:49
A collision element descibes the collision properties associated with a link.
Definition: Collision.hh:43
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:53
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:74
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:48
SemanticPose is a data structure that can be used by different DOM objects to resolve poses on a Pose...
Definition: SemanticPose.hh:53
namespace for Simulation Description Format parser
Definition: Actor.hh:32
#define SDF_DEPRECATED(version)
Definition: Types.hh:38