BulletBallJoint.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 ball joint
18  * Author: Nate Koenig, Andrew Howard
19  * Date: 21 May 2003
20  */
21 
22 #ifndef _BULLETBALLJOINT_HH_
23 #define _BULLETBALLJOINT_HH_
24 
25 #include "gazebo/math/Vector3.hh"
26 
30 #include "gazebo/util/system.hh"
31 
32 class btPoint2PointConstraint;
33 
34 namespace gazebo
35 {
36  namespace physics
37  {
41 
43  class GZ_PHYSICS_VISIBLE BulletBallJoint : public BallJoint<BulletJoint>
44  {
46  public: BulletBallJoint(btDynamicsWorld *_world, BasePtr _parent);
47 
49  public: virtual ~BulletBallJoint();
50 
51  // Documentation inherited.
52  public: virtual void Load(sdf::ElementPtr _sdf);
53 
54  // Documentation inherited.
55  public: virtual void Init();
56 
57  // Documentation inherited.
58  public: ignition::math::Vector3d Anchor(
59  const unsigned int _index) const;
60 
61  // Function not implemented, will be removed in Gazebo 9.
62  public: virtual math::Vector3 GetAxis(unsigned int _index) const
63  GAZEBO_DEPRECATED(8.0);
64 
65  // Documentation inherited.
66  public: virtual void SetVelocity(unsigned int _index, double _angle);
67 
68  // Documentation inherited.
69  public: virtual double GetVelocity(unsigned int _index) const;
70 
71  // Documentation inherited.
72  public: virtual void SetUpperLimit(const unsigned int _index,
73  const double _limit);
74 
75  // Documentation inherited.
76  public: virtual void SetLowerLimit(const unsigned int _index,
77  const double _limit);
78 
79  // Documentation inherited.
80  public: virtual double PositionImpl(const unsigned int _index) const;
81 
82  // Documentation inherited.
83  public: virtual ignition::math::Vector3d GlobalAxis(
84  const unsigned int _index) const;
85 
86  // Documentation inherited.
87  protected: virtual void SetForceImpl(unsigned int _index, double _torque);
88 
89  // Documentation inherited.
90  public: virtual void SetAxis(const unsigned int _index,
91  const ignition::math::Vector3d &_axis);
92 
93  // Documentation inherited.
94  public: virtual double UpperLimit(const unsigned int _index) const;
95 
96  // Documentation inherited.
97  public: virtual double LowerLimit(const unsigned int _index) const;
98 
100  private: btPoint2PointConstraint *bulletBall;
101  };
102 
104  }
105 }
106 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:44
BulletBallJoint class models a ball joint in Bullet.
Definition: BulletBallJoint.hh:43
#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
Base class for a ball joint.
Definition: BallJoint.hh:40