All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
gzBtUniversalConstraint.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 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 
22 ATTRIBUTE_ALIGNED16(class) gzBtUniversalConstraint
23 : public btGeneric6DofConstraint
24 {
25  public: BT_DECLARE_ALIGNED_ALLOCATOR();
26 
35  btRigidBody &_rbA,
36  btRigidBody &_rbB,
37  const btVector3 &_anchor,
38  const btVector3 &_axis1,
39  const btVector3 &_axis2);
40 
48  btRigidBody &_rbA,
49  const btVector3 &_anchor,
50  const btVector3 &_axis1,
51  const btVector3 &_axis2);
52 
55  public: const btVector3 &getAnchor();
56 
59  public: const btVector3 &getAnchor2();
60 
63  public: const btVector3 &getAxis1();
64 
67  public: const btVector3 &getAxis2();
68 
71  public: btScalar getAngle1();
72 
75  public: btScalar getAngle2();
76 
80  public: void getUpperLimit(btScalar &_ang1max, btScalar &_ang2max);
81 
85  public: void getLowerLimit(btScalar &_ang1min, btScalar &_ang2min);
86 
90  public: void setUpperLimit(btScalar _ang1max, btScalar _ang2max);
91 
95  public: void setLowerLimit(btScalar _ang1min, btScalar _ang2min);
96 
100  public: void setAxis(const btVector3 &_axis1, const btVector3 &_axis2);
101 
105  public: btScalar getMaxMotorImpulse1() const;
106 
110  public: btScalar getMaxMotorImpulse2() const;
111 
115  public: void setMaxMotorImpulse1(btScalar _i);
116 
120  public: void setMaxMotorImpulse2(btScalar _i);
121 
123  protected: btVector3 m_anchor;
124 
126  protected: btVector3 m_axis1;
127 
129  protected: btVector3 m_axis2;
130 
132  private: btScalar maxMotorImpulse[2];
133 };
134 
135 #endif
btVector3 m_anchor
Anchor point in world coordinate frame.
Definition: gzBtUniversalConstraint.hh:123
const btVector3 & getAxis1()
Get the first axis of rotation.
btScalar maxMotorImpulse[2]
Maximum motor impulses.
Definition: gzBtUniversalConstraint.hh:132
btScalar getAngle1()
Get the value of angle 1 in radians.
const btVector3 & getAnchor()
Get the anchor point in link A reference frame.
void getLowerLimit(btScalar &_ang1min, btScalar &_ang2min)
Get lower limits.
gzBtUniversalConstraint(btRigidBody &_rbA, btRigidBody &_rbB, const btVector3 &_anchor, const btVector3 &_axis1, const btVector3 &_axis2)
Constructor.
btScalar getMaxMotorImpulse1() const
Get the maximum allowed motor impluse for the first axis of rotation.
void setMaxMotorImpulse1(btScalar _i)
Set the maximum allowed motor impluse for the first axis of rotation.
btScalar getMaxMotorImpulse2() const
Get the maximum allowed motor impluse for the second axis of rotation.
void setMaxMotorImpulse2(btScalar _i)
Set the maximum allowed motor impluse for the second axis of rotation.
btVector3 m_axis2
Second axis of rotation.
Definition: gzBtUniversalConstraint.hh:129
btScalar getAngle2()
Get the value of angle 2 in radians.
const btVector3 & getAxis2()
Get the second axis of rotation.
void setLowerLimit(btScalar _ang1min, btScalar _ang2min)
Set lower limits.
void getUpperLimit(btScalar &_ang1max, btScalar &_ang2max)
Get upper limits.
const btVector3 & getAnchor2()
Get the anchor point in link B reference frame.
btVector3 m_axis1
First axis of rotation.
Definition: gzBtUniversalConstraint.hh:126
void setUpperLimit(btScalar _ang1max, btScalar _ang2max)
Set upper limits.
void setAxis(const btVector3 &_axis1, const btVector3 &_axis2)
Set the axis of rotation.