Loading...
Searching...
No Matches
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
29namespace 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 class Surface;
38 struct PoseRelativeToGraph;
39
45 {
47 public: Collision();
48
51 public: Collision(const Collision &_collision);
52
55 public: Collision(Collision &&_collision) noexcept;
56
60 public: Collision &operator=(Collision &&_collision);
61
65 public: Collision &operator=(const Collision &_collision);
66
68 public: ~Collision();
69
76 public: Errors Load(ElementPtr _sdf);
77
81 public: std::string Name() const;
82
86 public: void SetName(const std::string &_name) const;
87
90 public: const Geometry *Geom() const;
91
94 public: void SetGeom(const Geometry &_geom);
95
98 public: sdf::Surface *Surface() const;
99
102 public: void SetSurface(const sdf::Surface &_surface);
103
109 public: const ignition::math::Pose3d &Pose() const
110 SDF_DEPRECATED(9.0);
111
116 public: void SetPose(const ignition::math::Pose3d &_pose)
117 SDF_DEPRECATED(9.0);
118
123 public: const ignition::math::Pose3d &RawPose() const;
124
128 public: void SetRawPose(const ignition::math::Pose3d &_pose);
129
134 public: const std::string &PoseRelativeTo() const;
135
140 public: void SetPoseRelativeTo(const std::string &_frame);
141
147 public: const std::string &PoseFrame() const
148 SDF_DEPRECATED(9.0);
149
155 public: void SetPoseFrame(const std::string &_frame)
156 SDF_DEPRECATED(9.0);
157
161 public: sdf::SemanticPose SemanticPose() const;
162
167 public: sdf::ElementPtr Element() const;
168
173 private: void SetXmlParentName(const std::string &_xmlParentName);
174
179 private: void SetPoseRelativeToGraph(
180 std::weak_ptr<const PoseRelativeToGraph> _graph);
181
185 friend class Link;
186
188 private: CollisionPrivate *dataPtr = nullptr;
189 };
190 }
191}
192#endif
#define SDF_DEPRECATED(version)
Definition Types.hh:38
A collision element descibes the collision properties associated with a link.
Definition Collision.hh:45
Errors Load(ElementPtr _sdf)
Load the collision based on a element pointer.
Collision(const Collision &_collision)
Copy constructor.
Collision(Collision &&_collision) noexcept
Move constructor.
void SetSurface(const sdf::Surface &_surface)
Set the collision's surface parameters.
Collision()
Default constructor.
Collision & operator=(Collision &&_collision)
Move assignment operator.
void SetName(const std::string &_name) const
Set the name of the collision.
std::string Name() const
Get the name of the collision.
~Collision()
Destructor.
const Geometry * Geom() const
Get a pointer to the collisions's geometry.
const ignition::math::Pose3d & Pose() const SDF_DEPRECATED(9.0)
Get the pose of the collision object.
void SetGeom(const Geometry &_geom)
Set the collision's geometry.
Collision & operator=(const Collision &_collision)
Copy assignment operator.
sdf::Surface * Surface() const
Get a pointer to the collisions's surface parameters.
SDF Element class.
Definition Element.hh:74
Geometry provides access to a shape, such as a Box.
Definition Geometry.hh:70
SemanticPose is a data structure that can be used by different DOM objects to resolve poses on a Pose...
Definition SemanticPose.hh:54
Surface information for a collision.
Definition Surface.hh:88
std::vector< Error > Errors
A vector of Error.
Definition Types.hh:89
std::shared_ptr< Element > ElementPtr
Definition Element.hh:53
namespace for Simulation Description Format parser
Definition Actor.hh:33
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition system_util.hh:48