Joint.hh
Go to the documentation of this file.
1 /*
2  * Copyright 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 #ifndef SDF_JOINT_HH_
18 #define SDF_JOINT_HH_
19 
20 #include <string>
21 #include <ignition/math/Pose3.hh>
22 #include "sdf/Element.hh"
23 #include "sdf/Types.hh"
24 #include "sdf/sdf_config.h"
25 #include "sdf/system_util.hh"
26 
27 namespace sdf
28 {
29  // Inline bracke to help doxygen filtering.
30  inline namespace SDF_VERSION_NAMESPACE {
31  //
32 
33  // Forward declarations.
34  class JointAxis;
35  class JointPrivate;
36 
40  enum class JointType
41  {
44  INVALID = 0,
45 
47  BALL = 1,
48 
51  CONTINUOUS = 2,
52 
55  FIXED = 3,
56 
58  GEARBOX = 4,
59 
62  PRISMATIC = 5,
63 
66  REVOLUTE = 6,
67 
69  REVOLUTE2 = 7,
70 
73  SCREW = 8,
74 
76  UNIVERSAL = 9
77  };
78 
80  {
82  public: Joint();
83 
86  public: Joint(const Joint &_joint);
87 
90  public: Joint(Joint &&_joint) noexcept;
91 
95  public: Joint &operator=(Joint &&_joint);
96 
100  public: Joint &operator=(const Joint &_joint);
101 
103  public: ~Joint();
104 
111  public: Errors Load(ElementPtr _sdf);
112 
116  public: const std::string &Name() const;
117 
121  public: void SetName(const std::string &_name);
122 
125  public: JointType Type() const;
126 
129  public: void SetType(const JointType _jointType);
130 
133  public: const std::string &ParentLinkName() const;
134 
137  public: void SetParentLinkName(const std::string &_name);
138 
141  public: const std::string &ChildLinkName() const;
142 
145  public: void SetChildLinkName(const std::string &_name);
146 
155  public: const JointAxis *Axis(const unsigned int _index = 0) const;
156 
163  public: void SetAxis(const unsigned int _index, const JointAxis &_axis);
164 
170  public: const ignition::math::Pose3d &Pose() const;
171 
175  public: void SetPose(const ignition::math::Pose3d &_pose);
176 
181  public: const std::string &PoseFrame() const;
182 
187  public: void SetPoseFrame(const std::string &_frame);
188 
191  public: double ThreadPitch() const;
192 
195  public: void SetThreadPitch(double _threadPitch);
196 
201  public: sdf::ElementPtr Element() const;
202 
204  private: JointPrivate *dataPtr = nullptr;
205  };
206  }
207 }
208 #endif
JointType
The set of joint types.
Definition: Joint.hh:40
class SDFORMAT_VISIBLE Element
Definition: Element.hh:47
A joint with zero degrees of freedom that rigidly connects two links.
Same as two revolute joints connected in series.
An invalid joint.
A single degree of freedom joint with coupled sliding and rotational motion.
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:51
A hinge joint that rotates on a single axis with a continuous range of motion.
A ball and socket joint.
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:74
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:48
Definition: Joint.hh:79
Geared revolute joint.
A sliding joint that slides along an axis with a limited range specified by upper and lower limits...
namespace for Simulation Description Format parser
Definition: AirPressure.hh:25
Similar to a ball joint, but constrains one degree of freedom.
Parameters related to the axis of rotation for rotational joints, and the axis of translation for pri...
Definition: JointAxis.hh:37
A hinge joint that rotates on a single axis with a fixed range of motion.