Raynaud Gilles
/
VITI_motor_angle_3
angle3
Diff: main.cpp
- Revision:
- 10:2a1abbd2c84c
- Parent:
- 9:2a16e3930e1d
- Child:
- 11:9d83bb9a611c
diff -r 2a16e3930e1d -r 2a1abbd2c84c main.cpp --- a/main.cpp Sat May 23 17:37:14 2020 +0000 +++ b/main.cpp Sat May 23 18:09:23 2020 +0000 @@ -25,7 +25,6 @@ AnalogIn verin(PC_3); // lecture pos verin AnalogOut ana (PA_5); // pour debug analogique ISR Motor motor(PB_4,PA_1,PA_4,PC_7); -Timer tt; Ticker tic; int flag_affich=0; @@ -62,8 +61,6 @@ a0=1./(1+(2*RC/dt)); //calcul du coefficient a du filtre b0=(1-(2.*RC/dt))*a0; //calcul du coefficient b du filtre a1=a0*RC*1.0; //calcul du coefficient a du filtre - //dt=tt.read_us()/1000000.0; - //tt.reset(); DOF.readAccel(); DOF.readGyro(); #if viti @@ -71,38 +68,33 @@ #else ang=((180/pi)*atan2((double)DOF.ay,(double)DOF.az)-ang_off); // sur table #endif - // filtres complémentaires angle_acce_pred = angle_acce; angle_acce=ang; angle_acce_f_pred = angle_acce_f; angle_acce_f=a0*angle_acce+a0*angle_acce_pred-b0*angle_acce_f_pred; //filtrage accéléromètre - +// gyroy_pred = gyroy; #if viti gyroy=DOF.gz-gz_off; //sur site #else gyroy=-DOF.gx-gx_off; //sur table #endif - +// angle_gyroy_f_pred = angle_gyroy_f; angle_gyroy_f=a1*gyroy+a1*gyroy_pred-b0*angle_gyroy_f_pred; // angle_final=angle_acce_f+angle_gyroy_f; ana=0.0; } - +// int main() { - //pc.printf("Hello World 1\r\n"); - //dt=dt0; - //tt.start(); wait(1); DOF.begin(); wait(1); DOF.calibration(); wait(1); - //tt.reset(); thread.start(callback(&queue,&EventQueue::dispatch_forever)); tic.attach(queue.event(&calcul),dt); while(1) { @@ -120,7 +112,6 @@ //pr.unlock(); ana=0.0; wait(0.095); - } }