Ignition Physics

API Reference

2.0.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  {
83  public: LinkPtr<PolicyT, FeaturesT> CanonicalLink();
84 
86  public: ConstLinkPtr<PolicyT, FeaturesT> CanonicalLink() const;
87  };
88 
89  public: template <typename PolicyT>
90  class Implementation : public virtual Feature::Implementation<PolicyT>
91  {
92  public: virtual Identity FindFreeGroupForModel(
93  const Identity &_modelID) const = 0;
94 
95  public: virtual Identity FindFreeGroupForLink(
96  const Identity &_linkID) const = 0;
97 
98  public: virtual Identity GetFreeGroupCanonicalLink(
99  const Identity &_groupID) const = 0;
100  };
101  };
102 
104  class IGNITION_PHYSICS_VISIBLE FreeGroupFrameSemantics
105  : public virtual FeatureWithRequirements<
106  FindFreeGroupFeature, FrameSemantics>
107  {
108  public: template <typename PolicyT, typename FeaturesT>
110  };
111 
119  class IGNITION_PHYSICS_VISIBLE SetFreeGroupWorldPose
120  : public virtual FeatureWithRequirements<FindFreeGroupFeature>
121  {
122  public: template <typename PolicyT, typename FeaturesT>
123  class FreeGroup : public virtual Entity<PolicyT, FeaturesT>
124  {
125  public: using PoseType =
126  typename FromPolicy<PolicyT>::template Use<Pose>;
127 
128  public: void SetWorldPose(const PoseType &_pose);
129  };
130 
131  public: template <typename PolicyT>
132  class Implementation : public virtual Feature::Implementation<PolicyT>
133  {
134  public: using PoseType =
135  typename FromPolicy<PolicyT>::template Use<Pose>;
136 
137  public: virtual void SetFreeGroupWorldPose(
138  const Identity &_groupID,
139  const PoseType &_pose) = 0;
140  };
141  };
142 
144  class IGNITION_PHYSICS_VISIBLE SetFreeGroupWorldVelocity
145  : public virtual FeatureWithRequirements<FindFreeGroupFeature>
146  {
147  public: template <typename PolicyT, typename FeaturesT>
148  class FreeGroup : public virtual Entity<PolicyT, FeaturesT>
149  {
150  public: using LinearVelocity =
151  typename FromPolicy<PolicyT>::template Use<LinearVector>;
152 
153  public: using AngularVelocity =
154  typename FromPolicy<PolicyT>::template Use<AngularVector>;
155 
156  public: void SetWorldLinearVelocity(
157  const LinearVelocity &_linearVelocity);
158 
159  public: void SetWorldAngularVelocity(
160  const AngularVelocity &_angularVelocity);
161  };
162 
163  public: template <typename PolicyT>
164  class Implementation : public virtual Feature::Implementation<PolicyT>
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 
172  public: virtual void SetFreeGroupWorldLinearVelocity(
173  const Identity &_groupID,
174  const LinearVelocity &_linearVelocity) = 0;
175 
176  public: virtual void SetFreeGroupWorldAngularVelocity(
177  const Identity &_groupID,
178  const AngularVelocity &_angularVelocity) = 0;
179  };
180  };
181  }
182 }
183 
184 #include <ignition/physics/detail/FreeGroup.hh>
185 
186 #endif
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: FreeGroup.hh:126
If your feature is known to require any other features, then you should have your feature class inher...
Definition: FeatureList.hh:108
This is the base class of all "proxy objects". The "proxy objects" are essentially interfaces into th...
Definition: Entity.hh:216
Definition: FreeGroup.hh:119
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: FreeGroup.hh:135
typename FromPolicy< PolicyT >::template Use< AngularVector > AngularVelocity
Definition: FreeGroup.hh:154
This struct is used to conveniently convert from a policy to a geometric type. Example usage: ...
Definition: Geometry.hh:69
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:170
This feature provides an interface between the Model and Link classes and the FreeGroup class...
Definition: FreeGroup.hh:104
typename FromPolicy< PolicyT >::template Use< LinearVector > LinearVelocity
Definition: FreeGroup.hh:167
typename FromPolicy< PolicyT >::template Use< LinearVector > LinearVelocity
Definition: FreeGroup.hh:151