From 9d1b1d09ed51344c8ca7b4f0a94f5841ee2c509e Mon Sep 17 00:00:00 2001 From: cnlohr Date: Thu, 2 Mar 2017 22:20:07 -0500 Subject: cleanup, add some logging data to calinfo, open up restrictive rules about sensor positions, clean cleans redist/ --- src/survive_vive.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/survive_vive.c') diff --git a/src/survive_vive.c b/src/survive_vive.c index a402153..47886c9 100644 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -20,6 +20,7 @@ #include //sleep if I ever use it. #include #include +#include struct SurviveViveData; @@ -976,6 +977,27 @@ static int LoadConfig( struct SurviveViveData * sv, struct SurviveObject * so, i //TODO: Cleanup any remaining USB stuff. return 1; } + + char fname[20]; + mkdir( "calinfo", 0755 ); + + sprintf( fname, "calinfo/%s_points.csv", so->codename ); + FILE * f = fopen( fname, "w" ); + int j; + for( j = 0; j < so->nr_locations; j++ ) + { + fprintf( f, "%f %f %f\n", so->sensor_locations[j*3+0], so->sensor_locations[j*3+1], so->sensor_locations[j*3+2] ); + } + fclose( f ); + + sprintf( fname, "calinfo/%s_normals.csv", so->codename ); + f = fopen( fname, "w" ); + for( j = 0; j < so->nr_locations; j++ ) + { + fprintf( f, "%f %f %f\n", so->sensor_normals[j*3+0], so->sensor_normals[j*3+1], so->sensor_normals[j*3+2] ); + } + fclose( f ); + return 0; } -- cgit v1.2.3