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;
116 void setCentre(
const wVector& cent ) {
117 this->centrev = cent;
128 void setPosition( real newpos ) {
130 emit changedPosition( newpos );
138 void setVelocity( real newvel ) {
140 emit changedVelocity( newvel );
144 void limits( real& lo, real& hi )
const {
157 stiffnessv =
ramp( 0.0f, 0.99f, newstiff );
158 emit changedStiffness( stiffnessv );
163 maxvelocityv = maxvel;
176 void setAxis(
const wVector& ax ) {
185 void setXAxis(
const wVector& x_ax ) {
194 void setYAxis(
const wVector& y_ax ) {
234 emit appliedForce( newforce );
242 real offset = (fabs(hilimit)-fabs(lolimit))*0.005;
243 desiredPos =
ramp( lolimit+offset, hilimit-offset, wishpos );
246 emit changedDesiredPosition( wishpos );
253 desiredVel = wishvel;
255 emit changedDesiredVelocity( wishvel );
266 if ( !istranslate && lowlimit <= -PI_GRECO ) {
267 qDebug() <<
"DOF Lower Limit must be greater than -pi";
269 if ( !istranslate && highlimit >= PI_GRECO ) {
270 qDebug() <<
"DOF Higher Limit must be lesser that pi";
276 real offset = (fabs(hilimit)-fabs(lolimit))*0.005;
277 desiredPos =
ramp( lolimit+offset, hilimit-offset, desiredPos );
278 emit changedLimits( lolimit, hilimit );
283 void appliedForce( real newforce );
285 void changedDesiredPosition( real wishpos );
287 void changedDesiredVelocity( real wishvel );
289 void changedPosition( real newpos );
291 void changedVelocity( real newvel );
293 void changedStiffness( real newstiff );
295 void changedLimits( real lowlimit, real highlimit );
310 MotionMode motionMode;
368 virtual QVector<PhyDOF*>
dofs() {
372 void enable(
bool b );
379 virtual wVector centre()
const = 0;
382 virtual void updateJointInfo() = 0;
411 QVector<PhyDOF*> dofsv;
425 PhyObjectPrivate* parentpriv;
426 PhyObjectPrivate* childpriv;
427 WorldPrivate* worldpriv;
428 friend class PhyJointPrivate;
429 virtual void updateJoint( real timestep ) = 0;