BulletSliderJoint.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-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 #ifndef _GAZEBO_BULLETSLIDERJOINT_HH_
18 #define _GAZEBO_BULLETSLIDERJOINT_HH_
19 
20 #include <string>
21 #include "gazebo/math/Angle.hh"
22 #include "gazebo/math/Vector3.hh"
26 #include "gazebo/util/system.hh"
27 
28 class btSliderConstraint;
29 
30 namespace gazebo
31 {
32  namespace physics
33  {
37 
39  class GZ_PHYSICS_VISIBLE BulletSliderJoint : public SliderJoint<BulletJoint>
40  {
42  public: BulletSliderJoint(btDynamicsWorld *world, BasePtr _parent);
43 
45  public: virtual ~BulletSliderJoint();
46 
48  protected: virtual void Load(sdf::ElementPtr _sdf);
49 
50  // Documentation inherited.
51  protected: virtual void Init();
52 
53  // Documentation inherited.
54  public: virtual void SetAxis(unsigned int _index,
55  const math::Vector3 &_axis);
56 
57  // Documentation inherited.
58  public: virtual void SetDamping(unsigned int _index,
59  const double _damping);
60 
61  // Documentation inherited.
62  public: virtual bool SetHighStop(unsigned int _index,
63  const math::Angle &_angle);
64 
65  // Documentation inherited.
66  public: virtual bool SetLowStop(unsigned int _index,
67  const math::Angle &_angle);
68 
69  // Documentation inherited.
70  public: virtual math::Angle GetHighStop(unsigned int _index);
71 
72  // Documentation inherited.
73  public: virtual math::Angle GetLowStop(unsigned int _index);
74 
75  // Documentation inherited.
76  public: virtual double GetVelocity(unsigned int _index) const;
77 
78  // Documentation inherited.
79  public: virtual void SetVelocity(unsigned int _index, double _angle);
80 
81  // Documentation inherited.
82  public: virtual math::Vector3 GetGlobalAxis(unsigned int _index) const;
83 
84  // Documentation inherited.
85  public: virtual math::Angle GetAngleImpl(unsigned int _index) const;
86 
87  // Documentation inherited.
88  public: virtual bool SetParam(const std::string &_key,
89  unsigned int _index,
90  const boost::any &_value);
91 
92  // Documentation inherited.
93  public: virtual double GetParam(const std::string &_key,
94  unsigned int _index);
95 
96  // Documentation inherited.
97  protected: virtual void SetForceImpl(unsigned int _index, double _effort);
98 
100  private: btSliderConstraint *bulletSlider;
101 
104  private: math::Vector3 initialWorldAxis;
105  };
106 
108  }
109 }
110 #endif
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:72
#define GZ_PHYSICS_VISIBLE
Definition: system.hh:259
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
A slider joint.
Definition: SliderJoint.hh:38
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
An angle and related functions.
Definition: Angle.hh:53
A slider joint.
Definition: BulletSliderJoint.hh:39