JointAxis.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_JOINTAXIS_HH_
18 #define SDF_JOINTAXIS_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <ignition/math/Vector3.hh>
23 #include "sdf/Element.hh"
24 #include "sdf/Exception.hh"
25 #include "sdf/Types.hh"
26 #include "sdf/sdf_config.h"
27 #include "sdf/system_util.hh"
28 
29 namespace sdf
30 {
31  // Inline bracket to help doxygen filtering.
32  inline namespace SDF_VERSION_NAMESPACE {
33  //
34 
35  // Forward declare private data class.
36  class JointAxisPrivate;
37  struct PoseRelativeToGraph;
38 
42  {
44  public: JointAxis();
45 
48  public: JointAxis(const JointAxis &_jointAxis);
49 
52  public: JointAxis(JointAxis &&_jointAxis) noexcept;
53 
57  public: JointAxis &operator=(JointAxis &&_jointAxis);
58 
62  public: JointAxis &operator=(const JointAxis &_jointAxis);
63 
65  public: ~JointAxis();
66 
73  public: Errors Load(ElementPtr _sdf);
74 
79  public: double InitialPosition() const;
80 
84  public: void SetInitialPosition(const double _pos);
85 
94  public: ignition::math::Vector3d Xyz() const;
95 
100  public: [[nodiscard]] sdf::Errors SetXyz(
101  const ignition::math::Vector3d &_xyz);
102 
108  public: double Damping() const;
109 
115  public: void SetDamping(const double _damping);
116 
121  public: double Friction() const;
122 
126  public: void SetFriction(const double _friction);
127 
132  public: double SpringReference() const;
133 
137  public: void SetSpringReference(const double _spring);
138 
143  public: double SpringStiffness() const;
144 
148  public: void SetSpringStiffness(const double _spring);
149 
155  public: double Lower() const;
156 
162  public: void SetLower(const double _lower);
163 
169  public: double Upper() const;
170 
176  public: void SetUpper(const double _upper) const;
177 
184  public: double Effort() const;
185 
191  public: void SetEffort(double _effort);
192 
197  public: double MaxVelocity() const;
198 
203  public: void SetMaxVelocity(const double _velocity) const;
204 
208  public: double Stiffness() const;
209 
214  public: void SetStiffness(const double _stiffness) const;
215 
219  public: double Dissipation() const;
220 
224  public: void SetDissipation(const double _dissipation) const;
225 
230  public: const std::string& XyzExpressedIn() const;
231 
236  public: void SetXyzExpressedIn(const std::string &_frame);
237 
245  public: Errors ResolveXyz(
246  ignition::math::Vector3d &_xyz,
247  const std::string &_resolveTo = "") const;
248 
253  public: sdf::ElementPtr Element() const;
254 
259  private: void SetXmlParentName(const std::string &_xmlParentName);
260 
265  private: void SetPoseRelativeToGraph(
266  std::weak_ptr<const PoseRelativeToGraph> _graph);
267 
269  friend class Joint;
270 
272  private: JointAxisPrivate *dataPtr;
273  };
274  }
275 }
276 #endif
sdf::v10::JointAxis
Parameters related to the axis of rotation for rotational joints, and the axis of translation for pri...
Definition: JointAxis.hh:41
Exception.hh
sdf::v10::Joint
Definition: Joint.hh:82
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:32
sdf::v10::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:95
Types.hh
sdf::v10::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:53
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Definition: system_util.hh:48
system_util.hh
sdf::v10::Element
class SDFORMAT_VISIBLE Element
Definition: Element.hh:49
Element.hh