Computational Embodied Neuroscience Simulator  1.1
3D simulation library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Static Private Attributes | List of all members
cens::CENSHingeConstraint Class Reference

A custom HingeConstraint Class. More...

#include <cens_physics.h>

Inheritance diagram for cens::CENSHingeConstraint:
Inheritance graph
[legend]
Collaboration diagram for cens::CENSHingeConstraint:
Collaboration graph
[legend]

Public Member Functions

 CENSHingeConstraint (btRigidBody &rbA, btRigidBody &rbB, const btVector3 &pivotInA, const btVector3 &pivotInB, btVector3 &axisInA, btVector3 &axisInB, bool useReferenceFrameA=false)
 
 CENSHingeConstraint (btRigidBody &rbA, const btVector3 &pivotInA, btVector3 &axisInA, bool useReferenceFrameA=false)
 
 CENSHingeConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame, bool useReferenceFrameA=false)
 
 CENSHingeConstraint (btRigidBody &rbA, const btTransform &rbAFrame, bool useReferenceFrameA=false)
 
void setPDMotorTarget (float targetAngle, float kp=3, float ki=0, float kd=.5, float dt=.05)
 

Static Private Attributes

static std::map
< CENSHingeConstraint *, float > 
angles
 

Detailed Description

A custom HingeConstraint Class.

Through this class a custom control of the motor of the joint can be implemented. The method CENSHingeConstraint::setPDMotorTarget can be used instead of the standard btHingeConstraint::setMotorTarget, to change the joint angular position with a PD control.

Definition at line 374 of file cens_physics.h.

Constructor & Destructor Documentation

cens::CENSHingeConstraint::CENSHingeConstraint ( btRigidBody &  rbA,
btRigidBody &  rbB,
const btVector3 &  pivotInA,
const btVector3 &  pivotInB,
btVector3 &  axisInA,
btVector3 &  axisInB,
bool  useReferenceFrameA = false 
)
inline

Definition at line 378 of file cens_physics.h.

cens::CENSHingeConstraint::CENSHingeConstraint ( btRigidBody &  rbA,
const btVector3 &  pivotInA,
btVector3 &  axisInA,
bool  useReferenceFrameA = false 
)
inline

Definition at line 386 of file cens_physics.h.

cens::CENSHingeConstraint::CENSHingeConstraint ( btRigidBody &  rbA,
btRigidBody &  rbB,
const btTransform &  rbAFrame,
const btTransform &  rbBFrame,
bool  useReferenceFrameA = false 
)
inline

Definition at line 393 of file cens_physics.h.

cens::CENSHingeConstraint::CENSHingeConstraint ( btRigidBody &  rbA,
const btTransform &  rbAFrame,
bool  useReferenceFrameA = false 
)
inline

Definition at line 400 of file cens_physics.h.

Member Function Documentation

void cens::CENSHingeConstraint::setPDMotorTarget ( float  targetAngle,
float  kp = 3,
float  ki = 0,
float  kd = .5,
float  dt = .05 
)

Change motor velocity based on the PD torque

Parameters
targetAnglethe desired angular position of the joint
kpproportional gain
kdderivative gain
dtintegration timestep

Definition at line 336 of file cens_physics.cpp.

References angles.

Referenced by cens::CENSSerializedRobot::update().

Member Data Documentation

std::map< CENSHingeConstraint *, float > cens::CENSHingeConstraint::angles
staticprivate

Definition at line 419 of file cens_physics.h.

Referenced by setPDMotorTarget().


The documentation for this class was generated from the following files: