gzBtUniversalConstraint.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 #ifndef _GAZEBO_BULLET_UNIVERSAL_CONSTRAINT_
18 #define _GAZEBO_BULLET_UNIVERSAL_CONSTRAINT_
19 
21 
24 
28 ATTRIBUTE_ALIGNED16(class) gzBtUniversalConstraint
29 : public btGeneric6DofConstraint
30 {
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
void setLowerLimit(btScalar _ang1min, btScalar _ang2min)
Set lower limits.
void setAxis(const btVector3 &_axis1, const btVector3 &_axis2)
Set the axis of rotation.
const btVector3 & getAnchor()
Get the anchor point in link A reference frame.
const btVector3 & getAxis1()
Get the first axis of rotation.
btScalar getAngle1()
Get the value of angle 1 in radians.
gzBtUniversalConstraint(btRigidBody &_rbA, const btVector3 &_anchor, const btVector3 &_axis1, const btVector3 &_axis2)
Constructor.
gzBtUniversalConstraint(btRigidBody &_rbA, btRigidBody &_rbB, const btVector3 &_anchor, const btVector3 &_axis1, const btVector3 &_axis2)
Constructor.
const btVector3 & getAnchor2()
Get the anchor point in link B reference frame.
void getUpperLimit(btScalar &_ang1max, btScalar &_ang2max)
Get upper limits.
btScalar getAngle2()
Get the value of angle 2 in radians.
btScalar getMaxMotorImpulse2() const
Get the maximum allowed motor impluse for the second axis of rotation.
const btVector3 & getAxis2()
Get the second axis of rotation.
btVector3 m_axis2
Second axis of rotation.
Definition: gzBtUniversalConstraint.hh:135
BT_DECLARE_ALIGNED_ALLOCATOR()
void setUpperLimit(btScalar _ang1max, btScalar _ang2max)
Set upper limits.
btScalar getMaxMotorImpulse1() const
Get the maximum allowed motor impluse for the first axis of rotation.
void setMaxMotorImpulse2(btScalar _i)
Set the maximum allowed motor impluse for the second axis of rotation.
void setMaxMotorImpulse1(btScalar _i)
Set the maximum allowed motor impluse for the first axis of rotation.
btVector3 m_anchor
Anchor point in world coordinate frame.
Definition: gzBtUniversalConstraint.hh:129
Functions that implement a universal joint/constraint using bullet.
Definition: gzBtUniversalConstraint.hh:30
void getLowerLimit(btScalar &_ang1min, btScalar &_ang2min)
Get lower limits.
btVector3 m_axis1
First axis of rotation.
Definition: gzBtUniversalConstraint.hh:132