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::CENSSliderConstraint Class Reference

A custom SliderConstraint Class. More...

#include <cens_physics.h>

Inheritance diagram for cens::CENSSliderConstraint:
Inheritance graph
Collaboration diagram for cens::CENSSliderConstraint:
Collaboration graph

Public Member Functions

 CENSSliderConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame, bool useReferenceFrameA=false)
void setMotorTarget (float targetPos, float dt=.05)
void setPDMotorTarget (float targetPos, float kp=3, float ki=0, float kd=.5, float dt=.05)

Static Private Attributes

static std::map
< CENSSliderConstraint
*, float > 

Detailed Description

A custom SliderConstraint Class.

Through this class a custom control of the motor of the joint can be implemented. The methods CENSSliderConstraint::setMotorTarget and CENSSliderConstraint::setPDMotorTarget can be used to change the joint position with a P or PD control.

Definition at line 435 of file cens_physics.h.

Constructor & Destructor Documentation

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

Definition at line 439 of file cens_physics.h.

Member Function Documentation

void cens::CENSSliderConstraint::setMotorTarget ( float  targetPos,
float  dt = .05 

Definition at line 386 of file cens_physics.cpp.

References positions.

void cens::CENSSliderConstraint::setPDMotorTarget ( float  targetPos,
float  kp = 3,
float  ki = 0,
float  kd = .5,
float  dt = .05 

Change motor velocity based on the PD force

targetPosthe desired position of the joint
kpproportional gain
kdderivative gain
dtintegration timestep

Definition at line 415 of file cens_physics.cpp.

References positions.

Member Data Documentation

std::map< CENSSliderConstraint *, float > cens::CENSSliderConstraint::positions

Definition at line 461 of file cens_physics.h.

Referenced by setMotorTarget(), and setPDMotorTarget().

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