Gazebo Physics

API Reference

2.6.2
gz/physics/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 
23 #include <gz/physics/Geometry.hh>
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 
121  class IGNITION_PHYSICS_VISIBLE SetFreeGroupWorldPose
122  : public virtual FeatureWithRequirements<FindFreeGroupFeature>
123  {
129  public: template <typename PolicyT, typename FeaturesT>
130  class FreeGroup : public virtual Entity<PolicyT, FeaturesT>
131  {
132  public: using PoseType =
133  typename FromPolicy<PolicyT>::template Use<Pose>;
134 
136  public: void SetWorldPose(const PoseType &_pose);
137  };
138 
139  public: template <typename PolicyT>
140  class Implementation : public virtual Feature::Implementation<PolicyT>
141  {
142  public: using PoseType =
143  typename FromPolicy<PolicyT>::template Use<Pose>;
144 
145  public: virtual void SetFreeGroupWorldPose(
146  const Identity &_groupID,
147  const PoseType &_pose) = 0;
148  };
149  };
150 
154  class IGNITION_PHYSICS_VISIBLE SetFreeGroupWorldVelocity
155  : public virtual FeatureWithRequirements<FindFreeGroupFeature>
156  {
162  public: template <typename PolicyT, typename FeaturesT>
163  class FreeGroup : public virtual Entity<PolicyT, FeaturesT>
164  {
165  public: using LinearVelocity =
166  typename FromPolicy<PolicyT>::template Use<LinearVector>;
167 
168  public: using AngularVelocity =
169  typename FromPolicy<PolicyT>::template Use<AngularVector>;
170 
172  public: void SetWorldLinearVelocity(
173  const LinearVelocity &_linearVelocity);
174 
176  public: void SetWorldAngularVelocity(
177  const AngularVelocity &_angularVelocity);
178  };
179 
180  public: template <typename PolicyT>
181  class Implementation : public virtual Feature::Implementation<PolicyT>
182  {
183  public: using LinearVelocity =
184  typename FromPolicy<PolicyT>::template Use<LinearVector>;
185 
186  public: using AngularVelocity =
187  typename FromPolicy<PolicyT>::template Use<AngularVector>;
188 
189  public: virtual void SetFreeGroupWorldLinearVelocity(
190  const Identity &_groupID,
191  const LinearVelocity &_linearVelocity) = 0;
192 
193  public: virtual void SetFreeGroupWorldAngularVelocity(
194  const Identity &_groupID,
195  const AngularVelocity &_angularVelocity) = 0;
196  };
197  };
198  }
199 }
200 
201 #include <gz/physics/detail/FreeGroup.hh>
202 
203 #endif
This is the base class of all "proxy objects". The "proxy objects" are essentially interfaces into th...
Definition: gz/physics/Entity.hh:216
This class defines the FreeGroup concept, which represents a group of links that are not connected to...
Definition: gz/physics/FreeGroup.hh:130
This features sets the FreeGroup linear and angular velocity in world frame.
Definition: gz/physics/FreeGroup.hh:154
If your feature is known to require any other features, then you should have your feature class inher...
Definition: gz/physics/FeatureList.hh:108
virtual void SetFreeGroupWorldAngularVelocity(const Identity &_groupID, const AngularVelocity &_angularVelocity)=0
This features sets the FreeGroup pose in world frame. However, while a physics engine with maximal co...
Definition: gz/physics/FreeGroup.hh:121
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: gz/physics/FreeGroup.hh:133
This struct is used to conveniently convert from a policy to a geometric type. Example usage:
Definition: gz/physics/Geometry.hh:69
This feature provides an interface between the Model and Link classes and the FreeGroup class,...
Definition: gz/physics/FreeGroup.hh:104
typename FromPolicy< PolicyT >::template Use< AngularVector > AngularVelocity
Definition: gz/physics/FreeGroup.hh:187
virtual void SetFreeGroupWorldPose(const Identity &_groupID, const PoseType &_pose)=0
This class defines the FreeGroup concept, which represents a group of links that are not connected to...
Definition: gz/physics/FreeGroup.hh:163
Definition: gz/physics/Feature.hh:92
void SetWorldPose(const PoseType &_pose)
Set this FreeGroup pose in world frame.
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: gz/physics/FreeGroup.hh:143
typename FromPolicy< PolicyT >::template Use< AngularVector > AngularVelocity
Definition: gz/physics/FreeGroup.hh:169
typename FromPolicy< PolicyT >::template Use< LinearVector > LinearVelocity
Definition: gz/physics/FreeGroup.hh:184
void SetWorldAngularVelocity(const AngularVelocity &_angularVelocity)
Set this FreeGroup angular velocity in world frame.
void SetWorldLinearVelocity(const LinearVelocity &_linearVelocity)
Set this FreeGroup linear velocity in world frame.
typename FromPolicy< PolicyT >::template Use< LinearVector > LinearVelocity
Definition: gz/physics/FreeGroup.hh:166
Definition: gz/physics/FreeGroup.hh:140
virtual void SetFreeGroupWorldLinearVelocity(const Identity &_groupID, const LinearVelocity &_linearVelocity)=0
Base class for the API of a Frame. This will be inherited by any objects that are able to express Fra...
Definition: gz/physics/FrameSemantics.hh:41