DARTJoint.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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  {
35  class DARTJointPrivate;
36 
39 
41  class GZ_PHYSICS_VISIBLE DARTJoint : public Joint
42  {
45  public: DARTJoint(BasePtr _parent);
46 
48  public: virtual ~DARTJoint();
49 
50  // Documentation inherited.
51  public: virtual void Load(sdf::ElementPtr _sdf);
52 
54  public: virtual void Init();
55 
56  // Documentation inherited.
57  public: virtual void Reset();
58 
59  // Documentation inherited.
60  public: virtual LinkPtr GetJointLink(unsigned int _index) const;
61 
62  // Documentation inherited.
63  public: virtual bool AreConnected(LinkPtr _one, LinkPtr _two) const;
64 
65  // Documentation inherited.
66  public: virtual void Attach(LinkPtr _parent, LinkPtr _child);
67 
68  // Documentation inherited.
69  public: virtual void CacheForceTorque();
70 
71  // Documentation inherited.
72  public: virtual void Detach();
73 
75  public: virtual void SetAnchor(const unsigned int /*_index*/,
76  const ignition::math::Vector3d &/*_anchor*/);
77 
78  // Documentation inherited
79  public: virtual void SetDamping(unsigned int _index, double _damping);
80 
81  // Documentation inherited.
82  public: virtual void SetStiffness(unsigned int _index,
83  const double _stiffness);
84 
85  // Documentation inherited.
86  public: virtual void SetStiffnessDamping(unsigned int _index,
87  double _stiffness, double _damping, double _reference = 0);
88 
89  // Documentation inherited.
90  public: virtual void SetUpperLimit(const unsigned int _index,
91  const double _limit);
92 
93  // Documentation inherited.
94  public: virtual void SetLowerLimit(const unsigned int _index,
95  const double _limit);
96 
97  // Documentation inherited.
98  public: virtual double UpperLimit(const unsigned int _index) const;
99 
100  // Documentation inherited.
101  public: virtual double LowerLimit(const unsigned int _index) const;
102 
103  // Documentation inherited.
104  public: virtual ignition::math::Vector3d LinkForce(
105  const unsigned int _index) const;
106 
107  // Documentation inherited.
108  public: virtual ignition::math::Vector3d LinkTorque(
109  const unsigned int _index) const;
110 
111  // Documentation inherited.
112  public: virtual bool SetParam(const std::string &_key,
113  unsigned int _index,
114  const boost::any &_value);
115 
116  // Documentation inherited.
117  public: virtual double GetParam(const std::string &_key,
118  unsigned int _index);
119 
120  // Documentation inherited.
121  public: virtual JointWrench GetForceTorque(unsigned int _index);
122 
123  // Documentation inherited.
124  public: virtual void SetForce(unsigned int _index, double _force);
125 
126  // Documentation inherited.
127  public: virtual double GetForce(unsigned int _index);
128 
129  // Documentation inherited.
130  public: virtual void ApplyDamping();
131 
140  protected: virtual void SetForceImpl(unsigned int _index,
141  double _force) = 0;
142 
146  private: void SaveForce(unsigned int _index, double _force);
147 
150  public: DARTModelPtr GetDARTModel() const;
151 
153  public: DARTJointPropPtr DARTProperties() const;
154 
157  public: void SetDARTJoint(dart::dynamics::Joint *_dtJoint);
158 
161  public: dart::dynamics::Joint *GetDARTJoint();
162 
165  protected: DARTJointPrivate *dataPtr;
166  };
168  }
169 }
170 #endif
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:109
boost::shared_ptr< DARTModel > DARTModelPtr
Definition: DARTTypes.hh:45
std::shared_ptr< dart::dynamics::Joint::Properties > DARTJointPropPtr
Definition: DARTTypes.hh:55
Base class for all joints.
Definition: Joint.hh:53
Wrench information from a joint.
Definition: JointWrench.hh:40
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
DART joint interface.
Definition: DARTJoint.hh:41
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77
DARTJointPrivate * dataPtr
Definition: DARTJoint.hh:165