Gazebo Physics

API Reference

5.3.2
gz/physics/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 GZ_PHYSICS_REVOLUTEJOINT_HH_
19 #define GZ_PHYSICS_REVOLUTEJOINT_HH_
20 
21 #include <string>
22 
24 #include <gz/physics/Geometry.hh>
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 <gz/physics/detail/RevoluteJoint.hh>
168 
169 #endif
This is the base class of all "proxy objects". The "proxy objects" are essentially interfaces into th...
Definition: gz/physics/Entity.hh:216
If your feature is known to require any other features, then you should have your feature class inher...
Definition: gz/physics/FeatureList.hh:118
STL class.
The API for setting basic revolute joint properties.
Definition: gz/physics/RevoluteJoint.hh:78
This struct is used to conveniently convert from a policy to a geometric type. Example usage:
Definition: gz/physics/Geometry.hh:77
Definition: gz/physics/RevoluteJoint.hh:142
#define IGN_PHYSICS_DECLARE_JOINT_TYPE(CustomJointType)
Given a joint type named CustomJointType, this macro creates the following classes:
Definition: gz/physics/DeclareJointType.hh:52
Provide the API for setting a revolute joint's axis. Not all physics engines are able to change prope...
Definition: gz/physics/RevoluteJoint.hh:73
Definition: gz/physics/Feature.hh:92
virtual void SetRevoluteJointAxis(const Identity &_id, const Axis &_axis)=0
Set the axis of the RevoluteJoint.
typename FromPolicy< PolicyT >::template Use< AngularVector > Axis
Definition: gz/physics/RevoluteJoint.hh:145
typename FromPolicy< PolicyT >::template Use< AngularVector > Axis
Definition: gz/physics/RevoluteJoint.hh:81
typename FromPolicy< PolicyT >::template Use< AngularVector > Axis
Definition: gz/physics/RevoluteJoint.hh:100
void SetAxis(const Axis &_axis)
Set the axis of this RevoluteJoint.
Provide the API for attaching a Link to another Link (or directly to the World) with a revolute joint...
Definition: gz/physics/RevoluteJoint.hh:111
virtual Identity AttachRevoluteJoint(const Identity &_childID, const BaseLinkPtr< PolicyT > &_parent, const std::string &_name, const Axis &_axis)=0
Definition: gz/physics/RevoluteJoint.hh:97