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 
29 namespace gazebo
30 {
31  namespace physics
32  {
34  class DARTJoint : public Joint
35  {
38  public: DARTJoint(BasePtr _parent);
39 
41  public: virtual ~DARTJoint();
42 
43  // Documentation inherited.
44  public: virtual void Load(sdf::ElementPtr _sdf);
45 
47  public: virtual void Init();
48 
49  // Documentation inherited.
50  public: virtual void Reset();
51 
52  // Documentation inherited.
53  public: virtual LinkPtr GetJointLink(int _index) const;
54 
55  // Documentation inherited.
56  public: virtual bool AreConnected(LinkPtr _one, LinkPtr _two) const;
57 
58  // Documentation inherited.
59  public: virtual void Attach(LinkPtr _parent, LinkPtr _child);
60 
61  // Documentation inherited.
62  public: virtual void Detach();
63 
65  public: virtual void SetAnchor(int /*_index*/,
66  const gazebo::math::Vector3 &/*_anchor*/);
67 
68  // Documentation inherited
69  public: virtual void SetDamping(int _index, double _damping);
70 
71  // Documentation inherited.
72  public: virtual void SetHighStop(int _index, const math::Angle &_angle);
73 
74  // Documentation inherited.
75  public: virtual void SetLowStop(int _index, const math::Angle &_angle);
76 
77  // Documentation inherited.
78  public: virtual math::Angle GetHighStop(int _index);
79 
80  // Documentation inherited.
81  public: virtual math::Angle GetLowStop(int _index);
82 
83  // Documentation inherited.
84  public: virtual math::Vector3 GetLinkForce(unsigned int _index) const;
85 
86  // Documentation inherited.
87  public: virtual math::Vector3 GetLinkTorque(unsigned int _index) const;
88 
89  // Documentation inherited.
90  public: virtual void SetAttribute(const std::string &_key, int _index,
91  const boost::any &_value);
92 
93  // Documentation inherited.
94  public: virtual double GetAttribute(const std::string &_key,
95  unsigned int _index);
96 
97  // Documentation inherited.
98  public: virtual JointWrench GetForceTorque(int _index);
99 
100  // Documentation inherited.
101  public: virtual JointWrench GetForceTorque(unsigned int _index);
102 
103  // Documentation inherited.
104  public: virtual void SetForce(int _index, double _force);
105 
106  // Documentation inherited.
107  public: virtual double GetForce(unsigned int _index);
108 
109  // Documentation inherited.
110  public: virtual unsigned int GetAngleCount() const;
111 
112  // Documentation inherited.
113  public: virtual void ApplyDamping();
114 
123  protected: virtual void SetForceImpl(int _index, double _force) = 0;
124 
128  private: void SaveForce(int _index, double _force);
129 
132  public: DARTModelPtr GetDARTModel() const;
133 
136  public: dart::dynamics::Joint *GetDARTJoint();
137 
143  private: double forceApplied[MAX_JOINT_AXIS];
144 
147  private: common::Time forceAppliedTime;
148 
151 
153  protected: dart::dynamics::Joint *dtJoint;
154 
156  protected: dart::dynamics::BodyNode *dtChildBodyNode;
157  };
158  }
159 }
160 #endif