aboutsummaryrefslogtreecommitdiff
path: root/src/survive_process.c
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-04-02 10:10:33 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-04-02 10:10:33 -0600
commit75460f240c9d003e4ca2e6dda9b2146a74df7ffa (patch)
tree957b26f0539df176b61ad2ec72fbb0658b147919 /src/survive_process.c
parent2b63278497130d01b1fbc7e6a94b6ad8e32ab4dd (diff)
parent1724abef15a4090640bd82ba408681438316de7e (diff)
downloadlibsurvive-75460f240c9d003e4ca2e6dda9b2146a74df7ffa.tar.gz
libsurvive-75460f240c9d003e4ca2e6dda9b2146a74df7ffa.tar.bz2
Merge remote-tracking branch 'origin/master' into imu
Diffstat (limited to 'src/survive_process.c')
-rw-r--r--src/survive_process.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/survive_process.c b/src/survive_process.c
index 6136148..e05e809 100644
--- a/src/survive_process.c
+++ b/src/survive_process.c
@@ -48,15 +48,22 @@ void survive_default_light_process( SurviveObject * so, int sensor_id, int acode
FLT angle = (timeinsweep - so->timecenter_ticks) * (1./so->timecenter_ticks * 3.14159265359/2.0);
//Need to now do angle correction.
-#if 1
- BaseStationData * bsd = &ctx->bsd[base_station];
+ static int use_bsd_cal = -1;
+ if (use_bsd_cal == -1) {
+ use_bsd_cal = survive_configi(ctx, "use-bsd-cal", SC_GET, 1);
+ if (use_bsd_cal == 0) {
+ SV_INFO("Not using BSD calibration values");
+ }
+ }
+ if (use_bsd_cal) {
+ 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
+ // XXX TODO: This seriously needs to be worked on. See: https://github.com/cnlohr/libsurvive/issues/18
+ // angle += (use_bsd_cal == 2 ? -1 : 1) * bsd->fcal.phase[axis];
+ // angle += bsd->fcaltilt[axis] * predicted_angle(axis1);
+
+ // TODO!!!
+ }
FLT length_sec = length / (FLT)so->timebase_hz;
ctx->angleproc( so, sensor_id, acode, timecode, length_sec, angle, lh);
@@ -80,7 +87,9 @@ void survive_default_angle_process( SurviveObject * so, int sensor_id, int acode
.lh = lh,
};
- SurviveSensorActivations_add(&so->activations, &l);
+ // Simulate the use of only one lighthouse in playback mode.
+ if (lh < ctx->activeLighthouses)
+ SurviveSensorActivations_add(&so->activations, &l);
survive_recording_angle_process(so, sensor_id, acode, timecode, length, angle, lh);