Ignition Physics

API Reference

2.3.0
RevoluteJoint.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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_REVOLUTEJOINT_HH_
19 #define IGNITION_PHYSICS_REVOLUTEJOINT_HH_
20 
21 #include <string>
22 
25 
26 namespace ignition
27 {
28  namespace physics
29  {
30  IGN_PHYSICS_DECLARE_JOINT_TYPE(RevoluteJoint)
31 
32  class IGNITION_PHYSICS_VISIBLE GetRevoluteJointProperties
33  : public virtual FeatureWithRequirements<RevoluteJointCast>
34  {
36  public: template <typename PolicyT, typename FeaturesT>
37  class RevoluteJoint : public virtual Entity<PolicyT, FeaturesT>
38  {
39  public: using Axis =
40  typename FromPolicy<PolicyT>::template Use<AngularVector>;
41 
51  public: Axis GetAxis() const;
52  };
53 
56  public: template <typename PolicyT>
57  class Implementation : public virtual Feature::Implementation<PolicyT>
58  {
59  public: using Axis =
60  typename FromPolicy<PolicyT>::template Use<AngularVector>;
61 
65  public: virtual Axis GetRevoluteJointAxis(
66  const Identity &_id) const = 0;
67  };
68  };
69 
73  class IGNITION_PHYSICS_VISIBLE SetRevoluteJointProperties
74  : public virtual FeatureWithRequirements<RevoluteJointCast>
75  {
77  public: template <typename PolicyT, typename FeaturesT>
78  class RevoluteJoint : public virtual Entity<PolicyT, FeaturesT>
79  {
80  public: using Axis =
81  typename FromPolicy<PolicyT>::template Use<AngularVector>;
82 
91  public: void SetAxis(const Axis &_axis);
92  };
93 
96  public: template <typename PolicyT>
97  class Implementation : public virtual Feature::Implementation<PolicyT>
98  {
99  public: using Axis =
100  typename FromPolicy<PolicyT>::template Use<AngularVector>;
101 
103  public: virtual void SetRevoluteJointAxis(
104  const Identity &_id, const Axis &_axis) = 0;
105  };
106  };
107 
111  class IGNITION_PHYSICS_VISIBLE AttachRevoluteJointFeature
112  : public virtual FeatureWithRequirements<RevoluteJointCast>
113  {
114  public: template <typename PolicyT, typename FeaturesT>
115  class Link : public virtual Feature::Link<PolicyT, FeaturesT>
116  {
117  public: using Axis =
118  typename FromPolicy<PolicyT>::template Use<AngularVector>;
119 
120  public: using JointPtrType = RevoluteJointPtr<PolicyT, FeaturesT>;
121 
132  //
133  // TODO(MXG): Instead of _name and _axis, consider passing in a struct
134  // containing all base joint properties plus the axis.
135  public: JointPtrType AttachRevoluteJoint(
136  const BaseLinkPtr<PolicyT> &_parent,
137  const std::string &_name = "revolute",
138  const Axis &_axis = Axis::UnitX());
139  };
140 
141  public: template <typename PolicyT>
142  class Implementation : public virtual Feature::Implementation<PolicyT>
143  {
144  public: using Axis =
145  typename FromPolicy<PolicyT>::template Use<AngularVector>;
146 
157  public: virtual Identity AttachRevoluteJoint(
158  const Identity &_childID,
159  const BaseLinkPtr<PolicyT> &_parent,
160  const std::string &_name,
161  const Axis &_axis) = 0;
162  };
163  };
164  }
165 }
166 
167 #include <ignition/physics/detail/RevoluteJoint.hh>
168 
169 #endif
The API for setting basic revolute joint properties.
Definition: RevoluteJoint.hh:78
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
IGN_PHYSICS_DECLARE_JOINT_TYPE(FixedJoint) class AttachFixedJointFeature
Definition: FixedJoint.hh:29
typename FromPolicy< PolicyT >::template Use< AngularVector > Axis
Definition: RevoluteJoint.hh:81
Provide the API for setting a revolute joint&#39;s axis. Not all physics engines are able to change prope...
Definition: RevoluteJoint.hh:73
This struct is used to conveniently convert from a policy to a geometric type. Example usage: ...
Definition: Geometry.hh:69
STL class.
typename FromPolicy< PolicyT >::template Use< AngularVector > Axis
Definition: RevoluteJoint.hh:100
Provide the API for attaching a Link to another Link (or directly to the World) with a revolute joint...
Definition: RevoluteJoint.hh:111
typename FromPolicy< PolicyT >::template Use< AngularVector > Axis
Definition: RevoluteJoint.hh:145