aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2018-03-14 23:54:14 -0400
committercnlohr <lohr85@gmail.com>2018-03-14 23:54:14 -0400
commit61a01d0ddfd8e99c97e3d235d4f0782fbf0ed032 (patch)
treed5e4efd164d0001bb2545a2ff829c2ab201c0296
parent3681b5df3cf518b0ded815d93cb45b176aea7440 (diff)
downloadlibsurvive-61a01d0ddfd8e99c97e3d235d4f0782fbf0ed032.tar.gz
libsurvive-61a01d0ddfd8e99c97e3d235d4f0782fbf0ed032.tar.bz2
rename nr_locations to sensor_ct
Also, make it easier to see edges in calibrate.
-rw-r--r--calibrate.c8
-rw-r--r--include/libsurvive/survive.h4
-rw-r--r--src/poser_charlesslow.c4
-rw-r--r--src/poser_octavioradii.c10
-rw-r--r--src/poser_turveytori.c8
-rwxr-xr-xsrc/survive_cal.c2
-rw-r--r--src/survive_default_devices.c10
-rw-r--r--test.c4
8 files changed, 25 insertions, 25 deletions
diff --git a/calibrate.c b/calibrate.c
index ff3b774..b4325b0 100644
--- a/calibrate.c
+++ b/calibrate.c
@@ -115,24 +115,24 @@ void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int
if( acode % 2 == 0 && lh == 0) //data = 0
{
- bufferpts[jumpoffset*2+0][0] = (timeinsweep-100000)/300;
+ bufferpts[jumpoffset*2+0][0] = (timeinsweep-80000)/500;
buffertimeto[jumpoffset][0] = 0;
}
if( acode % 2 == 1 && lh == 0 ) //data = 1
{
- bufferpts[jumpoffset*2+1][0] = (timeinsweep-100000)/300;
+ bufferpts[jumpoffset*2+1][0] = (timeinsweep-80000)/500;
buffertimeto[jumpoffset][0] = 0;
}
if( acode % 2 == 0 && lh == 1 ) //data = 0
{
- bufferpts[jumpoffset*2+0][1] = (timeinsweep-100000)/300;
+ bufferpts[jumpoffset*2+0][1] = (timeinsweep-80000)/500;
buffertimeto[jumpoffset][1] = 0;
}
if( acode % 2 == 1 && lh == 1 ) //data = 1
{
- bufferpts[jumpoffset*2+1][1] = (timeinsweep-100000)/300;
+ bufferpts[jumpoffset*2+1][1] = (timeinsweep-80000)/500;
buffertimeto[jumpoffset][1] = 0;
}
}
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h
index 03a71bc..7a0ed1e 100644
--- a/include/libsurvive/survive.h
+++ b/include/libsurvive/survive.h
@@ -37,8 +37,8 @@ struct SurviveObject
PoserCB PoserFn;
//Device-specific information about the location of the sensors. This data will be used by the poser.
- int8_t nr_locations; // sensor count
- FLT * sensor_locations; // size is nr_locations*3. Contains x,y,z values for each sensor
+ int8_t sensor_ct; // sensor count
+ FLT * sensor_locations; // size is sensor_ct*3. Contains x,y,z values for each sensor
FLT * sensor_normals;// size is nrlocations*3. cointains normal vector for each sensor
//Timing sensitive data (mostly for disambiguation)
diff --git a/src/poser_charlesslow.c b/src/poser_charlesslow.c
index 0839d59..3b781f4 100644
--- a/src/poser_charlesslow.c
+++ b/src/poser_charlesslow.c
@@ -48,7 +48,7 @@ int PoserCharlesSlow( SurviveObject * so, PoserData * pd )
int p;
FLT * hmd_points = so->sensor_locations;
- for( p = 0; p < so->nr_locations; p++ )
+ for( p = 0; p < so->sensor_ct; p++ )
{
printf( "%f %f %f\n", hmd_points[p*3+0], hmd_points[p*3+1], hmd_points[p*3+2] );
}
@@ -225,7 +225,7 @@ static FLT RunOpti( SurviveObject * hmd, PoserDataFullScene * fs, int lh, int pr
quatsetnone( LighthouseQuat );
FLT * hmd_points = hmd->sensor_locations;
FLT * hmd_normals = hmd->sensor_normals;
- int dpts = hmd->nr_locations;
+ int dpts = hmd->sensor_ct;
int first = 1, second = 0;
diff --git a/src/poser_octavioradii.c b/src/poser_octavioradii.c
index 5805e1a..f9bad84 100644
--- a/src/poser_octavioradii.c
+++ b/src/poser_octavioradii.c
@@ -450,7 +450,7 @@ static void QuickPose(SurviveObject *so)
OctavioRadiiData * td = so->PoserData;
- //for (int i=0; i < so->nr_locations; i++)
+ //for (int i=0; i < so->sensor_ct; i++)
//{
// FLT x0=td->oldAngles[i][0][0][td->angleIndex[0][0]];
// FLT y0=td->oldAngles[i][1][0][td->angleIndex[0][1]];
@@ -478,7 +478,7 @@ static void QuickPose(SurviveObject *so)
{
int sensorCount = 0;
- for (int i = 0; i < so->nr_locations; i++)
+ for (int i = 0; i < so->sensor_ct; i++)
{
int lh = 0;
//printf("%d[%d], ",i,td->hitCount[i][lh][0]);
@@ -646,11 +646,11 @@ int PoserOctavioRadii( SurviveObject * so, PoserData * pd )
//FLT angles[SENSORS_PER_OBJECT][NUM_LIGHTHOUSES][2]; //2 Axes (Angles in LH space)
//FLT synctimes[SENSORS_PER_OBJECT][NUM_LIGHTHOUSES];
- //to->numSensors = so->nr_locations;
+ //to->numSensors = so->sensor_ct;
{
int sensorCount = 0;
- for (int i = 0; i < so->nr_locations; i++)
+ for (int i = 0; i < so->sensor_ct; i++)
{
if (fs->lengths[i][0][0] != -1 && fs->lengths[i][0][1] != -1) //lh 0
{
@@ -678,7 +678,7 @@ int PoserOctavioRadii( SurviveObject * so, PoserData * pd )
int sensorCount = 0;
int lh = 1;
- for (int i = 0; i < so->nr_locations; i++)
+ for (int i = 0; i < so->sensor_ct; i++)
{
if (fs->lengths[i][lh][0] != -1 && fs->lengths[i][lh][1] != -1)
{
diff --git a/src/poser_turveytori.c b/src/poser_turveytori.c
index a2d8fbe..db8d638 100644
--- a/src/poser_turveytori.c
+++ b/src/poser_turveytori.c
@@ -1538,7 +1538,7 @@ static void QuickPose(SurviveObject *so, PoserData *pd, int lh) {
return;
}
- //for (int i=0; i < so->nr_locations; i++)
+ //for (int i=0; i < so->sensor_ct; i++)
//{
// FLT x0=td->oldAngles[i][0][0][td->angleIndex[0][0]];
// FLT y0=td->oldAngles[i][1][0][td->angleIndex[0][1]];
@@ -1574,7 +1574,7 @@ static void QuickPose(SurviveObject *so, PoserData *pd, int lh) {
//// end TODO
- for (int i = 0; i < so->nr_locations; i++)
+ for (int i = 0; i < so->sensor_ct; i++)
{
int angleIndex0 = (td->angleIndex[lh][0] + 1 + OLD_ANGLES_BUFF_LEN) % OLD_ANGLES_BUFF_LEN;
int angleIndex1 = (td->angleIndex[lh][1] + 1 + OLD_ANGLES_BUFF_LEN) % OLD_ANGLES_BUFF_LEN;
@@ -1760,7 +1760,7 @@ int PoserTurveyTori( SurviveObject * so, PoserData * poserData )
int sensorCount = 0;
- for (int i = 0; i < so->nr_locations; i++)
+ for (int i = 0; i < so->sensor_ct; i++)
{
if (fs->lengths[i][0][0] != -1 && fs->lengths[i][0][1] != -1) //lh 0
{
@@ -1796,7 +1796,7 @@ int PoserTurveyTori( SurviveObject * so, PoserData * poserData )
int sensorCount = 0;
int lh = 1;
- for (int i = 0; i < so->nr_locations; i++)
+ for (int i = 0; i < so->sensor_ct; i++)
{
if (fs->lengths[i][lh][0] != -1 && fs->lengths[i][lh][1] != -1)
{
diff --git a/src/survive_cal.c b/src/survive_cal.c
index fb3b240..2fd96ef 100755
--- a/src/survive_cal.c
+++ b/src/survive_cal.c
@@ -655,7 +655,7 @@ static void handle_calibration( struct SurviveCalData *cd )
FLT reproj_err = 0;
size_t cnt = 0;
SurviveObject *so = cd->poseobjects[obj];
- for (size_t idx = 0; idx < so->nr_locations; idx++) {
+ for (size_t idx = 0; idx < so->sensor_ct; idx++) {
FLT *lengths = fsd.lengths[idx][lh];
FLT *pt = fsd.angles[idx][lh];
if (lengths[0] < 0 || lengths[1] < 0)
diff --git a/src/survive_default_devices.c b/src/survive_default_devices.c
index 0229c63..b52a2f7 100644
--- a/src/survive_default_devices.c
+++ b/src/survive_default_devices.c
@@ -65,7 +65,7 @@ static int ParsePoints(SurviveContext *ctx, SurviveObject *so, char *ct0conf,
int pts = t[i + 1].size;
jsmntok_t *tk;
- so->nr_locations = 0;
+ so->sensor_ct = 0;
*floats_out = malloc(sizeof(**floats_out) * 32 * 3);
for (k = 0; k < pts; k++) {
@@ -86,10 +86,10 @@ static int ParsePoints(SurviveContext *ctx, SurviveObject *so, char *ct0conf,
memcpy(ctt, ct0conf + tk->start, elemlen);
ctt[elemlen] = 0;
FLT f = atof(ctt);
- int id = so->nr_locations * 3 + m;
+ int id = so->sensor_ct * 3 + m;
(*floats_out)[id] = f;
}
- so->nr_locations++;
+ so->sensor_ct++;
}
return 0;
}
@@ -181,7 +181,7 @@ int survive_load_htc_config_format(char *ct0conf, int len, SurviveObject *so) {
FILE *f = fopen(fname, "w");
int j;
if(f) {
- for (j = 0; j < so->nr_locations; j++) {
+ for (j = 0; j < so->sensor_ct; 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]);
@@ -192,7 +192,7 @@ int survive_load_htc_config_format(char *ct0conf, int len, SurviveObject *so) {
if(f) {
sprintf(fname, "calinfo/%s_normals.csv", so->codename);
f = fopen(fname, "w");
- for (j = 0; j < so->nr_locations; j++) {
+ for (j = 0; j < so->sensor_ct; 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]);
}
diff --git a/test.c b/test.c
index d4b3d6f..0052a60 100644
--- a/test.c
+++ b/test.c
@@ -118,7 +118,7 @@ static void dump_iface( struct SurviveObject * so, const char * prefix )
sprintf( fname, "%s_points.csv", prefix );
f = fopen( fname, "w" );
- for( i = 0; i < so->nr_locations; i++ )
+ for( i = 0; i < so->sensor_ct; i++ )
{
fprintf( f, "%g %g %g\n", so->sensor_locations[i*3+0], so->sensor_locations[i*3+1], so->sensor_locations[i*3+2] );
}
@@ -126,7 +126,7 @@ static void dump_iface( struct SurviveObject * so, const char * prefix )
sprintf( fname, "%s_normals.csv", prefix );
f = fopen( fname, "w" );
- for( i = 0; i < so->nr_locations; i++ )
+ for( i = 0; i < so->sensor_ct; i++ )
{
fprintf( f, "%g %g %g\n", so->sensor_normals[i*3+0], so->sensor_normals[i*3+1], so->sensor_normals[i*3+2] );
}