BulletScrewJoint.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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 screw or primastic joint
18  * Author: Nate Koenig
19  * Date: 24 May 2009
20  */
21 
22 #ifndef _BULLETSCREWJOINT_HH_
23 #define _BULLETSCREWJOINT_HH_
24 
25 #include <string>
26 
29 #include "gazebo/util/system.hh"
30 
31 namespace gazebo
32 {
33  namespace physics
34  {
35  class btScrewConstraint;
36 
40 
42  class GZ_PHYSICS_VISIBLE BulletScrewJoint : public ScrewJoint<BulletJoint>
43  {
47  public: BulletScrewJoint(btDynamicsWorld *_world, BasePtr _parent);
48 
50  public: virtual ~BulletScrewJoint();
51 
54  public: virtual void Load(sdf::ElementPtr _sdf);
55 
56  // Documentation inherited
57  public: virtual math::Vector3 GetAnchor(unsigned int _index) const;
58 
59  // Documentation inherited
60  public: virtual void SetAnchor(unsigned int _index,
61  const math::Vector3 &_anchor);
62 
63  // Documentation inherited.
64  public: virtual void Init();
65 
69  public: void SetAxis(unsigned int _index, const math::Vector3 &_axis);
70 
71  // Documentation inherited
72  public: virtual void SetThreadPitch(unsigned int _index,
73  double _threadPitch);
74 
75  // Documentation inherited
76  public: virtual void SetThreadPitch(double _threadPitch);
77 
78  // Documentation inherited
79  public: virtual double GetThreadPitch(unsigned int _index);
80 
81  // Documentation inherited
82  public: virtual double GetThreadPitch();
83 
84  // Documentation inherited.
85  public: virtual bool SetHighStop(unsigned int _index,
86  const math::Angle &_angle);
87 
88  // Documentation inherited.
89  public: virtual bool SetLowStop(unsigned int _index,
90  const math::Angle &_angle);
91 
94  public: virtual double GetVelocity(unsigned int _index) const;
95 
99  public: virtual void SetVelocity(unsigned int _index, double _vel);
100 
104  public: virtual void SetMaxForce(unsigned int _index, double _force);
105 
109  public: virtual double GetMaxForce(unsigned int _index);
110 
114  public: virtual math::Vector3 GetGlobalAxis(unsigned int _index) const;
115 
116  // Documentation inherited.
117  public: virtual double GetParam(const std::string &_key,
118  unsigned int _index);
119 
120  // Documentation inherited.
121  protected: virtual math::Angle GetAngleImpl(unsigned int _index) const;
122 
123  // Documentation inherited.
124  protected: virtual void SetForceImpl(unsigned int _index, double _force);
125 
127  private: btScrewConstraint *bulletScrew;
128 
131  private: math::Vector3 initialWorldAxis;
132  };
134  }
135 }
136 #endif
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:68
#define GZ_PHYSICS_VISIBLE
Definition: system.hh:318
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
A screw joint, which has both prismatic and rotational DOFs.
Definition: ScrewJoint.hh:34
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
A screw joint.
Definition: BulletScrewJoint.hh:42
An angle and related functions.
Definition: Angle.hh:53