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 <ignition/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: ignition::math::Vector3d Xyz() const;
64 
69  public: [[nodiscard]] sdf::Errors SetXyz(
70  const ignition::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 
215  ignition::math::Vector3d &_xyz,
216  const std::string &_resolveTo = "") const;
217 
222  public: sdf::ElementPtr Element() const;
223 
228  public: sdf::ElementPtr ToElement(unsigned int _index = 0u) const;
229 
234  private: void SetXmlParentName(const std::string &_xmlParentName);
235 
240  private: void SetPoseRelativeToGraph(
242 
244  friend class Joint;
245 
247  IGN_UTILS_IMPL_PTR(dataPtr)
248  };
249  }
250 }
251 #endif
Parameters related to the axis of rotation for rotational joints, and the axis of translation for pri...
Definition: JointAxis.hh:43
ignition::math::Vector3d Xyz() const
Get the x,y,z components of the axis unit vector.
void SetStiffness(const double _stiffness)
Get the joint stop stiffness.
double Friction() const
Get the physical static friction value of the joint.
void SetDamping(const double _damping)
Set the physical velocity dependent viscous damping coefficient of the joint axis.
void SetLower(const double _lower)
Set the lower joint axis limit (radians for revolute joints, meters for prismatic joints).
double Stiffness() const
Get the joint stop stiffness.
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
void SetDissipation(const double _dissipation)
Set the joint stop dissipation.
void SetSpringReference(const double _spring)
Set the spring reference position for this joint axis.
double SpringStiffness() const
Get the spring stiffness for this joint axis.
Errors ResolveXyz(ignition::math::Vector3d &_xyz, const std::string &_resolveTo="") const
Express xyz unit vector of this axis in the coordinates of another named frame.
double Lower() const
Get the lower joint axis limit (radians for revolute joints, meters for prismatic joints).
double Upper() const
Get the upper joint axis limit (radians for revolute joints, meters for prismatic joints).
double Effort() const
Get the value for enforcing the maximum absolute joint effort that can be applied.
void SetMaxVelocity(const double _velocity)
Set the value for enforcing the maximum absolute joint velocity.
Errors Load(ElementPtr _sdf)
Load the joint axis based on a element pointer.
sdf::ElementPtr ToElement(unsigned int _index=0u) const
Create and return an SDF element filled with data from this joint axis.
void SetFriction(const double _friction)
Set the physical static friction value of the joint.
void SetUpper(const double _upper)
Set the upper joint axis limit (radians for revolute joints, meters for prismatic joints).
JointAxis()
Default constructor.
double Damping() const
Get the physical velocity dependent viscous damping coefficient of the joint axis.
double SpringReference() const
Get the spring reference position for this joint axis.
const std::string & XyzExpressedIn() const
Get the name of the coordinate frame in which this joint axis's unit vector is expressed.
void SetSpringStiffness(const double _spring)
Set the spring stiffness for this joint axis.
double Dissipation() const
Get the joint stop dissipation.
void SetXyzExpressedIn(const std::string &_frame)
Set the name of the coordinate frame in which this joint axis's unit vector is expressed.
sdf::Errors SetXyz(const ignition::math::Vector3d &_xyz)
Set the x,y,z components of the axis unit vector.
void SetEffort(double _effort)
Set the value for enforcing the maximum absolute joint effort that can be applied.
double MaxVelocity() const
Get the value for enforcing the maximum absolute joint velocity.
Definition: Joint.hh:86
Definition: Collision.hh:39
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:106
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:54
namespace for Simulation Description Format parser
Definition: Actor.hh:34
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:41