aboutsummaryrefslogtreecommitdiff
path: root/src/survive_cal.h
diff options
context:
space:
mode:
authorultramn <dchapm2@umbc.edu>2017-03-02 19:55:54 -0800
committerultramn <dchapm2@umbc.edu>2017-03-02 19:55:54 -0800
commita59f42935a7472da7b9f162a68b3c55aff128f7e (patch)
treee4bf6314161bbabbde6064d8b7fdb9335a764ca6 /src/survive_cal.h
parent1c131c03fe8c5d5ab17193c9f6e7e79d81110d52 (diff)
parent9d1b1d09ed51344c8ca7b4f0a94f5841ee2c509e (diff)
downloadlibsurvive-a59f42935a7472da7b9f162a68b3c55aff128f7e.tar.gz
libsurvive-a59f42935a7472da7b9f162a68b3c55aff128f7e.tar.bz2
Merge branch 'master' of https://github.com/cnlohr/libsurvive
Diffstat (limited to 'src/survive_cal.h')
-rw-r--r--src/survive_cal.h32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/survive_cal.h b/src/survive_cal.h
index 42ff1ee..bb4eb32 100644
--- a/src/survive_cal.h
+++ b/src/survive_cal.h
@@ -30,20 +30,34 @@ int survive_cal_get_status( struct SurviveContext * ctx, char * description, int
void survive_cal_light( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length );
void survive_cal_angle( struct SurviveObject * so, int sensor_id, int acode, uint32_t timecode, FLT length, FLT angle );
-#define MAX_TO_CAL 96
-#define DRPTS 512
-
+#define MAX_SENSORS_TO_CAL 96
+#define DRPTS 1024
+#define MAX_CAL_PT_DAT (MAX_SENSORS_TO_CAL*NUM_LIGHTHOUSES*2)
struct SurviveCalData
{
+ struct SurviveContext * ctx;
//OOTX Data is sync'd off of the sync pulses coming from the lighthouses.
ootx_decoder_context ootx_decoders[NUM_LIGHTHOUSES];
- //For statistics-gathering phase.
- FLT all_lengths[MAX_TO_CAL][NUM_LIGHTHOUSES][2][DRPTS];
- FLT all_angles[MAX_TO_CAL][NUM_LIGHTHOUSES][2][DRPTS];
- int16_t all_counts[MAX_TO_CAL][NUM_LIGHTHOUSES][2];
+ //For statistics-gathering phase. (Stage 2/3)
+ FLT all_lengths[MAX_SENSORS_TO_CAL][NUM_LIGHTHOUSES][2][DRPTS];
+ FLT all_angles[MAX_SENSORS_TO_CAL][NUM_LIGHTHOUSES][2][DRPTS];
+ int16_t all_counts[MAX_SENSORS_TO_CAL][NUM_LIGHTHOUSES][2];
int16_t peak_counts;
int8_t found_common;
+ int8_t times_found_common;
+
+ //For camfind (4+)
+ //Index is calculated with: int dataindex = sen*(2*NUM_LIGHTHOUSES)+lh*2+axis;
+ FLT avgsweeps[MAX_CAL_PT_DAT];
+ FLT avglens[MAX_CAL_PT_DAT];
+ FLT stdsweeps[MAX_CAL_PT_DAT];
+ FLT stdlens[MAX_CAL_PT_DAT];
+ int ctsweeps[MAX_CAL_PT_DAT];
+
+ int senid_of_checkpt; //This is a point on a watchman that can be used to check the lh solution.
+
+ struct SurviveObject * hmd;
//Stage:
// 0: Idle
@@ -52,6 +66,10 @@ struct SurviveCalData
};
+//The following function is not included in the core survive_cal and must be compiled from a camfind file.
+//It should use data for stage 4 and report if it found the
+int survive_cal_lhfind( struct SurviveCalData * cd );
+
#endif