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 MUSCLEPAIR_H
00025 #define MUSCLEPAIR_H
00026
00027 #include "experimentsconfig.h"
00028
00029 namespace farsa {
00030
00031 class PhyDOF;
00032
00041 class FARSA_EXPERIMENTS_API MusclePair {
00042 public:
00052 MusclePair( PhyDOF* dof, float ksh, float tmax, float rl, float lmax );
00054 virtual ~MusclePair() { };
00056 void setRestLength( float rl );
00058 float getRestLength();
00060 void setMaxTension( float tmax );
00062 float getMaxTension( );
00064 void setMaxLength( float lmax );
00066 float getMaxLength();
00070 float getMinLength();
00074 float getAsh( );
00077 void setAsh( float newash );
00081 void setKsh( float ksh, float reduceFactor = 1.0 );
00083 float getKsh( );
00085 void setViscosity( float b );
00087 float getViscosity( );
00089 void setActivation( float act1, float act2 );
00091 void getActivation( float& act1, float& act2 );
00093 void getExtension( float& l1, float& l2 );
00095 void getActiveForces( float& ta1, float& ta2 ) {
00096 ta1 = tal1;
00097 ta2 = tal2;
00098 };
00102 float apply();
00103 private:
00105 PhyDOF* dof;
00107 float ash;
00109 float ksh;
00111 float reduceKsh;
00113 float b;
00115 float tmax;
00117 float rl;
00119 float lmax;
00121 float lmin;
00123 float act1;
00125 float act2;
00127 float last_x1;
00129 float last_x2;
00131 float dx1;
00133 float dx2;
00135 float tal1, tal2;
00136 };
00137
00138 }
00139
00140 #endif
00141