Ignition Physics

API Reference

5.1.0
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 IGNITION_PHYSICS_FREEGROUP_HH_
19 #define IGNITION_PHYSICS_FREEGROUP_HH_
20 
24 
25 namespace ignition
26 {
27  namespace physics
28  {
29  DETAIL_IGN_PHYSICS_DEFINE_ENTITY(FreeGroup)
30 
31 
32  class IGNITION_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 
94  public: LinkPtr<PolicyT, FeaturesT> IGN_DEPRECATED(4.0) CanonicalLink();
95 
98  public: ConstLinkPtr<PolicyT, FeaturesT> IGN_DEPRECATED(4.0)
99  CanonicalLink() const;
100  };
101 
102  public: template <typename PolicyT>
103  class Implementation : public virtual Feature::Implementation<PolicyT>
104  {
105  public: virtual Identity FindFreeGroupForModel(
106  const Identity &_modelID) const = 0;
107 
108  public: virtual Identity FindFreeGroupForLink(
109  const Identity &_linkID) const = 0;
110 
111  public: virtual Identity GetFreeGroupRootLink(
112  const Identity &_groupID) const = 0;
113  };
114  };
115 
117  class IGNITION_PHYSICS_VISIBLE FreeGroupFrameSemantics
118  : public virtual FeatureWithRequirements<
119  FindFreeGroupFeature, FrameSemantics>
120  {
121  public: template <typename PolicyT, typename FeaturesT>
123  };
124 
134  class IGNITION_PHYSICS_VISIBLE SetFreeGroupWorldPose
135  : public virtual FeatureWithRequirements<FindFreeGroupFeature>
136  {
142  public: template <typename PolicyT, typename FeaturesT>
143  class FreeGroup : public virtual Entity<PolicyT, FeaturesT>
144  {
145  public: using PoseType =
146  typename FromPolicy<PolicyT>::template Use<Pose>;
147 
149  public: void SetWorldPose(const PoseType &_pose);
150  };
151 
152  public: template <typename PolicyT>
153  class Implementation : public virtual Feature::Implementation<PolicyT>
154  {
155  public: using PoseType =
156  typename FromPolicy<PolicyT>::template Use<Pose>;
157 
158  public: virtual void SetFreeGroupWorldPose(
159  const Identity &_groupID,
160  const PoseType &_pose) = 0;
161  };
162  };
163 
167  class IGNITION_PHYSICS_VISIBLE SetFreeGroupWorldVelocity
168  : public virtual FeatureWithRequirements<FindFreeGroupFeature>
169  {
175  public: template <typename PolicyT, typename FeaturesT>
176  class FreeGroup : public virtual Entity<PolicyT, FeaturesT>
177  {
178  public: using LinearVelocity =
179  typename FromPolicy<PolicyT>::template Use<LinearVector>;
180 
181  public: using AngularVelocity =
182  typename FromPolicy<PolicyT>::template Use<AngularVector>;
183 
185  public: void SetWorldLinearVelocity(
186  const LinearVelocity &_linearVelocity);
187 
189  public: void SetWorldAngularVelocity(
190  const AngularVelocity &_angularVelocity);
191  };
192 
193  public: template <typename PolicyT>
194  class Implementation : public virtual Feature::Implementation<PolicyT>
195  {
196  public: using LinearVelocity =
197  typename FromPolicy<PolicyT>::template Use<LinearVector>;
198 
199  public: using AngularVelocity =
200  typename FromPolicy<PolicyT>::template Use<AngularVector>;
201 
202  public: virtual void SetFreeGroupWorldLinearVelocity(
203  const Identity &_groupID,
204  const LinearVelocity &_linearVelocity) = 0;
205 
206  public: virtual void SetFreeGroupWorldAngularVelocity(
207  const Identity &_groupID,
208  const AngularVelocity &_angularVelocity) = 0;
209  };
210  };
211  }
212 }
213 
214 #include <ignition/physics/detail/FreeGroup.hh>
215 
216 #endif
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: FreeGroup.hh:146
If your feature is known to require any other features, then you should have your feature class inher...
Definition: FeatureList.hh:108
This features sets the FreeGroup linear and angular velocity in world frame.
Definition: FreeGroup.hh:167
This is the base class of all "proxy objects". The "proxy objects" are essentially interfaces into th...
Definition: Entity.hh:216
This features sets the FreeGroup pose in world frame. However, while a physics engine with maximal co...
Definition: FreeGroup.hh:134
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: FreeGroup.hh:156
typename FromPolicy< PolicyT >::template Use< AngularVector > AngularVelocity
Definition: FreeGroup.hh:182
This struct is used to conveniently convert from a policy to a geometric type. Example usage: ...
Definition: Geometry.hh:77
Base class for the API of a Frame. This will be inherited by any objects that are able to express Fra...
Definition: FrameSemantics.hh:41
typename FromPolicy< PolicyT >::template Use< AngularVector > AngularVelocity
Definition: FreeGroup.hh:200
This feature provides an interface between the Model and Link classes and the FreeGroup class...
Definition: FreeGroup.hh:117
typename FromPolicy< PolicyT >::template Use< LinearVector > LinearVelocity
Definition: FreeGroup.hh:197
typename FromPolicy< PolicyT >::template Use< LinearVector > LinearVelocity
Definition: FreeGroup.hh:179
This class defines the FreeGroup concept, which represents a group of links that are not connected to...
Definition: FreeGroup.hh:176
This class defines the FreeGroup concept, which represents a group of links that are not connected to...
Definition: FreeGroup.hh:143