23 #include "worldsimconfig.h"
25 #include "phyobject.h"
28 #include "wquaternion.h"
35 class PhyJointPrivate;
36 class PhyObjectPrivate;
50 class FARSA_WSIM_API
PhyDOF :
public QObject {
63 this->istranslate = translate;
64 this->centrev = centre;
75 maxvelocityv = 1.5708f;
126 void setCentre(
const wVector& cent ) {
127 this->centrev = cent;
138 void setPosition( real newpos ) {
140 emit changedPosition( newpos );
148 void setVelocity( real newvel ) {
150 emit changedVelocity( newvel );
154 void limits( real& lo, real& hi )
const {
167 stiffnessv =
ramp( 0.0f, 0.99f, newstiff );
168 emit changedStiffness( stiffnessv );
173 maxvelocityv = maxvel;
186 void setAxis(
const wVector& ax ) {
195 void setXAxis(
const wVector& x_ax ) {
204 void setYAxis(
const wVector& y_ax ) {
244 emit appliedForce( newforce );
252 real offset = (fabs(hilimit)-fabs(lolimit))*0.005;
253 desiredPos =
ramp( lolimit+offset, hilimit-offset, wishpos );
256 emit changedDesiredPosition( wishpos );
263 desiredVel = wishvel;
265 emit changedDesiredVelocity( wishvel );
276 if ( !istranslate && lowlimit <= -PI_GRECO ) {
277 qDebug() <<
"DOF Lower Limit must be greater than -pi";
279 if ( !istranslate && highlimit >= PI_GRECO ) {
280 qDebug() <<
"DOF Higher Limit must be lesser that pi";
286 real offset = (fabs(hilimit)-fabs(lolimit))*0.005;
287 desiredPos =
ramp( lolimit+offset, hilimit-offset, desiredPos );
288 emit changedLimits( lolimit, hilimit );
293 void appliedForce( real newforce );
295 void changedDesiredPosition( real wishpos );
297 void changedDesiredVelocity( real wishvel );
299 void changedPosition( real newpos );
301 void changedVelocity( real newvel );
303 void changedStiffness( real newstiff );
305 void changedLimits( real lowlimit, real highlimit );
320 MotionMode motionMode;
378 virtual QVector<PhyDOF*>
dofs() {
382 void enable(
bool b );
389 virtual wVector centre()
const = 0;
393 virtual wVector getForceOnJoint()
const = 0;
396 virtual void updateJointInfo() = 0;
425 QVector<PhyDOF*> dofsv;
439 PhyObjectPrivate* parentpriv;
440 PhyObjectPrivate* childpriv;
441 WorldPrivate* worldpriv;
442 friend class PhyJointPrivate;
443 virtual void updateJoint( real timestep ) = 0;