##

gzBtUniversalConstraint.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_BULLET_UNIVERSAL_CONSTRAINT_
#define _GAZEBO_BULLET_UNIVERSAL_CONSTRAINT_
#include "gazebo/physics/bullet/bullet_inc.h"
ATTRIBUTE_ALIGNED16(class) gzBtUniversalConstraint
: public btGeneric6DofConstraint
{
public: BT_DECLARE_ALIGNED_ALLOCATOR();
public: gzBtUniversalConstraint(
btRigidBody &_rbA,
btRigidBody &_rbB,
const btVector3 &_anchor,
const btVector3 &_axis1,
const btVector3 &_axis2);
public: gzBtUniversalConstraint(
btRigidBody &_rbA,
const btVector3 &_anchor,
const btVector3 &_axis1,
const btVector3 &_axis2);
public: const btVector3 &getAnchor();
public: const btVector3 &getAnchor2();
public: const btVector3 &getAxis1();
public: const btVector3 &getAxis2();
public: btScalar getAngle1();
public: btScalar getAngle2();
public: void getUpperLimit(btScalar &_ang1max, btScalar &_ang2max);
public: void getLowerLimit(btScalar &_ang1min, btScalar &_ang2min);
public: void setUpperLimit(btScalar _ang1max, btScalar _ang2max);
public: void setLowerLimit(btScalar _ang1min, btScalar _ang2min);
public: void setAxis(const btVector3 &_axis1, const btVector3 &_axis2);
public: btScalar getMaxMotorImpulse1() const;
public: btScalar getMaxMotorImpulse2() const;
public: void setMaxMotorImpulse1(btScalar _i);
public: void setMaxMotorImpulse2(btScalar _i);
protected: btVector3 m_anchor;
protected: btVector3 m_axis1;
protected: btVector3 m_axis2;
private: btScalar maxMotorImpulse[2];
};
#endif
gzBtUniversalConstraint::setLowerLimit
void setLowerLimit(btScalar _ang1min, btScalar _ang2min)
Set lower limits.
gzBtUniversalConstraint::setAxis
void setAxis(const btVector3 &_axis1, const btVector3 &_axis2)
Set the axis of rotation.
gzBtUniversalConstraint::getAnchor
const btVector3 & getAnchor()
Get the anchor point in link A reference frame.
gzBtUniversalConstraint::getAxis1
const btVector3 & getAxis1()
Get the first axis of rotation.
gzBtUniversalConstraint::getAngle1
btScalar getAngle1()
Get the value of angle 1 in radians.
gzBtUniversalConstraint::gzBtUniversalConstraint
gzBtUniversalConstraint(btRigidBody &_rbA, btRigidBody &_rbB, const btVector3 &_anchor, const btVector3 &_axis1, const btVector3 &_axis2)
Constructor.
gzBtUniversalConstraint::getAnchor2
const btVector3 & getAnchor2()
Get the anchor point in link B reference frame.
bullet_inc.h
gzBtUniversalConstraint::getUpperLimit
void getUpperLimit(btScalar &_ang1max, btScalar &_ang2max)
Get upper limits.
gzBtUniversalConstraint::getAngle2
btScalar getAngle2()
Get the value of angle 2 in radians.
gzBtUniversalConstraint::getMaxMotorImpulse2
btScalar getMaxMotorImpulse2() const
Get the maximum allowed motor impluse for the second axis of rotation.
gzBtUniversalConstraint::getAxis2
const btVector3 & getAxis2()
Get the second axis of rotation.
gzBtUniversalConstraint::m_axis2
btVector3 m_axis2
Second axis of rotation.
Definition: gzBtUniversalConstraint.hh:135
gzBtUniversalConstraint::BT_DECLARE_ALIGNED_ALLOCATOR
BT_DECLARE_ALIGNED_ALLOCATOR()
gzBtUniversalConstraint::setUpperLimit
void setUpperLimit(btScalar _ang1max, btScalar _ang2max)
Set upper limits.
gzBtUniversalConstraint::getMaxMotorImpulse1
btScalar getMaxMotorImpulse1() const
Get the maximum allowed motor impluse for the first axis of rotation.
gzBtUniversalConstraint::setMaxMotorImpulse2
void setMaxMotorImpulse2(btScalar _i)
Set the maximum allowed motor impluse for the second axis of rotation.
gzBtUniversalConstraint::setMaxMotorImpulse1
void setMaxMotorImpulse1(btScalar _i)
Set the maximum allowed motor impluse for the first axis of rotation.
gzBtUniversalConstraint::m_anchor
btVector3 m_anchor
Anchor point in world coordinate frame.
Definition: gzBtUniversalConstraint.hh:129
gzBtUniversalConstraint
Functions that implement a universal joint/constraint using bullet.
Definition: gzBtUniversalConstraint.hh:28
gzBtUniversalConstraint::getLowerLimit
void getLowerLimit(btScalar &_ang1min, btScalar &_ang2min)
Get lower limits.
gzBtUniversalConstraint::m_axis1
btVector3 m_axis1
First axis of rotation.
Definition: gzBtUniversalConstraint.hh:132