aboutsummaryrefslogtreecommitdiff
path: root/src/survive_process.c
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2017-02-16 17:16:31 -0500
committercnlohr <lohr85@gmail.com>2017-02-16 17:16:31 -0500
commit32fbccbd7d90f1e456d1e477eab2128aaf88df93 (patch)
treef4d6f206fec93b27b37602593d6445dfdf266f63 /src/survive_process.c
parentf88070d0bd75826025758392af2805659fd1d380 (diff)
downloadlibsurvive-32fbccbd7d90f1e456d1e477eab2128aaf88df93.tar.gz
libsurvive-32fbccbd7d90f1e456d1e477eab2128aaf88df93.tar.bz2
Move to having an angle callback.
Diffstat (limited to 'src/survive_process.c')
-rw-r--r--src/survive_process.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/survive_process.c b/src/survive_process.c
index cb53588..75453da 100644
--- a/src/survive_process.c
+++ b/src/survive_process.c
@@ -21,18 +21,36 @@ void survive_default_light_process( struct SurviveObject * so, int sensor_id, in
//No loner need sync information past this point.
if( sensor_id < 0 ) return;
-
- float angle = (timeinsweep - 200000) * (1./200000. * 3.14159265359/2.0);
+ FLT angle = (timeinsweep - so->timecenter_ticks) * (1./so->timecenter_ticks * 3.14159265359/2.0);
//Need to now do angle correction.
#if 1
struct BaseStationData * bsd = &ctx->bsd[base_station];
+ //XXX TODO: This seriously needs to be worked on. See: https://github.com/cnlohr/libsurvive/issues/18
+ angle += bsd->fcalphase[axis];
+// angle += bsd->fcaltilt[axis] * predicted_angle(axis1);
+
//TODO!!!
#endif
-
+
+ FLT length_sec = length / (FLT)so->timebase_hz;
+ ctx->angleproc( so, sensor_id, acode, timecode, length_sec, angle );
}
+
+void survive_default_angle_process( struct SurviveObject * so, int sensor_id, int acode, uint32_t timecode, FLT length, FLT angle )
+{
+ struct SurviveContext * ctx = so->ctx;
+ if( ctx->calptr )
+ {
+ survive_cal_angle( so, sensor_id, acode, timecode, length, angle );
+ }
+
+ //TODO: Writeme!
+}
+
+
void survive_default_imu_process( struct SurviveObject * so, int16_t * accelgyro, uint32_t timecode, int id )
{
//TODO: Writeme!