testTwoDofController.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 #include <vector>
00003 #include "TwoDofController.h"
00004 #include <boost/assign/std/vector.hpp>
00005 #include <boost/assert.hpp>
00006 
00007 #define ABS(x) (((x) < 0) ? (-(x)) : (x))
00008 
00009 int main () {
00010   double ke = 400, tc = 0.04, dt = 0.005;
00011   TwoDofController tdc(ke, tc, dt);
00012   double q = 0, dq = 0, tau = 0, tau_d = 10.0;
00013 
00014   double time = 0, start = 0;
00015   while ( true ) {
00016     tau = -ke * q;
00017     dq = tdc.update(tau, tau_d);
00018     q += dq;
00019     start = time;
00020     if ( ABS(tau - tau_d) < 0.01 ){
00021       return 0;
00022     }
00023     std::cout << time << " " << q << " " << tau << " " << tau_d << std::endl;
00024     time += dt;
00025   }
00026   return 0;
00027 }


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Wed Sep 6 2017 02:35:56