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;
127 void setCentre(
const wVector& cent ) {
128 this->centrev = cent;
139 void setPosition(
real newpos ) {
141 emit changedPosition( newpos );
149 void setVelocity(
real newvel ) {
151 emit changedVelocity( newvel );
168 stiffnessv =
ramp( 0.0f, 0.99f, newstiff );
169 emit changedStiffness( stiffnessv );
174 maxvelocityv = maxvel;
184 maxforcev = maxforce;
197 void setAxis(
const wVector& ax ) {
206 void setXAxis(
const wVector& x_ax ) {
215 void setYAxis(
const wVector& y_ax ) {
255 emit appliedForce( newforce );
263 real offset = (fabs(hilimit)-fabs(lolimit))*0.005;
264 desiredPos =
ramp( lolimit+offset, hilimit-offset, wishpos );
267 emit changedDesiredPosition( wishpos );
274 desiredVel = wishvel;
276 emit changedDesiredVelocity( wishvel );
287 if ( !istranslate && lowlimit <= -PI_GRECO ) {
288 qDebug() <<
"DOF Lower Limit must be greater than -pi";
290 if ( !istranslate && highlimit >= PI_GRECO ) {
291 qDebug() <<
"DOF Higher Limit must be lesser that pi";
297 real offset = (fabs(hilimit)-fabs(lolimit))*0.005;
298 desiredPos =
ramp( lolimit+offset, hilimit-offset, desiredPos );
299 emit changedLimits( lolimit, hilimit );
304 void appliedForce(
real newforce );
306 void changedDesiredPosition(
real wishpos );
308 void changedDesiredVelocity(
real wishvel );
310 void changedPosition(
real newpos );
312 void changedVelocity(
real newvel );
314 void changedStiffness(
real newstiff );
316 void changedLimits(
real lowlimit,
real highlimit );
331 MotionMode motionMode;
391 virtual QVector<PhyDOF*>
dofs() {
395 void enable(
bool b );
402 virtual wVector centre()
const = 0;
406 virtual wVector getForceOnJoint()
const = 0;
409 virtual void updateJointInfo() = 0;
438 QVector<PhyDOF*> dofsv;
452 PhyObjectPrivate* parentpriv;
453 PhyObjectPrivate* childpriv;
454 WorldPrivate* worldpriv;
455 friend class PhyJointPrivate;
456 virtual void updateJoint(
real timestep ) = 0;