Gazebo Physics

API Reference

7.6.0
Shape.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_SHAPE_HH_
19 #define GZ_PHYSICS_SHAPE_HH_
20 
24 #include <gz/physics/Geometry.hh>
25 
26 namespace gz
27 {
28  namespace physics
29  {
33  class GZ_PHYSICS_VISIBLE GetShapeKinematicProperties
34  : public virtual Feature
35  {
36  public: template <typename PolicyT, typename FeaturesT>
37  class Shape : public virtual Feature::Shape<PolicyT, FeaturesT>
38  {
39  public: using PoseType =
40  typename FromPolicy<PolicyT>::template Use<Pose>;
41 
47  public: PoseType GetRelativeTransform() const;
48  };
49 
50  public: template <typename PolicyT>
51  class Implementation : public virtual Feature::Implementation<PolicyT>
52  {
53  public: using PoseType =
54  typename FromPolicy<PolicyT>::template Use<Pose>;
55 
57  const Identity &_shapeID) const = 0;
58  };
59  };
60 
62  class GZ_PHYSICS_VISIBLE SetShapeKinematicProperties
63  : public virtual Feature
64  {
65  public: template <typename PolicyT, typename FeaturesT>
66  class Shape : public virtual Feature::Shape<PolicyT, FeaturesT>
67  {
68  public: using PoseType =
69  typename FromPolicy<PolicyT>::template Use<Pose>;
70 
77  public: void SetRelativeTransform(const PoseType &_pose);
78  };
79 
80  public: template <typename PolicyT>
81  class Implementation : public virtual Feature::Implementation<PolicyT>
82  {
83  public: using PoseType =
84  typename FromPolicy<PolicyT>::template Use<Pose>;
85 
86  public: virtual void SetShapeRelativeTransform(
87  const Identity &_shapeID, const PoseType &_pose) = 0;
88  };
89  };
90 
94  class GZ_PHYSICS_VISIBLE GetShapeCollisionProperties
95  : public virtual Feature
96  {
97  public: template <typename PolicyT, typename FeaturesT>
98  class Shape : public virtual Feature::Shape<PolicyT, FeaturesT>
99  {
100  public: using Scalar = typename PolicyT::Scalar;
101 
109  const BaseShapePtr<PolicyT> &_other) const;
110 
119  const BaseShapePtr<PolicyT> &_other) const;
120  };
121 
122  public: template <typename PolicyT>
123  class Implementation : public virtual Feature::Implementation<PolicyT>
124  {
125  public: using Scalar = typename PolicyT::Scalar;
126 
128  const Identity &_shape0, const Identity &_shape1) const = 0;
129 
131  const Identity &_shape0, const Identity &_shape1) const = 0;
132  };
133  };
134 
138  class GZ_PHYSICS_VISIBLE GetShapeBoundingBox
139  : public virtual FeatureWithRequirements<ShapeFrameSemantics>
140  {
141  public: template <typename PolicyT, typename FeaturesT>
142  class Shape
143  : public virtual ShapeFrameSemantics::Shape<PolicyT, FeaturesT>
144  {
145  public: using AlignedBoxType =
146  typename FromPolicy<PolicyT>::template Use<AlignedBox>;
147 
158  const FrameID &_referenceFrame = FrameID::World()) const;
159  };
160 
161  public: template <typename PolicyT>
162  class Implementation : public virtual Feature::Implementation<PolicyT>
163  {
164  public: using AlignedBoxType =
165  typename FromPolicy<PolicyT>::template Use<AlignedBox>;
166 
171  const Identity &_shape) const = 0;
172  };
173  };
174 
178  class GZ_PHYSICS_VISIBLE SetShapeCollisionProperties
179  : public virtual Feature
180  {
181  public: template <typename PolicyT, typename FeaturesT>
182  class Shape : public virtual Feature::Shape<PolicyT, FeaturesT>
183  {
184  public: using Scalar = typename PolicyT::Scalar;
185 
194  const BaseShapePtr<PolicyT> &_other, Scalar _value);
195 
204  const BaseShapePtr<PolicyT> &_other, Scalar _value);
205  };
206 
207  public: template <typename PolicyT>
208  class Implementation : public virtual Feature::Implementation<PolicyT>
209  {
210  public: using Scalar = typename PolicyT::Scalar;
211 
212  public: virtual void SetShapeFrictionCoefficient(
213  const Identity &_shape0,
214  const Identity &_shape1,
215  Scalar _value) = 0;
216 
217  public: virtual void SetShapeRestitutionCoefficient(
218  const Identity &_shape0,
219  const Identity &_shape1,
220  Scalar _value) = 0;
221  };
222  };
223 
225  class GZ_PHYSICS_VISIBLE CollisionFilterMaskFeature
226  : public virtual Feature
227  {
228  public: template <typename PolicyT, typename FeaturesT>
229  class Shape : public virtual Feature::Shape<PolicyT, FeaturesT>
230  {
236  public: void SetCollisionFilterMask(const uint16_t _mask);
237 
240  public: uint16_t GetCollisionFilterMask() const;
241 
244  };
245 
246  public: template <typename PolicyT>
247  class Implementation : public virtual Feature::Implementation<PolicyT>
248  {
249  public: virtual void SetCollisionFilterMask(
250  const Identity &_shapeID, const uint16_t _mask) = 0;
251 
252  public: virtual uint16_t GetCollisionFilterMask(
253  const Identity &_shapeID) const = 0;
254 
255  public: virtual void RemoveCollisionFilterMask(
256  const Identity &_shapeID) = 0;
257  };
258  };
259 
261  class GZ_PHYSICS_VISIBLE CategoryFilterMaskFeature
262  : public virtual Feature
263  {
264  public: template <typename PolicyT, typename FeaturesT>
265  class Shape : public virtual Feature::Shape<PolicyT, FeaturesT>
266  {
272  public: void SetCategoryFilterMask(const uint16_t _mask);
273 
276  public: uint16_t GetCategoryFilterMask() const;
277 
279  public: void RemoveCategoryFilterMask();
280  };
281 
282  public: template <typename PolicyT>
283  class Implementation : public virtual Feature::Implementation<PolicyT>
284  {
285  public: virtual void SetCategoryFilterMask(
286  const Identity &_shapeID, const uint16_t _mask) = 0;
287 
288  public: virtual uint16_t GetCategoryFilterMask(
289  const Identity &_shapeID) const = 0;
290 
291  public: virtual void RemoveCategoryFilterMask(
292  const Identity &_shapeID) = 0;
293  };
294  };
295 
299  class GZ_PHYSICS_VISIBLE GetShapeFrictionPyramidSlipCompliance
300  : public virtual Feature
301  {
302  public: template <typename PolicyT, typename FeaturesT>
303  class Shape : public virtual Feature::Shape<PolicyT, FeaturesT>
304  {
305  public: using Scalar = typename PolicyT::Scalar;
306 
312 
318  };
319 
320  public: template <typename PolicyT>
321  class Implementation : public virtual Feature::Implementation<PolicyT>
322  {
323  public: using Scalar = typename PolicyT::Scalar;
324 
326  const Identity &_shapeID) const = 0;
327 
329  const Identity &_shapeID) const = 0;
330  };
331  };
332 
336  class GZ_PHYSICS_VISIBLE SetShapeFrictionPyramidSlipCompliance
337  : public virtual Feature
338  {
339  public: template <typename PolicyT, typename FeaturesT>
340  class Shape : public virtual Feature::Shape<PolicyT, FeaturesT>
341  {
342  public: using Scalar = typename PolicyT::Scalar;
343 
350  public: bool SetPrimarySlipCompliance(Scalar _value);
351 
358  public: bool SetSecondarySlipCompliance(Scalar _value);
359  };
360 
361  public: template <typename PolicyT>
362  class Implementation : public virtual Feature::Implementation<PolicyT>
363  {
364  public: using Scalar = typename PolicyT::Scalar;
365 
367  const Identity &_shapeID, Scalar _value) = 0;
368 
370  const Identity &_shapeID, Scalar _value) = 0;
371  };
372  };
373  }
374 }
375 
376 #include <gz/physics/detail/Shape.hh>
377 
378 #endif