DARTLink.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_DARTLINK_HH_
19 #define _GAZEBO_DARTLINK_HH_
20 
21 #include <vector>
22 
23 #include "gazebo/physics/Link.hh"
24 
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
31  namespace physics
32  {
34  class DARTLinkPrivate;
35 
40 
43  {
45  public: explicit DARTLink(EntityPtr _parent);
46 
48  public: virtual ~DARTLink();
49 
50  // Documentation inherited
51  public: virtual void Load(sdf::ElementPtr _ptr);
52 
53  // Documentation inherited.
54  public: virtual void Init();
55 
56  // Documentation inherited.
57  public: virtual void Fini();
58 
59  // Documentation inherited
60  public: virtual void OnPoseChange();
61 
62  // Documentation inherited
63  public: virtual void SetEnabled(bool _enable) const;
64 
65  // Documentation inherited
66  public: virtual bool GetEnabled() const;
67 
68  // Documentation inherited
69  public: virtual void SetLinearVel(const math::Vector3 &_vel);
70 
71  // Documentation inherited
72  public: virtual void SetAngularVel(const math::Vector3 &_vel);
73 
74  // Documentation inherited
75  public: virtual void SetForce(const math::Vector3 &_force);
76 
77  // Documentation inherited
78  public: virtual void SetTorque(const math::Vector3 &_torque);
79 
80  // Documentation inherited
81  public: virtual void AddForce(const math::Vector3 &_force);
82 
83  // Documentation inherited
84  public: virtual void AddRelativeForce(const math::Vector3 &_force);
85 
86  // Documentation inherited
87  public: virtual void AddForceAtWorldPosition(const math::Vector3 &_force,
88  const math::Vector3 &_pos);
89 
90  // Documentation inherited
91  public: virtual void AddForceAtRelativePosition(
92  const math::Vector3 &_force,
93  const math::Vector3 &_relpos);
94 
95  // Documentation inherited
96  public: virtual void AddLinkForce(const math::Vector3 &_force,
97  const math::Vector3 &_offset = math::Vector3::Zero);
98 
99  // Documentation inherited
100  public: virtual void AddTorque(const math::Vector3 &_torque);
101 
102  // Documentation inherited
103  public: virtual void AddRelativeTorque(const math::Vector3& _torque);
104 
105  // Documentation inherited
106  public: virtual math::Vector3 GetWorldLinearVel(
107  const math::Vector3& _offset = math::Vector3(0, 0, 0)) const;
108 
109  // Documentation inherited
110  public: virtual math::Vector3 GetWorldLinearVel(
111  const math::Vector3 &_offset,
112  const math::Quaternion &_q) const;
113 
114  // Documentation inherited
115  public: virtual math::Vector3 GetWorldCoGLinearVel() const;
116 
117  // Documentation inherited
118  public: virtual math::Vector3 GetWorldAngularVel() const;
119 
120  // Documentation inherited
121  public: virtual math::Vector3 GetWorldForce() const;
122 
123  // Documentation inherited
124  public: virtual math::Vector3 GetWorldTorque() const;
125 
126  // Documentation inherited
127  public: virtual void SetGravityMode(bool _mode);
128 
129  // Documentation inherited
130  public: virtual bool GetGravityMode() const;
131 
132  // Documentation inherited
133  public: virtual void SetSelfCollide(bool _collide);
134 
135  // Documentation inherited
136  public: virtual void SetLinearDamping(double _damping);
137 
138  // Documentation inherited
139  public: virtual void SetAngularDamping(double _damping);
140 
141  // Documentation inherited
142  public: virtual void SetKinematic(const bool &_state);
143 
144  // Documentation inherited
145  public: virtual bool GetKinematic() const;
146 
147  // Documentation inherited
148  public: virtual void SetAutoDisable(bool _disable);
149 
150  // Documentation inherited
151  public: virtual void SetLinkStatic(bool _static);
152 
156  public: void updateDirtyPoseFromDARTTransformation();
157 
160  public: DARTPhysicsPtr GetDARTPhysics(void) const;
161 
164  public: dart::simulation::World *GetDARTWorld(void) const;
165 
168  public: DARTModelPtr GetDARTModel() const;
169 
172  public: dart::dynamics::BodyNode *GetDARTBodyNode() const;
173 
176  public: void SetDARTParentJoint(DARTJointPtr _dartParentJoint);
177 
180  public: void AddDARTChildJoint(DARTJointPtr _dartChildJoint);
181 
182  // Documentation inherited.
183  public: virtual void UpdateMass();
184 
187  private: DARTLinkPrivate *dataPtr;
188  };
190  }
191 }
192 #endif
#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< DARTPhysics > DARTPhysicsPtr
Definition: DARTTypes.hh:41
Definition: DARTLinkPrivate.hh:32
DART wrapper forward declarations and typedefs.
boost::shared_ptr< Entity > EntityPtr
Definition: PhysicsTypes.hh:80
boost::shared_ptr< DARTModel > DARTModelPtr
Definition: DARTTypes.hh:44
A quaternion class.
Definition: Quaternion.hh:42
static const Vector3 Zero
math::Vector3(0, 0, 0)
Definition: Vector3.hh:42
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< DARTJoint > DARTJointPtr
Definition: DARTTypes.hh:46