Gazebo Physics

API Reference

8.0.0
World.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_WORLD_HH_
19#define GZ_PHYSICS_WORLD_HH_
20
21#include <cstddef>
22#include <string>
23
26
27namespace gz
28{
29 namespace physics
30 {
32 class GZ_PHYSICS_VISIBLE CollisionDetector : public virtual Feature
33 {
35 public: template <typename PolicyT, typename FeaturesT>
36 class World : public virtual Feature::World<PolicyT, FeaturesT>
37 {
41 const std::string &_collisionDetector);
42
45 public: const std::string &GetCollisionDetector() const;
46 };
47
49 public: template <typename PolicyT>
50 class Implementation : public virtual Feature::Implementation<PolicyT>
51 {
55 public: virtual void SetWorldCollisionDetector(
56 const Identity &_id, const std::string &_collisionDetector) = 0;
57
61 public: virtual const std::string &GetWorldCollisionDetector(
62 const Identity &_id) const = 0;
63 };
64 };
65
68
71 class GZ_PHYSICS_VISIBLE Gravity
72 : public virtual
73 FeatureWithRequirements<GravityRequiredFeatures>
74 {
76 public: template <typename PolicyT, typename FeaturesT>
77 class World : public virtual Feature::World<PolicyT, FeaturesT>
78 {
79 public: using LinearVectorType =
80 typename FromPolicy<PolicyT>::template Use<LinearVector>;
81
82 public: using RelativeForceType =
83 typename FromPolicy<PolicyT>::template Use<RelativeForce>;
84
89 public: void SetGravity(const RelativeForceType &_gravity);
90
97 public: void SetGravity(
98 const LinearVectorType &_gravity,
99 const FrameID &_forceInCoordinatesOf = FrameID::World());
100
108 const FrameID &_forceInCoordinatesOf = FrameID::World()) const;
109 };
110
112 public: template <typename PolicyT>
113 class Implementation : public virtual Feature::Implementation<PolicyT>
114 {
115 public: using LinearVectorType =
116 typename FromPolicy<PolicyT>::template Use<LinearVector>;
117
122 public: virtual void SetWorldGravity(
123 const Identity &_id, const LinearVectorType &_gravity) = 0;
124
130 const Identity &_id) const = 0;
131 };
132 };
133
135 class GZ_PHYSICS_VISIBLE CollisionPairMaxContacts:
136 public virtual Feature
137 {
140 public: template <typename PolicyT, typename FeaturesT>
141 class World : public virtual Feature::World<PolicyT, FeaturesT>
142 {
146 public: void SetCollisionPairMaxContacts(std::size_t _maxContacts);
147
152 };
153
155 public: template <typename PolicyT>
156 class Implementation : public virtual Feature::Implementation<PolicyT>
157 {
163 const Identity &_id, std::size_t _maxContacts) = 0;
164
170 const Identity &_id) const = 0;
171 };
172 };
173
175 class GZ_PHYSICS_VISIBLE Solver : public virtual Feature
176 {
178 public: template <typename PolicyT, typename FeaturesT>
179 class World : public virtual Feature::World<PolicyT, FeaturesT>
180 {
183 public: void SetSolver(const std::string &_solver);
184
187 public: const std::string &GetSolver() const;
188
191 public: void SetSolverIterations(std::size_t _iterations);
192
196 };
197
199 public: template <typename PolicyT>
200 class Implementation : public virtual Feature::Implementation<PolicyT>
201 {
205 public: virtual void SetWorldSolver(
206 const Identity &_id, const std::string &_solver) = 0;
207
211 public: virtual const std::string &GetWorldSolver(
212 const Identity &_id) const = 0;
213
218 public: virtual void SetWorldSolverIterations(
219 const Identity &_id, std::size_t _iterations) = 0;
220
226 const Identity &_id) const = 0;
227 };
228 };
229 }
230}
231
232#include <gz/physics/detail/World.hh>
233
234#endif