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 <gz/math/Pose3.hh>
23 #include <gz/utils/ImplPtr.hh>
24 #include "sdf/Element.hh"
25 #include "sdf/SemanticPose.hh"
26 #include "sdf/Types.hh"
27 #include "sdf/sdf_config.h"
28 #include "sdf/system_util.hh"
29 
30 namespace sdf
31 {
32  // Inline bracket to help doxygen filtering.
33  inline namespace SDF_VERSION_NAMESPACE {
34  //
35  // Forward declaration.
36  class Geometry;
37  class ParserConfig;
38  class Surface;
39  struct PoseRelativeToGraph;
40  template <typename T> class ScopedGraph;
41 
47  {
49  public: Collision();
50 
57  public: Errors Load(ElementPtr _sdf);
58 
66  public: Errors Load(sdf::ElementPtr _sdf, const ParserConfig &_config);
67 
71  public: std::string Name() const;
72 
76  public: void SetName(const std::string &_name);
77 
80  public: const Geometry *Geom() const;
81 
84  public: void SetGeom(const Geometry &_geom);
85 
88  public: const sdf::Surface *Surface() const;
89 
92  public: void SetSurface(const sdf::Surface &_surface);
93 
98  public: const gz::math::Pose3d &RawPose() const;
99 
103  public: void SetRawPose(const gz::math::Pose3d &_pose);
104 
109  public: const std::string &PoseRelativeTo() const;
110 
115  public: void SetPoseRelativeTo(const std::string &_frame);
116 
120  public: sdf::SemanticPose SemanticPose() const;
121 
126  public: sdf::ElementPtr Element() const;
127 
133  public: sdf::ElementPtr ToElement() const;
134 
139  private: void SetXmlParentName(const std::string &_xmlParentName);
140 
145  private: void SetPoseRelativeToGraph(
147 
151  friend class Link;
152 
154  GZ_UTILS_IMPL_PTR(dataPtr)
155  };
156  }
157 }
158 #endif
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:34
sdf::SDF_VERSION_NAMESPACE::Collision
A collision element descibes the collision properties associated with a link.
Definition: Collision.hh:46
Types.hh
SemanticPose.hh
sdf::SDF_VERSION_NAMESPACE::Surface
Surface information for a collision.
Definition: Surface.hh:159
sdf_config.h
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Definition: system_util.hh:25
sdf::SDF_VERSION_NAMESPACE::Geometry
Geometry provides access to a shape, such as a Box.
Definition: Geometry.hh:84
sdf::SDF_VERSION_NAMESPACE::ParserConfig
This class contains configuration options for the libsdformat parser.
Definition: ParserConfig.hh:84
sdf::SDF_VERSION_NAMESPACE::Element
class GZ_SDFORMAT_VISIBLE Element
Definition: Element.hh:50
sdf::SDF_VERSION_NAMESPACE::SemanticPose
SemanticPose is a data structure that can be used by different DOM objects to resolve poses on a Pose...
Definition: SemanticPose.hh:54
sdf::SDF_VERSION_NAMESPACE::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:80
sdf::SDF_VERSION_NAMESPACE::ScopedGraph
Definition: Collision.hh:40
system_util.hh
sdf::SDF_VERSION_NAMESPACE::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:54
Element.hh