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 <gz/math/Vector3.hh>
23 #include <gz/utils/ImplPtr.hh>
24 #include "sdf/Element.hh"
25 #include "sdf/Exception.hh"
26 #include "sdf/Types.hh"
27 #include "sdf/sdf_config.h"
28 #include "sdf/system_util.hh"
29 
30 namespace sdf
31 {
32  // Inline bracket to help doxygen filtering.
33  inline namespace SDF_VERSION_NAMESPACE {
34  //
35 
36  // Forward declare private data class.
37  struct PoseRelativeToGraph;
38  template <typename T> class ScopedGraph;
39 
43  {
45  public: JointAxis();
46 
53  public: Errors Load(ElementPtr _sdf);
54 
63  public: gz::math::Vector3d Xyz() const;
64 
69  public: [[nodiscard]] sdf::Errors SetXyz(
70  const gz::math::Vector3d &_xyz);
71 
77  public: double Damping() const;
78 
84  public: void SetDamping(const double _damping);
85 
90  public: double Friction() const;
91 
95  public: void SetFriction(const double _friction);
96 
101  public: double SpringReference() const;
102 
106  public: void SetSpringReference(const double _spring);
107 
112  public: double SpringStiffness() const;
113 
117  public: void SetSpringStiffness(const double _spring);
118 
124  public: double Lower() const;
125 
131  public: void SetLower(const double _lower);
132 
138  public: double Upper() const;
139 
145  public: void SetUpper(const double _upper);
146 
153  public: double Effort() const;
154 
160  public: void SetEffort(double _effort);
161 
166  public: double MaxVelocity() const;
167 
172  public: void SetMaxVelocity(const double _velocity);
173 
177  public: double Stiffness() const;
178 
183  public: void SetStiffness(const double _stiffness);
184 
188  public: double Dissipation() const;
189 
193  public: void SetDissipation(const double _dissipation);
194 
199  public: const std::string& XyzExpressedIn() const;
200 
205  public: void SetXyzExpressedIn(const std::string &_frame);
206 
214  public: Errors ResolveXyz(
215  gz::math::Vector3d &_xyz,
216  const std::string &_resolveTo = "") const;
217 
222  public: sdf::ElementPtr Element() const;
223 
230  public: sdf::ElementPtr ToElement(unsigned int _index = 0u) const;
231 
236  private: void SetXmlParentName(const std::string &_xmlParentName);
237 
242  private: void SetPoseRelativeToGraph(
244 
246  friend class Joint;
247 
249  IGN_UTILS_IMPL_PTR(dataPtr)
250  };
251  }
252 }
253 #endif
sdf::SDF_VERSION_NAMESPACE::Friction
Friction information for a surface.
Definition: Surface.hh:253
sdf::SDF_VERSION_NAMESPACE::JointAxis
Parameters related to the axis of rotation for rotational joints, and the axis of translation for pri...
Definition: JointAxis.hh:42
Exception.hh
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:34
sdf::SDF_VERSION_NAMESPACE::Element
class IGNITION_SDFORMAT_VISIBLE Element
Definition: Element.hh:50
Types.hh
sdf_config.h
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Definition: system_util.hh:25
sdf::SDF_VERSION_NAMESPACE::Joint
Definition: Joint.hh:85
sdf::SDF_VERSION_NAMESPACE::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:106
sdf::SDF_VERSION_NAMESPACE::ScopedGraph
Definition: Collision.hh:39
system_util.hh
sdf::SDF_VERSION_NAMESPACE::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:54
Element.hh