Gazebo Physics

API Reference

2.6.2
gz/physics/PrismaticJoint.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_PRISMATICJOINT_HH_
19 #define GZ_PHYSICS_PRISMATICJOINT_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(PrismaticJoint)
31 
32  class IGNITION_PHYSICS_VISIBLE GetPrismaticJointProperties
33  : public virtual FeatureWithRequirements<PrismaticJointCast>
34  {
36  public: template <typename PolicyT, typename FeaturesT>
37  class PrismaticJoint : public virtual Entity<PolicyT, FeaturesT>
38  {
39  public: using Axis =
40  typename FromPolicy<PolicyT>::template Use<LinearVector>;
41 
49  public: Axis GetAxis() const;
50  };
51 
54  public: template <typename PolicyT>
55  class Implementation : public virtual Feature::Implementation<PolicyT>
56  {
57  public: using Axis =
58  typename FromPolicy<PolicyT>::template Use<LinearVector>;
59 
60  public: virtual Axis GetPrismaticJointAxis(
61  const Identity &_id) const = 0;
62  };
63  };
64 
68  class IGNITION_PHYSICS_VISIBLE SetPrismaticJointProperties
69  : public virtual FeatureWithRequirements<PrismaticJointCast>
70  {
72  public: template <typename PolicyT, typename FeaturesT>
73  class PrismaticJoint : public virtual Entity<PolicyT, FeaturesT>
74  {
75  public: using Axis =
76  typename FromPolicy<PolicyT>::template Use<LinearVector>;
77 
83  public: void SetAxis(const Axis &_axis);
84  };
85 
88  public: template <typename PolicyT>
89  class Implementation : public virtual Feature::Implementation<PolicyT>
90  {
91  public: using Axis =
92  typename FromPolicy<PolicyT>::template Use<LinearVector>;
93 
95  public: virtual void SetPrismaticJointAxis(
96  const Identity &_id, const Axis &_axis) = 0;
97  };
98  };
99 
103  class IGNITION_PHYSICS_VISIBLE AttachPrismaticJointFeature
104  : public virtual FeatureWithRequirements<PrismaticJointCast>
105  {
106  public: template <typename PolicyT, typename FeaturesT>
107  class Link : public virtual Feature::Link<PolicyT, FeaturesT>
108  {
109  public: using Axis =
110  typename FromPolicy<PolicyT>::template Use<LinearVector>;
111 
112  public: using JointPtrType = PrismaticJointPtr<PolicyT, FeaturesT>;
113 
126  public: JointPtrType AttachPrismaticJoint(
127  const BaseLinkPtr<PolicyT> &_parent,
128  const std::string &_name = "prismatic",
129  const Axis &_axis = Axis::UnitX());
130  };
131 
132  public: template <typename PolicyT>
133  class Implementation : public virtual Feature::Implementation<PolicyT>
134  {
135  public: using Axis =
136  typename FromPolicy<PolicyT>::template Use<LinearVector>;
137 
148  public: virtual Identity AttachPrismaticJoint(
149  const Identity &_childID,
150  const BaseLinkPtr<PolicyT> &_parent,
151  const std::string &_name,
152  const Axis &_axis) = 0;
153  };
154  };
155  }
156 }
157 
158 #include <gz/physics/detail/PrismaticJoint.hh>
159 
160 #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:108
STL class.
virtual void SetPrismaticJointAxis(const Identity &_id, const Axis &_axis)=0
Set the axis of the PrismaticJoint.
This struct is used to conveniently convert from a policy to a geometric type. Example usage:
Definition: gz/physics/Geometry.hh:69
Provide the API for setting a prismatic joint's axis. Not all physics engines are able to change prop...
Definition: gz/physics/PrismaticJoint.hh:68
typename FromPolicy< PolicyT >::template Use< LinearVector > Axis
Definition: gz/physics/PrismaticJoint.hh:92
#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 attaching a Link to another Link (or directly to the World) with a prismatic join...
Definition: gz/physics/PrismaticJoint.hh:103
void SetAxis(const Axis &_axis)
Set the axis of this PrismaticJoint.
Definition: gz/physics/PrismaticJoint.hh:133
Definition: gz/physics/Feature.hh:92
The API for setting basic prismatic joint properties.
Definition: gz/physics/PrismaticJoint.hh:73
typename FromPolicy< PolicyT >::template Use< LinearVector > Axis
Definition: gz/physics/PrismaticJoint.hh:136
typename FromPolicy< PolicyT >::template Use< LinearVector > Axis
Definition: gz/physics/PrismaticJoint.hh:76
virtual Identity AttachPrismaticJoint(const Identity &_childID, const BaseLinkPtr< PolicyT > &_parent, const std::string &_name, const Axis &_axis)=0
Definition: gz/physics/PrismaticJoint.hh:89