Gazebo Physics

API Reference

8.0.0~pre2
FreeGroup.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 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_FREEGROUP_HH_
19#define GZ_PHYSICS_FREEGROUP_HH_
20
24
25namespace gz
26{
27 namespace physics
28 {
29 DETAIL_GZ_PHYSICS_DEFINE_ENTITY(FreeGroup)
30
31
44 class GZ_PHYSICS_VISIBLE FindFreeGroupFeature : public virtual Feature
45 {
46 public: template <typename PolicyT, typename FeaturesT>
47 class Model : public virtual Feature::Model<PolicyT, FeaturesT>
48 {
49 using FreeGroupPtrType = FreeGroupPtr<PolicyT, FeaturesT>;
50 using ConstFreeGroupPtrType = ConstFreeGroupPtr<PolicyT, FeaturesT>;
51
55 public: FreeGroupPtrType FindFreeGroup();
56
58 public: ConstFreeGroupPtrType FindFreeGroup() const;
59 };
60
61 public: template <typename PolicyT, typename FeaturesT>
62 class Link : public virtual Feature::Link<PolicyT, FeaturesT>
63 {
64 using FreeGroupPtrType = FreeGroupPtr<PolicyT, FeaturesT>;
65 using ConstFreeGroupPtrType = ConstFreeGroupPtr<PolicyT, FeaturesT>;
66
71 public: FreeGroupPtrType FindFreeGroup();
72
74 public: ConstFreeGroupPtrType FindFreeGroup() const;
75 };
76
77 public: template <typename PolicyT, typename FeaturesT>
78 class FreeGroup : public virtual Entity<PolicyT, FeaturesT>
79 {
84 public: LinkPtr<PolicyT, FeaturesT> RootLink();
85
87 public: ConstLinkPtr<PolicyT, FeaturesT> RootLink() const;
88 };
89
90 public: template <typename PolicyT>
91 class Implementation : public virtual Feature::Implementation<PolicyT>
92 {
93 public: virtual Identity FindFreeGroupForModel(
94 const Identity &_modelID) const = 0;
95
96 public: virtual Identity FindFreeGroupForLink(
97 const Identity &_linkID) const = 0;
98
99 public: virtual Identity GetFreeGroupRootLink(
100 const Identity &_groupID) const = 0;
101 };
102 };
103
105 class GZ_PHYSICS_VISIBLE FreeGroupFrameSemantics
106 : public virtual FeatureWithRequirements<
107 FindFreeGroupFeature, FrameSemantics>
108 {
109 public: template <typename PolicyT, typename FeaturesT>
111 };
112
122 class GZ_PHYSICS_VISIBLE SetFreeGroupWorldPose
123 : public virtual FeatureWithRequirements<FindFreeGroupFeature>
124 {
130 public: template <typename PolicyT, typename FeaturesT>
131 class FreeGroup : public virtual Entity<PolicyT, FeaturesT>
132 {
133 public: using PoseType =
134 typename FromPolicy<PolicyT>::template Use<Pose>;
135
137 public: void SetWorldPose(const PoseType &_pose);
138 };
139
140 public: template <typename PolicyT>
141 class Implementation : public virtual Feature::Implementation<PolicyT>
142 {
143 public: using PoseType =
144 typename FromPolicy<PolicyT>::template Use<Pose>;
145
146 public: virtual void SetFreeGroupWorldPose(
147 const Identity &_groupID,
148 const PoseType &_pose) = 0;
149 };
150 };
151
155 class GZ_PHYSICS_VISIBLE SetFreeGroupWorldVelocity
156 : public virtual FeatureWithRequirements<FindFreeGroupFeature>
157 {
163 public: template <typename PolicyT, typename FeaturesT>
164 class FreeGroup : public virtual Entity<PolicyT, FeaturesT>
165 {
166 public: using LinearVelocity =
167 typename FromPolicy<PolicyT>::template Use<LinearVector>;
168
169 public: using AngularVelocity =
170 typename FromPolicy<PolicyT>::template Use<AngularVector>;
171
174 const LinearVelocity &_linearVelocity);
175
178 const AngularVelocity &_angularVelocity);
179 };
180
181 public: template <typename PolicyT>
182 class Implementation : public virtual Feature::Implementation<PolicyT>
183 {
184 public: using LinearVelocity =
185 typename FromPolicy<PolicyT>::template Use<LinearVector>;
186
187 public: using AngularVelocity =
188 typename FromPolicy<PolicyT>::template Use<AngularVector>;
189
191 const Identity &_groupID,
192 const LinearVelocity &_linearVelocity) = 0;
193
195 const Identity &_groupID,
196 const AngularVelocity &_angularVelocity) = 0;
197 };
198 };
199 }
200}
201
202#include <gz/physics/detail/FreeGroup.hh>
203
204#endif