Merge branch 'master' of gitosis@stbuehler.de:icfp11
This commit is contained in:
commit
054e61e7c8
@ -172,6 +172,27 @@ void trial_print(trial *t){
|
|||||||
/*perhaps add map_print and vehicle_print*/
|
/*perhaps add map_print and vehicle_print*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void telemetry_matlab(gpointer tele, gpointer file){
|
||||||
|
FILE* outfile;
|
||||||
|
telemetry* t;
|
||||||
|
vehicle * v;
|
||||||
|
|
||||||
|
outfile = (FILE*) file;
|
||||||
|
t = (telemetry*) tele;
|
||||||
|
v = &t->vehicle;
|
||||||
|
|
||||||
|
fprintf(outfile,"v(end+1,:) = [%d %f, %f, %f, %f];\n",t->ts,v->x,v->y,v->dir,v->speed);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*prints coordinate history to matlab compatible file*/
|
||||||
|
void trial_matlab(trial *t){
|
||||||
|
FILE* outfile;
|
||||||
|
|
||||||
|
outfile = fopen("velocity.m","w");
|
||||||
|
fprintf(outfile,"v = [];\n");
|
||||||
|
g_queue_foreach(&t->telemetry,telemetry_matlab,outfile);
|
||||||
|
fclose(outfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* debugging stuff */
|
/* debugging stuff */
|
||||||
|
@ -91,6 +91,7 @@ void object_print(object *o);
|
|||||||
void vehicle_print(vehicle *v);
|
void vehicle_print(vehicle *v);
|
||||||
void telemetry_print(telemetry *t);
|
void telemetry_print(telemetry *t);
|
||||||
void trial_print(trial *t);
|
void trial_print(trial *t);
|
||||||
|
void trial_matlab(trial *t);
|
||||||
void map_print(map *m);
|
void map_print(map *m);
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
trial_loop(t);
|
trial_loop(t);
|
||||||
|
trial_matlab(t);
|
||||||
|
|
||||||
trial_free(t);
|
trial_free(t);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user