BulletHinge2Joint.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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 /* Desc: A hinge joint with 2 degrees of freedom
18  * Author: Nate Koenig, Andrew Howard
19  * Date: 21 May 2003
20  */
21 
22 #ifndef _BULLETHINGE2JOINT_HH_
23 #define _BULLETHINGE2JOINT_HH_
24 
25 #include "gazebo/math/Vector3.hh"
29 #include "gazebo/util/system.hh"
30 
31 class btHinge2Constraint;
32 
33 namespace gazebo
34 {
35  namespace physics
36  {
40 
42  class GZ_PHYSICS_VISIBLE BulletHinge2Joint : public Hinge2Joint<BulletJoint>
43  {
45  public: BulletHinge2Joint(btDynamicsWorld *world, BasePtr _parent);
46 
48  public: virtual ~BulletHinge2Joint();
49 
50  // Documentation inherited.
51  protected: virtual void Load(sdf::ElementPtr _sdf);
52 
53  // Documentation inherited.
54  public: virtual void Init();
55 
56  // Documentation inherited.
57  public: virtual ignition::math::Vector3d Anchor(
58  const unsigned int _index) const;
59 
60  // Documentation inherited.
61  public: virtual void SetAxis(const unsigned int _index,
62  const ignition::math::Vector3d &_axis);
63 
64  // Function not implemented, will be removed in Gazebo 9.
65  public: virtual math::Vector3 GetAxis(unsigned int _index) const
66  GAZEBO_DEPRECATED(8.0);
67 
68  // Documentation inherited.
69  public: double GetVelocity(unsigned int _index) const;
70 
71  // Documentation inherited.
72  public: virtual void SetVelocity(unsigned int _index, double _angle);
73 
74  // Documentation inherited.
75  public: virtual void SetUpperLimit(const unsigned int _index,
76  const double _limit);
77 
78  // Documentation inherited.
79  public: virtual void SetLowerLimit(const unsigned int _index,
80  const double _limit);
81 
82  // Documentation inherited.
83  public: virtual double UpperLimit(const unsigned int _index) const;
84 
85  // Documentation inherited.
86  public: virtual double LowerLimit(const unsigned int _index) const;
87 
88  // Documentation inherited.
89  public: virtual ignition::math::Vector3d GlobalAxis(
90  const unsigned int _index) const;
91 
92  // Documentation inherited.
93  public: virtual double PositionImpl(const unsigned int _index) const;
94 
95  // Documentation inherited.
96  protected: virtual void SetForceImpl(unsigned int _index, double _torque);
97 
99  private: btHinge2Constraint *bulletHinge2;
100 
103  private: double angleOffset[2];
104 
107  private: ignition::math::Vector3d initialWorldAxis[2];
108  };
109 
111  }
112 }
113 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
A two axis hinge joint.
Definition: Hinge2Joint.hh:41
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:44
A two axis hinge joint.
Definition: BulletHinge2Joint.hh:42
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77