Gazebo Physics

API Reference

5.3.2
gz/physics/EllipsoidShape.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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_ELLIPSOIDSHAPE_HH_
19 #define GZ_PHYSICS_ELLIPSOIDSHAPE_HH_
20 
21 #include <string>
22 
24 #include <gz/physics/Geometry.hh>
25 
26 namespace ignition
27 {
28  namespace physics
29  {
30  IGN_PHYSICS_DECLARE_SHAPE_TYPE(EllipsoidShape)
31 
32  class IGNITION_PHYSICS_VISIBLE GetEllipsoidShapeProperties
33  : public virtual FeatureWithRequirements<EllipsoidShapeCast>
34  {
35  public: template <typename PolicyT, typename FeaturesT>
36  class EllipsoidShape : public virtual Entity<PolicyT, FeaturesT>
37  {
38  public: using Dimensions =
39  typename FromPolicy<PolicyT>::template Use<LinearVector>;
40 
43  public: Dimensions GetRadii() const;
44  };
45 
46  public: template <typename PolicyT>
47  class Implementation : public virtual Feature::Implementation<PolicyT>
48  {
49  public: using Dimensions =
50  typename FromPolicy<PolicyT>::template Use<LinearVector>;
51 
52  public: virtual Dimensions GetEllipsoidShapeRadii(
53  const Identity &_ellipsoidID) const = 0;
54  };
55  };
56 
60  class IGNITION_PHYSICS_VISIBLE SetEllipsoidShapeProperties
61  : public virtual FeatureWithRequirements<EllipsoidShapeCast>
62  {
63  public: template <typename PolicyT, typename FeaturesT>
64  class EllipsoidShape : public virtual Entity<PolicyT, FeaturesT>
65  {
66  public: using Dimensions =
67  typename FromPolicy<PolicyT>::template Use<LinearVector>;
68 
72  public: void SetRadii(Dimensions _radii);
73  };
74 
75  public: template <typename PolicyT>
76  class Implementation : public virtual Feature::Implementation<PolicyT>
77  {
78  public: using Dimensions =
79  typename FromPolicy<PolicyT>::template Use<LinearVector>;
80 
81  public: virtual void SetEllipsoidShapeRadii(
82  const Identity &_ellipsoidID, Dimensions _radii) = 0;
83  };
84  };
85 
90  class IGNITION_PHYSICS_VISIBLE AttachEllipsoidShapeFeature
91  : public virtual FeatureWithRequirements<EllipsoidShapeCast>
92  {
93  public: template <typename PolicyT, typename FeaturesT>
94  class Link : public virtual Feature::Link<PolicyT, FeaturesT>
95  {
96  public: using Dimensions =
97  typename FromPolicy<PolicyT>::template Use<LinearVector>;
98 
99  public: using PoseType =
100  typename FromPolicy<PolicyT>::template Use<Pose>;
101 
102  public: using ShapePtrType = EllipsoidShapePtr<PolicyT, FeaturesT>;
103 
110  public: ShapePtrType AttachEllipsoidShape(
111  const std::string &_name = "ellipsoid",
112  Dimensions _radii = Dimensions::Constant(1.0),
113  const PoseType &_pose = PoseType::Identity());
114  };
115 
116  public: template <typename PolicyT>
117  class Implementation : public virtual Feature::Implementation<PolicyT>
118  {
119  public: using Dimensions =
120  typename FromPolicy<PolicyT>::template Use<LinearVector>;
121 
122  public: using PoseType =
123  typename FromPolicy<PolicyT>::template Use<Pose>;
124 
125  public: virtual Identity AttachEllipsoidShape(
126  const Identity &_linkID,
127  const std::string &_name,
128  Dimensions _radii,
129  const PoseType &_pose) = 0;
130  };
131  };
132  }
133 }
134 
135 #include <gz/physics/detail/EllipsoidShape.hh>
136 
137 #endif
This is the base class of all "proxy objects". The "proxy objects" are essentially interfaces into th...
Definition: gz/physics/Entity.hh:216
typename FromPolicy< PolicyT >::template Use< LinearVector > Dimensions
Definition: gz/physics/EllipsoidShape.hh:67
If your feature is known to require any other features, then you should have your feature class inher...
Definition: gz/physics/FeatureList.hh:118
STL class.
void SetRadii(Dimensions _radii)
Set the radius of this EllipsoidShape.
Definition: gz/physics/EllipsoidShape.hh:64
This struct is used to conveniently convert from a policy to a geometric type. Example usage:
Definition: gz/physics/Geometry.hh:77
typename FromPolicy< PolicyT >::template Use< LinearVector > Dimensions
Definition: gz/physics/EllipsoidShape.hh:79
virtual void SetEllipsoidShapeRadii(const Identity &_ellipsoidID, Dimensions _radii)=0
Definition: gz/physics/EllipsoidShape.hh:76
This feature constructs a new ellipsoid shape and attaches the desired pose in the link frame....
Definition: gz/physics/EllipsoidShape.hh:90
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: gz/physics/EllipsoidShape.hh:123
This feature sets the EllipsoidShape properties such as the ellipsoid radii.
Definition: gz/physics/EllipsoidShape.hh:60
#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< LinearVector > Dimensions
Definition: gz/physics/EllipsoidShape.hh:120
Definition: gz/physics/EllipsoidShape.hh:117
virtual Identity AttachEllipsoidShape(const Identity &_linkID, const std::string &_name, Dimensions _radii, const PoseType &_pose)=0