DARTJoint.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2016 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 
18 #ifndef _GAZEBO_DARTJOINT_HH_
19 #define _GAZEBO_DARTJOINT_HH_
20 
21 #include <boost/any.hpp>
22 #include <string>
23 
25 #include "gazebo/physics/Joint.hh"
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace physics
33  {
35  class DARTJointPrivate;
36 
39  {
42  public: DARTJoint(BasePtr _parent);
43 
45  public: virtual ~DARTJoint();
46 
47  // Documentation inherited.
48  public: virtual void Load(sdf::ElementPtr _sdf);
49 
51  public: virtual void Init();
52 
53  // Documentation inherited.
54  public: virtual void Reset();
55 
56  // Documentation inherited.
57  public: virtual LinkPtr GetJointLink(unsigned int _index) const;
58 
59  // Documentation inherited.
60  public: virtual bool AreConnected(LinkPtr _one, LinkPtr _two) const;
61 
62  // Documentation inherited.
63  public: virtual void Attach(LinkPtr _parent, LinkPtr _child);
64 
65  // Documentation inherited.
66  public: virtual void CacheForceTorque();
67 
68  // Documentation inherited.
69  public: virtual void Detach();
70 
72  public: virtual void SetAnchor(unsigned int /*_index*/,
73  const gazebo::math::Vector3 &/*_anchor*/);
74 
75  // Documentation inherited
76  public: virtual void SetDamping(unsigned int _index, double _damping);
77 
78  // Documentation inherited.
79  public: virtual void SetStiffness(unsigned int _index,
80  const double _stiffness);
81 
82  // Documentation inherited.
83  public: virtual void SetStiffnessDamping(unsigned int _index,
84  double _stiffness, double _damping, double _reference = 0);
85 
86  // Documentation inherited.
87  public: virtual bool SetHighStop(unsigned int _index,
88  const math::Angle &_angle);
89 
90  // Documentation inherited.
91  public: virtual bool SetLowStop(unsigned int _index,
92  const math::Angle &_angle);
93 
94  // Documentation inherited.
95  public: virtual math::Angle GetHighStop(unsigned int _index);
96 
97  // Documentation inherited.
98  public: virtual math::Angle GetLowStop(unsigned int _index);
99 
100  // Documentation inherited.
101  public: virtual math::Vector3 GetLinkForce(unsigned int _index) const;
102 
103  // Documentation inherited.
104  public: virtual math::Vector3 GetLinkTorque(unsigned int _index) const;
105 
106  // Documentation inherited.
107  public: virtual bool SetParam(const std::string &_key,
108  unsigned int _index,
109  const boost::any &_value);
110 
111  // Documentation inherited.
112  public: virtual double GetParam(const std::string &_key,
113  unsigned int _index);
114 
115  // Documentation inherited.
116  public: virtual JointWrench GetForceTorque(unsigned int _index);
117 
118  // Documentation inherited.
119  public: virtual void SetForce(unsigned int _index, double _force);
120 
121  // Documentation inherited.
122  public: virtual double GetForce(unsigned int _index);
123 
124  // Documentation inherited.
125  public: virtual unsigned int GetAngleCount() const;
126 
127  // Documentation inherited.
128  public: virtual void ApplyDamping();
129 
138  protected: virtual void SetForceImpl(unsigned int _index,
139  double _force) = 0;
140 
144  private: void SaveForce(unsigned int _index, double _force);
145 
148  public: DARTModelPtr GetDARTModel() const;
149 
152  public: dart::dynamics::Joint *GetDARTJoint();
153 
157  };
158  }
159 }
160 #endif
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:72
#define GZ_PHYSICS_VISIBLE
Definition: system.hh:259
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
boost::shared_ptr< DARTModel > DARTModelPtr
Definition: DARTTypes.hh:44
DARTJointPrivate * dataPtr
Definition: DARTJoint.hh:156
Base class for all joints.
Definition: Joint.hh:50
Wrench information from a joint.
Definition: JointWrench.hh:39
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Definition: DARTJointPrivate.hh:32
DART joint interface.
Definition: DARTJoint.hh:38
An angle and related functions.
Definition: Angle.hh:53
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:100