00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef MOTORS_H
00025 #define MOTORS_H
00026
00027 #include "experimentsconfig.h"
00028 #include "neuroninterfaces.h"
00029 #include "musclepair.h"
00030 #include "robots.h"
00031
00032 namespace farsa {
00033
00038 class FARSA_EXPERIMENTS_API FakeMotor : public Motor {
00039 public:
00044 FakeMotor( ConfigurationParameters& params, QString prefix );
00046 ~FakeMotor();
00051 void save( ConfigurationParameters& params, QString prefix );
00053 static void describe( QString type );
00055 void update();
00060 int size();
00061 protected:
00067 void resourceChanged(QString resourceName, ResourceChangeType changeType);
00069 int nFakeMotors;
00070 };
00071
00076 class FARSA_EXPERIMENTS_API ProportionalController
00077 {
00078 public:
00079 ProportionalController();
00080 ~ProportionalController();
00081 void setControlParameters(double k = -1.0f, double maxvel = -1.0f);
00082 double getK() const;
00083 void setK(double k);
00084 void setMaxVelocity(double maxVel);
00085 double getMaxVelocity();
00086 double velocityForJoint(double desired, double current);
00087
00088 protected:
00089 double m_maxvel;
00090 double m_k;
00091 };
00092
00093 }
00094
00095 #endif