20 #ifndef MOTORCONTROLLERS_H
21 #define MOTORCONTROLLERS_H
23 #include "worldsimconfig.h"
38 class FARSA_WSIM_API
wPID {
45 double pidloop(
double currentvalue );
99 virtual void update() = 0;
140 void FARSA_WSIM_API wheeledRobotsComputeKinematicMovement(wMatrix &mtr,
real leftWheelVelocity,
real rightWheelVelocity,
real wheelr,
real axletrack,
real timestep);
163 bool FARSA_WSIM_API wheeledRobotsComputeWheelsSpeed(
const wMatrix& start,
const wMatrix& end,
real wheelr,
real axletrack,
real timestep,
real& leftWheelVelocity,
real& rightWheelVelocity);
180 virtual void update();
184 void setSpeeds( QVector<double> speeds );
188 void setSpeeds(
double sp1,
double sp2 );
192 void getSpeeds( QVector<double>& speeds )
const;
196 void getSpeeds(
double& sp1,
double& sp2 )
const;
200 void getDesiredSpeeds( QVector<double>& speeds )
const;
204 void getDesiredSpeeds(
double& sp1,
double& sp2 )
const;
208 void setSpeedLimits( QVector<double> minSpeeds, QVector<double> maxSpeeds );
212 void setSpeedLimits(
double minSpeed1,
double minSpeed2,
double maxSpeed1,
double maxSpeed2 );
216 void getSpeedLimits( QVector<double>& minSpeeds, QVector<double>& maxSpeeds )
const;
220 void getSpeedLimits(
double& minSpeed1,
double& minSpeed2,
double& maxSpeed1,
double& maxSpeed2 )
const;
223 void setMaxTorque(
double maxTorque );
228 double getMaxTorque()
const;
231 QVector<PhyDOF*> motorsv;
233 QVector<double> desiredVel;
235 QVector<double> minVel;
237 QVector<double> maxVel;
314 virtual void update();
323 bool attachmentDeviceEnabled()
const;
331 void setMaxVelocity(
double speed);
340 double getMaxVelocity()
const;
348 void setDesiredPosition(
double pos);
355 double getDesiredPosition()
const;
362 double getPosition()
const;
370 void setDesiredVelocity(
double vel);
377 double getDesiredVelocity()
const;
384 double getVelocity()
const;
393 void setDesiredStatus(Status status);
402 return m_desiredStatus;
424 bool attachmentPossible()
const
426 return (tryToAttach() != NULL);
434 bool attachedToRobot()
const
436 return (m_attachedRobot != NULL);
448 return m_attachedRobot;
460 return m_attachedRobot;
469 bool otherAttachedToUs()
const
471 return !m_otherAttachedRobots.isEmpty();
480 QVector<PhyMarXbot*> otherAttachedRobots()
482 return m_otherAttachedRobots;
501 void attachmentDeviceAboutToBeDestroyed();
516 Status m_desiredStatus;
538 QVector<PhyMarXbot*> m_otherAttachedRobots;