aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-03-26 13:50:41 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-03-26 13:51:21 -0600
commit18e717642be3af3b9f72b630dcad68ca17c32dc9 (patch)
treeae3a422849accc7484bdb029113d199269f71d53
parentd4cef29d1322a2d1ecf8b672485e39e388066e5f (diff)
downloadlibsurvive-18e717642be3af3b9f72b630dcad68ca17c32dc9.tar.gz
libsurvive-18e717642be3af3b9f72b630dcad68ca17c32dc9.tar.bz2
Made SBA calibrate with 1lh
-rw-r--r--src/poser.c3
-rw-r--r--src/poser_sba.c9
2 files changed, 9 insertions, 3 deletions
diff --git a/src/poser.c b/src/poser.c
index 7dcdc33..ea5812e 100644
--- a/src/poser.c
+++ b/src/poser.c
@@ -21,7 +21,8 @@ void PoserData_lighthouse_pose_func(PoserData *poser_data, SurviveObject *so, ui
if (quatmagnitude(lighthouse_pose->Rot) == 0) {
SurviveContext *ctx = so->ctx;
- SV_ERROR("Pose func called with invalid pose.");
+ SV_INFO("Pose func called with invalid pose.");
+ return;
}
// Assume that the space solved for is valid but completely arbitrary. We are going to do a few things:
diff --git a/src/poser_sba.c b/src/poser_sba.c
index 226f387..82fbd56 100644
--- a/src/poser_sba.c
+++ b/src/poser_sba.c
@@ -439,8 +439,13 @@ static double run_sba(survive_calibration_config options, PoserDataFullScene *pd
if (status >= 0) {
SurvivePose additionalTx = {};
- PoserData_lighthouse_pose_func(&pdfs->hdr, so, 0, &additionalTx, &sbactx.camera_params[0], &sbactx.obj_pose);
- PoserData_lighthouse_pose_func(&pdfs->hdr, so, 1, &additionalTx, &sbactx.camera_params[1], &sbactx.obj_pose);
+ for (int i = 0; i < NUM_LIGHTHOUSES; i++) {
+ if (quatmagnitude(sbactx.camera_params[i].Rot) != 0) {
+ PoserData_lighthouse_pose_func(&pdfs->hdr, so, i, &additionalTx, &sbactx.camera_params[i],
+ &sbactx.obj_pose);
+ }
+ }
+
} else {
SurviveContext *ctx = so->ctx;
SV_INFO("SBA was unable to run %d", status);