fixed bug in PID
This commit is contained in:
@@ -67,17 +67,13 @@ static double filter(double val, int idx){
|
||||
void logmnt(FILE *fcoords, mountdata_t *m){
|
||||
if(!fcoords) return;
|
||||
//DBG("LOG %s", m ? "data" : "header");
|
||||
static double t0 = -1.;
|
||||
if(!m){ // write header
|
||||
fprintf(fcoords, "# time Xmot(deg) Ymot(deg) Xenc(deg) Yenc(deg) VX(d/s) VY(d/s) millis\n");
|
||||
return;
|
||||
}
|
||||
double tnow = (m->encXposition.t + m->encYposition.t) / 2.;
|
||||
if(t0 < 0.) t0 = tnow;
|
||||
double t = tnow - t0;
|
||||
// write data
|
||||
fprintf(fcoords, "%12.6f %10.6f %10.6f %10.6f %10.6f %10.6f %10.6f %10u\n",
|
||||
t, RAD2DEG(m->motXposition.val), RAD2DEG(m->motYposition.val),
|
||||
m->motXposition.t, RAD2DEG(m->motXposition.val), RAD2DEG(m->motYposition.val),
|
||||
RAD2DEG(m->encXposition.val), RAD2DEG(m->encYposition.val),
|
||||
RAD2DEG(m->encXspeed.val), RAD2DEG(m->encYspeed.val),
|
||||
m->millis);
|
||||
|
||||
Reference in New Issue
Block a user