All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DARTJoint.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2014 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  {
36  {
39  public: DARTJoint(BasePtr _parent);
40 
42  public: virtual ~DARTJoint();
43 
44  // Documentation inherited.
45  public: virtual void Load(sdf::ElementPtr _sdf);
46 
48  public: virtual void Init();
49 
50  // Documentation inherited.
51  public: virtual void Reset();
52 
53  // Documentation inherited.
54  public: virtual LinkPtr GetJointLink(unsigned int _index) const;
55 
56  // Documentation inherited.
57  public: virtual bool AreConnected(LinkPtr _one, LinkPtr _two) const;
58 
59  // Documentation inherited.
60  public: virtual void Attach(LinkPtr _parent, LinkPtr _child);
61 
62  // Documentation inherited.
63  public: virtual void Detach();
64 
66  public: virtual void SetAnchor(unsigned int /*_index*/,
67  const gazebo::math::Vector3 &/*_anchor*/);
68 
69  // Documentation inherited
70  public: virtual void SetDamping(unsigned int _index, double _damping);
71 
72  // Documentation inherited.
73  public: virtual void SetStiffness(unsigned int _index,
74  const double _stiffness);
75 
76  // Documentation inherited.
77  public: virtual void SetStiffnessDamping(unsigned int _index,
78  double _stiffness, double _damping, double _reference = 0);
79 
80  // Documentation inherited.
81  public: virtual bool SetHighStop(unsigned int _index,
82  const math::Angle &_angle);
83 
84  // Documentation inherited.
85  public: virtual bool SetLowStop(unsigned int _index,
86  const math::Angle &_angle);
87 
88  // Documentation inherited.
89  public: virtual math::Angle GetHighStop(unsigned int _index);
90 
91  // Documentation inherited.
92  public: virtual math::Angle GetLowStop(unsigned int _index);
93 
94  // Documentation inherited.
95  public: virtual math::Vector3 GetLinkForce(unsigned int _index) const;
96 
97  // Documentation inherited.
98  public: virtual math::Vector3 GetLinkTorque(unsigned int _index) const;
99 
100  // Documentation inherited.
101  public: virtual bool SetParam(const std::string &_key,
102  unsigned int _index,
103  const boost::any &_value);
104 
105  // Documentation inherited.
106  public: virtual void SetAttribute(const std::string &_key,
107  unsigned int _index,
108  const boost::any &_value)
109  GAZEBO_DEPRECATED(3.0);
110 
111  // Documentation inherited.
112  public: virtual double GetParam(const std::string &_key,
113  unsigned int _index);
114 
115  // Documentation inherited.
116  public: virtual double GetAttribute(const std::string &_key,
117  unsigned int _index) GAZEBO_DEPRECATED(3.0);
118 
119  // Documentation inherited.
120  public: virtual JointWrench GetForceTorque(unsigned int _index);
121 
122  // Documentation inherited.
123  public: virtual void SetForce(unsigned int _index, double _force);
124 
125  // Documentation inherited.
126  public: virtual double GetForce(unsigned int _index);
127 
128  // Documentation inherited.
129  public: virtual unsigned int GetAngleCount() const;
130 
131  // Documentation inherited.
132  public: virtual void ApplyDamping();
133 
142  protected: virtual void SetForceImpl(unsigned int _index,
143  double _force) = 0;
144 
148  private: void SaveForce(unsigned int _index, double _force);
149 
152  public: DARTModelPtr GetDARTModel() const;
153 
156  public: dart::dynamics::Joint *GetDARTJoint();
157 
163  private: double forceApplied[MAX_JOINT_AXIS];
164 
167  private: common::Time forceAppliedTime;
168 
171 
173  protected: dart::dynamics::Joint *dtJoint;
174 
176  protected: dart::dynamics::BodyNode *dtChildBodyNode;
177  };
178  }
179 }
180 #endif