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/Types.hh"
25 #include "sdf/sdf_config.h"
26 #include "sdf/system_util.hh"
27 
28 namespace sdf
29 {
30  // Inline bracket to help doxygen filtering.
31  inline namespace SDF_VERSION_NAMESPACE {
32  //
33 
34  // Forward declare private data class.
35  class JointAxisPrivate;
36  struct PoseRelativeToGraph;
37 
41  {
43  public: JointAxis();
44 
47  public: JointAxis(const JointAxis &_jointAxis);
48 
51  public: JointAxis(JointAxis &&_jointAxis) noexcept;
52 
56  public: JointAxis &operator=(JointAxis &&_jointAxis);
57 
61  public: JointAxis &operator=(const JointAxis &_jointAxis);
62 
64  public: ~JointAxis();
65 
72  public: Errors Load(ElementPtr _sdf);
73 
78  public: double InitialPosition() const;
79 
83  public: void SetInitialPosition(const double _pos);
84 
92  public: ignition::math::Vector3d Xyz() const;
93 
97  public: void SetXyz(const ignition::math::Vector3d &_xyz);
98 
104  public: bool UseParentModelFrame() const
105  SDF_DEPRECATED(9.0);
106 
112  public: void SetUseParentModelFrame(const bool _parentModelFrame)
113  SDF_DEPRECATED(9.0);
114 
120  public: double Damping() const;
121 
127  public: void SetDamping(const double _damping);
128 
133  public: double Friction() const;
134 
138  public: void SetFriction(const double _friction);
139 
144  public: double SpringReference() const;
145 
149  public: void SetSpringReference(const double _spring);
150 
155  public: double SpringStiffness() const;
156 
160  public: void SetSpringStiffness(const double _spring);
161 
167  public: double Lower() const;
168 
174  public: void SetLower(const double _lower);
175 
181  public: double Upper() const;
182 
188  public: void SetUpper(const double _upper) const;
189 
194  public: double Effort() const;
195 
200  public: void SetEffort(double _effort);
201 
206  public: double MaxVelocity() const;
207 
211  public: void SetMaxVelocity(const double _velocity) const;
212 
216  public: double Stiffness() const;
217 
222  public: void SetStiffness(const double _stiffness) const;
223 
227  public: double Dissipation() const;
228 
232  public: void SetDissipation(const double _dissipation) const;
233 
238  public: const std::string& XyzExpressedIn() const;
239 
244  public: void SetXyzExpressedIn(const std::string &_frame);
245 
253  public: Errors ResolveXyz(
254  ignition::math::Vector3d &_xyz,
255  const std::string &_resolveTo = "") const;
256 
261  public: sdf::ElementPtr Element() const;
262 
267  private: void SetXmlParentName(const std::string &_xmlParentName);
268 
273  private: void SetPoseRelativeToGraph(
274  std::weak_ptr<const PoseRelativeToGraph> _graph);
275 
277  friend class Joint;
278 
280  private: JointAxisPrivate *dataPtr;
281  };
282  }
283 }
284 #endif
class SDFORMAT_VISIBLE Element
Definition: Element.hh:49
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:53
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:89
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:48
Definition: Joint.hh:82
Parameters related to the axis of rotation for rotational joints, and the axis of translation for pri...
Definition: JointAxis.hh:40
namespace for Simulation Description Format parser
Definition: Actor.hh:32
#define SDF_DEPRECATED(version)
Definition: Types.hh:38