Gazebo Physics

API Reference

2.6.2
gz/physics/SphereShape.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 
18 #ifndef GZ_PHYSICS_SPHERESHAPE_HH_
19 #define GZ_PHYSICS_SPHERESHAPE_HH_
20 
21 #include <string>
22 
24 #include <gz/physics/Geometry.hh>
25 
26 namespace ignition
27 {
28  namespace physics
29  {
31 
32 
33  class IGNITION_PHYSICS_VISIBLE GetSphereShapeProperties
34  : public virtual FeatureWithRequirements<SphereShapeCast>
35  {
36  public: template <typename PolicyT, typename FeaturesT>
37  class SphereShape : public virtual Entity<PolicyT, FeaturesT>
38  {
39  public: using Scalar = typename PolicyT::Scalar;
40 
43  public: Scalar GetRadius() const;
44  };
45 
46  public: template <typename PolicyT>
47  class Implementation : public virtual Feature::Implementation<PolicyT>
48  {
49  public: using Scalar = typename PolicyT::Scalar;
50 
51  public: virtual Scalar GetSphereShapeRadius(
52  const Identity &_sphereID) const = 0;
53  };
54  };
55 
57  class IGNITION_PHYSICS_VISIBLE SetSphereShapeProperties
58  : public virtual FeatureWithRequirements<SphereShapeCast>
59  {
60  public: template <typename PolicyT, typename FeaturesT>
61  class SphereShape : public virtual Entity<PolicyT, FeaturesT>
62  {
63  public: using Scalar = typename PolicyT::Scalar;
64 
68  public: void SetRadius(Scalar _radius);
69  };
70 
71  public: template <typename PolicyT>
72  class Implementation : public virtual Feature::Implementation<PolicyT>
73  {
74  public: using Scalar = typename PolicyT::Scalar;
75 
76  public: virtual void SetSphereShapeRadius(
77  const Identity &_sphereID, Scalar _radius) = 0;
78  };
79  };
80 
85  class IGNITION_PHYSICS_VISIBLE AttachSphereShapeFeature
86  : public virtual FeatureWithRequirements<SphereShapeCast>
87  {
88  public: template <typename PolicyT, typename FeaturesT>
89  class Link : public virtual Feature::Link<PolicyT, FeaturesT>
90  {
91  public: using Scalar = typename PolicyT::Scalar;
92 
93  public: using PoseType =
94  typename FromPolicy<PolicyT>::template Use<Pose>;
95 
96  public: using ShapePtrType = SphereShapePtr<PolicyT, FeaturesT>;
97 
104  public: ShapePtrType AttachSphereShape(
105  const std::string &_name,
106  Scalar _radius = 1.0,
107  const PoseType &_pose = PoseType::Identity());
108  };
109 
110  public: template <typename PolicyT>
111  class Implementation : public virtual Feature::Implementation<PolicyT>
112  {
113  public: using Scalar = typename PolicyT::Scalar;
114 
115  public: using PoseType =
116  typename FromPolicy<PolicyT>::template Use<Pose>;
117 
118  public: virtual Identity AttachSphereShape(
119  const Identity &_linkID,
120  const std::string &_name,
121  Scalar _radius,
122  const PoseType &_pose) = 0;
123  };
124  };
125  }
126 }
127 
128 #include <gz/physics/detail/SphereShape.hh>
129 
130 #endif
This is the base class of all "proxy objects". The "proxy objects" are essentially interfaces into th...
Definition: gz/physics/Entity.hh:216
If your feature is known to require any other features, then you should have your feature class inher...
Definition: gz/physics/FeatureList.hh:108
STL class.
This struct is used to conveniently convert from a policy to a geometric type. Example usage:
Definition: gz/physics/Geometry.hh:69
Definition: gz/physics/SphereShape.hh:111
Definition: gz/physics/SphereShape.hh:57
virtual void SetSphereShapeRadius(const Identity &_sphereID, Scalar _radius)=0
typename PolicyT::Scalar Scalar
Definition: gz/physics/SphereShape.hh:74
void SetRadius(Scalar _radius)
Set the radius of this SphereShape.
Definition: gz/physics/SphereShape.hh:61
virtual Identity AttachSphereShape(const Identity &_linkID, const std::string &_name, Scalar _radius, const PoseType &_pose)=0
#define IGN_PHYSICS_DECLARE_SHAPE_TYPE(CustomShapeType)
Given a shape type named CustomShapeType, this macro creates the following classes:
Definition: gz/physics/DeclareShapeType.hh:52
Definition: gz/physics/Feature.hh:92
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: gz/physics/SphereShape.hh:116
typename PolicyT::Scalar Scalar
Definition: gz/physics/SphereShape.hh:113
This feature constructs a new sphere shape and attaches the desired pose in the link frame....
Definition: gz/physics/SphereShape.hh:85
typename PolicyT::Scalar Scalar
Definition: gz/physics/SphereShape.hh:63
Definition: gz/physics/SphereShape.hh:72