gzBtUniversalConstraint.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_BULLET_UNIVERSAL_CONSTRAINT_
18 #define _GAZEBO_BULLET_UNIVERSAL_CONSTRAINT_
19 
21 
24 
28 ATTRIBUTE_ALIGNED16(class) gzBtUniversalConstraint
29 : public btGeneric6DofConstraint
30 {
31  public: BT_DECLARE_ALIGNED_ALLOCATOR();
32 
41  btRigidBody &_rbA,
42  btRigidBody &_rbB,
43  const btVector3 &_anchor,
44  const btVector3 &_axis1,
45  const btVector3 &_axis2);
46 
54  btRigidBody &_rbA,
55  const btVector3 &_anchor,
56  const btVector3 &_axis1,
57  const btVector3 &_axis2);
58 
61  public: const btVector3 &getAnchor();
62 
65  public: const btVector3 &getAnchor2();
66 
69  public: const btVector3 &getAxis1();
70 
73  public: const btVector3 &getAxis2();
74 
77  public: btScalar getAngle1();
78 
81  public: btScalar getAngle2();
82 
86  public: void getUpperLimit(btScalar &_ang1max, btScalar &_ang2max);
87 
91  public: void getLowerLimit(btScalar &_ang1min, btScalar &_ang2min);
92 
96  public: void setUpperLimit(btScalar _ang1max, btScalar _ang2max);
97 
101  public: void setLowerLimit(btScalar _ang1min, btScalar _ang2min);
102 
106  public: void setAxis(const btVector3 &_axis1, const btVector3 &_axis2);
107 
111  public: btScalar getMaxMotorImpulse1() const;
112 
116  public: btScalar getMaxMotorImpulse2() const;
117 
121  public: void setMaxMotorImpulse1(btScalar _i);
122 
126  public: void setMaxMotorImpulse2(btScalar _i);
127 
129  protected: btVector3 m_anchor;
130 
132  protected: btVector3 m_axis1;
133 
135  protected: btVector3 m_axis2;
136 
138  private: btScalar maxMotorImpulse[2];
139 };
141 #endif
btVector3 m_axis1
First axis of rotation.
Definition: gzBtUniversalConstraint.hh:132
Functions that implement a universal joint/constraint using bullet.
Definition: gzBtUniversalConstraint.hh:28
btVector3 m_axis2
Second axis of rotation.
Definition: gzBtUniversalConstraint.hh:135
btVector3 m_anchor
Anchor point in world coordinate frame.
Definition: gzBtUniversalConstraint.hh:129