40 CLog john(
"test_like_h3d");
42 cout <<
"Epos2 Like H3D:" << endl;
44 double avg=0,total_avg=0,max_avg=0,min_avg=0;
61 CTime tbase,telapsed,t0,t1,tavg;
66 telapsed.setFormat(ctf_ms);
74 avg = tavg.getTimeInSeconds();
75 telapsed = (t1+t0)/2 - tbase;
76 cout <<
">>> " << telapsed.getTimeInSeconds() <<
" " << pos << endl;
81 total_avg = (total_avg + avg)/2;
83 max_avg = max(max_avg,avg);
84 min_avg = min(min_avg,avg);
87 telapsed = telapsed - tbase;
89 if( telapsed.getTimeInSeconds() > 5*k )
91 cout << telapsed << endl;
96 }
while( telapsed.getTimeInSeconds() < total_seconds);
98 cout <<
"End" << endl;
104 }
catch(CException &e){
106 cout << e.what() << endl;
110 " t avg: " << total_avg <<
111 " t min: " << min_avg <<
112 " t max: " << max_avg << endl;
void enableMotor(long opmode)
function to facititate transitions from switched on to operation enabled
void setOperationMode(long opmode)
function to set the operation mode
void startVelocity()
function to move the motor in Velocity mode
void enableController()
function to facititate transitions from the start of the controller to switch it on ...
void close()
Disconnects hardware.
Implementation of a driver for EPOS2 Motor Controller.
void init()
Connects hardware.
int32_t readPosition()
function to read motor position
void stopVelocity()
function to stop the motor in velocity mode
void setTargetVelocity(long velocity)
function to SET the target velocity