Surface.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2020 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_SURFACE_HH_
18 #define SDF_SURFACE_HH_
19 
20 #include <gz/math/Vector3.hh>
21 #include <gz/utils/ImplPtr.hh>
22 #include "sdf/Element.hh"
23 #include "sdf/Types.hh"
24 #include "sdf/sdf_config.h"
25 #include "sdf/system_util.hh"
26 
27 namespace sdf
28 {
29  // Inline bracket to help doxygen filtering.
30  inline namespace SDF_VERSION_NAMESPACE {
33  {
35  public: Contact();
36 
43  public: Errors Load(ElementPtr _sdf);
44 
49  public: sdf::ElementPtr Element() const;
50 
53  public: uint16_t CollideBitmask() const;
54 
56  public: void SetCollideBitmask(const uint16_t _bitmask);
57 
59  GZ_UTILS_IMPL_PTR(dataPtr)
60  };
61 
64  {
66  public: ODE();
67 
74  public: Errors Load(ElementPtr _sdf);
75 
78  public: double Mu() const;
79 
82  public: void SetMu(double _mu);
83 
86  public: double Mu2() const;
87 
90  public: void SetMu2(double _mu2);
91 
94  public: const gz::math::Vector3d &Fdir1() const;
95 
98  public: void SetFdir1(const gz::math::Vector3d &_fdir);
99 
102  public: double Slip1() const;
103 
106  public: void SetSlip1(double _slip1);
107 
110  public: double Slip2() const;
111 
114  public: void SetSlip2(double _slip2);
115 
120  public: sdf::ElementPtr Element() const;
121 
123  GZ_UTILS_IMPL_PTR(dataPtr)
124  };
125 
128  {
130  public: BulletFriction();
131 
138  public: Errors Load(ElementPtr _sdf);
139 
142  public: double Friction() const;
143 
146  public: void SetFriction(double _friction);
147 
151  public: double Friction2() const;
152 
155  public: void SetFriction2(double _friction);
156 
160  public: const gz::math::Vector3d &Fdir1() const;
161 
165  public: void SetFdir1(const gz::math::Vector3d &_fdir);
166 
169  public: double RollingFriction() const;
170 
173  public: void SetRollingFriction(double _friction);
174 
179  public: sdf::ElementPtr Element() const;
180 
182  GZ_UTILS_IMPL_PTR(dataPtr)
183  };
184 
187  {
189  public: Torsional();
190 
197  public: Errors Load(ElementPtr _sdf);
198 
201  public: double Coefficient() const;
202 
205  public: void SetCoefficient(double _coefficient);
206 
210  public: bool UsePatchRadius() const;
211 
216  public: void SetUsePatchRadius(bool _usePatchRadius);
217 
220  public: double PatchRadius() const;
221 
224  public: void SetPatchRadius(double _radius);
225 
228  public: double SurfaceRadius() const;
229 
232  public: void SetSurfaceRadius(double _radius);
233 
236  public: double ODESlip() const;
237 
240  public: void SetODESlip(double _slip);
241 
246  public: sdf::ElementPtr Element() const;
247 
249  GZ_UTILS_IMPL_PTR(dataPtr)
250  };
251 
254  {
256  public: Friction();
257 
264  public: Errors Load(ElementPtr _sdf);
265 
269  public: const sdf::ODE *ODE() const;
270 
273  public: void SetODE(const sdf::ODE &_ode);
274 
278  public: const sdf::BulletFriction *BulletFriction() const;
279 
282  public: void SetBulletFriction(const sdf::BulletFriction &_bullet);
283 
287  public: const sdf::Torsional *Torsional() const;
288 
291  public: void SetTorsional(const sdf::Torsional &_torsional);
292 
297  public: sdf::ElementPtr Element() const;
298 
300  GZ_UTILS_IMPL_PTR(dataPtr)
301  };
302 
305  {
307  public: Surface();
308 
315  public: Errors Load(ElementPtr _sdf);
316 
321  public: sdf::ElementPtr Element() const;
322 
326  public: const sdf::Contact *Contact() const;
327 
330  public: void SetContact(const sdf::Contact &_contact);
331 
335  public: const sdf::Friction *Friction() const;
336 
339  public: void SetFriction(const sdf::Friction &_friction);
340 
346  public: sdf::ElementPtr ToElement() const;
347 
354  public: sdf::ElementPtr ToElement(sdf::Errors &_errors) const;
355 
357  GZ_UTILS_IMPL_PTR(dataPtr)
358  };
359  }
360 }
361 
362 #endif
sdf::SDF_VERSION_NAMESPACE::Friction
Friction information for a surface.
Definition: Surface.hh:253
sdf::SDF_VERSION_NAMESPACE::ODE
ODE information for a friction.
Definition: Surface.hh:63
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:34
sdf::SDF_VERSION_NAMESPACE::BulletFriction
BulletFriction information for a friction.
Definition: Surface.hh:127
Types.hh
sdf::SDF_VERSION_NAMESPACE::Surface
Surface information for a collision.
Definition: Surface.hh:304
sdf_config.h
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Definition: system_util.hh:25
sdf::SDF_VERSION_NAMESPACE::Contact
Contact information for a surface.
Definition: Surface.hh:32
sdf::SDF_VERSION_NAMESPACE::Element
class GZ_SDFORMAT_VISIBLE Element
Definition: Element.hh:51
sdf::SDF_VERSION_NAMESPACE::Torsional
Torsional friction.
Definition: Surface.hh:186
sdf::SDF_VERSION_NAMESPACE::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:80
system_util.hh
sdf::SDF_VERSION_NAMESPACE::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:55
Element.hh