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 <ignition/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
30namespace sdf
31{
32 // Inline bracket to help doxygen filtering.
33 inline namespace SDF_VERSION_NAMESPACE {
34 //
35 // Forward declaration.
36 class Geometry;
37 class Surface;
38 struct PoseRelativeToGraph;
39 template <typename T> class ScopedGraph;
40
46 {
48 public: Collision();
49
56 public: Errors Load(ElementPtr _sdf);
57
61 public: std::string Name() const;
62
66 public: void SetName(const std::string &_name);
67
70 public: const Geometry *Geom() const;
71
74 public: void SetGeom(const Geometry &_geom);
75
78 public: const sdf::Surface *Surface() const;
79
82 public: void SetSurface(const sdf::Surface &_surface);
83
88 public: const ignition::math::Pose3d &RawPose() const;
89
93 public: void SetRawPose(const ignition::math::Pose3d &_pose);
94
99 public: const std::string &PoseRelativeTo() const;
100
105 public: void SetPoseRelativeTo(const std::string &_frame);
106
111
116 public: sdf::ElementPtr Element() const;
117
122 private: void SetXmlParentName(const std::string &_xmlParentName);
123
128 private: void SetPoseRelativeToGraph(
130
134 friend class Link;
135
137 IGN_UTILS_IMPL_PTR(dataPtr)
138 };
139 }
140}
141#endif
A collision element descibes the collision properties associated with a link.
Definition: Collision.hh:46
const Geometry * Geom() const
Get a pointer to the collisions's geometry.
sdf::SemanticPose SemanticPose() const
Get SemanticPose object of this object to aid in resolving poses.
void SetSurface(const sdf::Surface &_surface)
Set the collision's surface parameters.
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
const sdf::Surface * Surface() const
Get a pointer to the collisions's surface parameters.
std::string Name() const
Get the name of the collision.
const std::string & PoseRelativeTo() const
Get the name of the coordinate frame relative to which this object's pose is expressed.
Errors Load(ElementPtr _sdf)
Load the collision based on a element pointer.
void SetRawPose(const ignition::math::Pose3d &_pose)
Set the pose of the collision object.
void SetName(const std::string &_name)
Set the name of the collision.
void SetPoseRelativeTo(const std::string &_frame)
Set the name of the coordinate frame relative to which this object's pose is expressed.
void SetGeom(const Geometry &_geom)
Set the collision's geometry.
const ignition::math::Pose3d & RawPose() const
Get the pose of the collision object.
Collision()
Default constructor.
Geometry provides access to a shape, such as a Box.
Definition: Geometry.hh:78
Definition: Collision.hh:39
SemanticPose is a data structure that can be used by different DOM objects to resolve poses on a Pose...
Definition: SemanticPose.hh:55
Surface information for a collision.
Definition: Surface.hh:63
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:106
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:54
namespace for Simulation Description Format parser
Definition: Actor.hh:34
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:41