BulletScrewJoint.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 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 ignition::math::Vector3d Anchor(
58  const unsigned int _index) const;
59 
60  // Documentation inherited
61  public: virtual void SetAnchor(const unsigned int _index,
62  const ignition::math::Vector3d &_anchor);
63 
64  // Documentation inherited.
65  public: virtual void Init();
66 
70  public: void SetAxis(const unsigned int _index,
71  const ignition::math::Vector3d &_axis);
72 
73  // Documentation inherited
74  public: virtual void SetThreadPitch(unsigned int _index,
75  double _threadPitch);
76 
77  // Documentation inherited
78  public: virtual void SetThreadPitch(double _threadPitch);
79 
80  // Documentation inherited
81  public: virtual double GetThreadPitch(unsigned int _index);
82 
83  // Documentation inherited
84  public: virtual double GetThreadPitch();
85 
86  // Documentation inherited.
87  public: virtual void SetUpperLimit(const unsigned int _index,
88  const double _limit);
89 
90  // Documentation inherited.
91  public: virtual void SetLowerLimit(const unsigned int _index,
92  const double _limit);
93 
96  public: virtual double GetVelocity(unsigned int _index) const;
97 
101  public: virtual void SetVelocity(unsigned int _index, double _vel);
102 
106  public: virtual ignition::math::Vector3d GlobalAxis(
107  const unsigned int _index) const;
108 
109  // Documentation inherited.
110  public: virtual double GetParam(const std::string &_key,
111  unsigned int _index);
112 
113  // Documentation inherited.
114  protected: virtual double PositionImpl(const unsigned int _index) const;
115 
116  // Documentation inherited.
117  protected: virtual void SetForceImpl(unsigned int _index, double _force);
118 
120  private: btScrewConstraint *bulletScrew;
121 
124  private: ignition::math::Vector3d initialWorldAxis;
125  };
127  }
128 }
129 #endif
Forward declarations for the common classes.
Definition: Animation.hh:26
A screw joint, which has both prismatic and rotational DOFs.
Definition: ScrewJoint.hh:35
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
A screw joint.
Definition: BulletScrewJoint.hh:42
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77