#include <stdio.h>
#include <signal.h>
#define Nx 2
#define Ny 1
#define Nu 1
#define DT 0.05
#define REVERSE_TIME 2.0
static int running = 1;
static void __signal_handler(__attribute__ ((unused)) int dummy)
{
running=0;
return;
}
int main()
{
int counter;
signal(SIGINT, __signal_handler);
running = 1;
counter = REVERSE_TIME/(DT*2.0);
while(running){
if(counter > REVERSE_TIME/DT){
counter = 0;
if(u.
d[0]<1.0) u.
d[0]=1.0;
}
printf(
"\rpos: %5.2f vel: %5.2f u: %5.2f y: %5.2f ", kf.
x_est.
d[0], kf.
x_est.
d[1], u.
d[0], y.
d[0]);
fflush(stdout);
counter++;
}
printf("\n");
return 0;
}