diff options
author | cnlohr <lohr85@gmail.com> | 2018-04-04 21:25:29 -0400 |
---|---|---|
committer | cnlohr <lohr85@gmail.com> | 2018-04-04 21:25:29 -0400 |
commit | b8447455fdce570e22094e2a71f2fa755724e95b (patch) | |
tree | eb14e1a4f1a256701a692995dfbcf00649f88aee | |
parent | ce6322b6b604b12018a2daf427dbd36afc5fbda2 (diff) | |
download | libsurvive-b8447455fdce570e22094e2a71f2fa755724e95b.tar.gz libsurvive-b8447455fdce570e22094e2a71f2fa755724e95b.tar.bz2 |
Allow calibration with one lighthouse
-rw-r--r-- | src/poser_epnp.c | 2 | ||||
-rwxr-xr-x | src/survive_cal.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/poser_epnp.c b/src/poser_epnp.c index eaa1659..7e922e7 100644 --- a/src/poser_epnp.c +++ b/src/poser_epnp.c @@ -66,7 +66,7 @@ static SurvivePose solve_correspondence(SurviveObject *so, epnp *pnp, bool camer static int opencv_solver_fullscene(SurviveObject *so, PoserDataFullScene *pdfs) { SurvivePose additionalTx = {0}; - for (int lh = 0; lh < 2; lh++) { + for (int lh = 0; lh < so->ctx->activeLighthouses; lh++) { epnp pnp = {.fu = 1, .fv = 1}; epnp_set_maximum_number_of_correspondences(&pnp, so->sensor_ct); diff --git a/src/survive_cal.c b/src/survive_cal.c index 3015b68..4d26bfb 100755 --- a/src/survive_cal.c +++ b/src/survive_cal.c @@ -81,7 +81,7 @@ void ootx_packet_clbk_d(ootx_decoder_context *ct, ootx_packet* packet) config_set_lighthouse(ctx->lh_config,b,id); lighthouses_completed++; - if (lighthouses_completed >= NUM_LIGHTHOUSES) { + if (lighthouses_completed >= ctx->activeLighthouses) { config_save(ctx, survive_configs(ctx, "configfile", SC_GET, "config.json")); } } @@ -225,7 +225,7 @@ void survive_cal_light( struct SurviveObject * so, int sensor_id, int acode, int ootx_pump_bit( &cd->ootx_decoders[lhid], dbit ); } int i; - for( i = 0; i < NUM_LIGHTHOUSES; i++ ) + for( i = 0; i < ctx->activeLighthouses; i++ ) if( ctx->bsd[i].OOTXSet == 0 ) break; if( i == ctx->activeLighthouses ) cd->stage = 2; //TODO: Make this configuratble to allow single lighthouse. } |