aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2017-03-02 22:20:07 -0500
committercnlohr <lohr85@gmail.com>2017-03-02 22:20:07 -0500
commit9d1b1d09ed51344c8ca7b4f0a94f5841ee2c509e (patch)
tree33d7c869d0d67f0a2dd9f785a4b7f860bf9a8883
parent6cc609204ba7ea1bd0a903cf918a2b7eea979b91 (diff)
downloadlibsurvive-9d1b1d09ed51344c8ca7b4f0a94f5841ee2c509e.tar.gz
libsurvive-9d1b1d09ed51344c8ca7b4f0a94f5841ee2c509e.tar.bz2
cleanup, add some logging data to calinfo, open up restrictive rules about sensor positions, clean cleans redist/
-rw-r--r--Makefile2
-rw-r--r--src/survive_cal_lhfind.c2
-rw-r--r--src/survive_vive.c22
3 files changed, 24 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4938e28..75b5606 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ lib/libsurvive.so : src/survive.o src/survive_usb.o src/survive_data.o src/survi
gcc -o $@ $^ $(LDFLAGS) -shared
clean :
- rm -rf *.o src/*.o *~ src/*~ test data_recorder lib/libsurvive.so
+ rm -rf *.o src/*.o *~ src/*~ test data_recorder lib/libsurvive.so redist/*.o redist/*~
diff --git a/src/survive_cal_lhfind.c b/src/survive_cal_lhfind.c
index e1e5fc9..93d9dc0 100644
--- a/src/survive_cal_lhfind.c
+++ b/src/survive_cal_lhfind.c
@@ -129,7 +129,7 @@ int survive_cal_lhfind( struct SurviveCalData * cd )
fullrange *= 0.25;
}
- if( beste > 0.005 )
+ if( beste > 0.01 )
{
//Error too high
SV_ERROR( "LH: %d / Best E %f Error too high\n", lh, beste );
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 <unistd.h> //sleep if I ever use it.
#include <errno.h>
#include <string.h>
+#include <sys/stat.h>
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;
}