Gazebo Physics

API Reference

8.0.0
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
25
26namespace gz
27{
28 namespace physics
29 {
30 GZ_PHYSICS_DECLARE_JOINT_TYPE(PrismaticJoint)
31
32 class GZ_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 GZ_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 GZ_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
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