aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-04-09 09:33:40 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-04-09 09:33:40 -0600
commit7f4385538d6b19ea5dd3f00c4a0eb49385798031 (patch)
tree39ea05079277984042c8a8865382852f258a13cb
parent5985e89c8d7460f17ede727615bad795b3ab2c87 (diff)
downloadlibsurvive-7f4385538d6b19ea5dd3f00c4a0eb49385798031.tar.gz
libsurvive-7f4385538d6b19ea5dd3f00c4a0eb49385798031.tar.bz2
Made new posers work in windows
-rw-r--r--src/poser_epnp.c2
-rw-r--r--src/poser_general_optimizer.c3
-rw-r--r--src/poser_mpfit.c15
-rw-r--r--src/poser_sba.c2
-rw-r--r--src/survive.c2
-rw-r--r--winbuild/libsurvive/libsurvive.vcxproj6
-rw-r--r--winbuild/libsurvive/libsurvive.vcxproj.filters18
7 files changed, 34 insertions, 14 deletions
diff --git a/src/poser_epnp.c b/src/poser_epnp.c
index 615c01c..851ce29 100644
--- a/src/poser_epnp.c
+++ b/src/poser_epnp.c
@@ -129,7 +129,7 @@ int PoserEPNP(SurviveObject *so, PoserData *pd) {
case POSERDATA_LIGHT: {
PoserDataLight *lightData = (PoserDataLight *)pd;
- SurvivePose posers[2] = {};
+ SurvivePose posers[2] = { 0 };
int meas[2] = {0, 0};
for (int lh = 0; lh < so->ctx->activeLighthouses; lh++) {
if (so->ctx->bsd[lh].PositionSet) {
diff --git a/src/poser_general_optimizer.c b/src/poser_general_optimizer.c
index 313e378..b3c4e65 100644
--- a/src/poser_general_optimizer.c
+++ b/src/poser_general_optimizer.c
@@ -1,6 +1,7 @@
#include "poser_general_optimizer.h"
#include "string.h"
-#include <alloca.h>
+
+#include <malloc.h>
#include <assert.h>
#include <stdio.h>
diff --git a/src/poser_mpfit.c b/src/poser_mpfit.c
index 03ef522..439d151 100644
--- a/src/poser_mpfit.c
+++ b/src/poser_mpfit.c
@@ -167,22 +167,15 @@ static double run_mpfit_find_3d_structure(MPFITData *d, PoserDataLight *pdl, Sur
}
failure_count = 0;
- SurvivePose soLocation = {};
+ SurvivePose soLocation = { 0 };
if (!general_optimizer_data_record_current_pose(&d->opt, &pdl->hdr, sizeof(*pdl), &soLocation)) {
return -1;
}
- mp_result result = {};
- mp_par pars[7] = {};
- pars[0].parname = "X";
- pars[1].parname = "Y";
- pars[2].parname = "Z";
- pars[3].parname = "w";
- pars[4].parname = "i";
- pars[5].parname = "j";
- pars[6].parname = "k";
-
+ mp_result result = { 0 };
+ mp_par pars[7] = { 0 };
+
const bool debug_jacobian = false;
if (d->use_jacobian_function) {
for (int i = 0; i < 7; i++) {
diff --git a/src/poser_sba.c b/src/poser_sba.c
index 4c7fcd1..5166951 100644
--- a/src/poser_sba.c
+++ b/src/poser_sba.c
@@ -230,7 +230,7 @@ static double run_sba_find_3d_structure(SBAData *d, PoserDataLight *pdl, Survive
}
failure_count = 0;
- SurvivePose soLocation = {};
+ SurvivePose soLocation = { 0 };
if (!general_optimizer_data_record_current_pose(&d->opt, &pdl->hdr, sizeof(*pdl), &soLocation)) {
return -1;
diff --git a/src/survive.c b/src/survive.c
index 9e750f9..1ab09da 100644
--- a/src/survive.c
+++ b/src/survive.c
@@ -114,6 +114,8 @@ SurviveContext *survive_init_internal(int argc, char *const *argv) {
MANUAL_DRIVER_REGISTRATION(PoserDummy)
MANUAL_DRIVER_REGISTRATION(PoserEPNP)
MANUAL_DRIVER_REGISTRATION(PoserSBA)
+ MANUAL_DRIVER_REGISTRATION(PoserCharlesRefine)
+ MANUAL_DRIVER_REGISTRATION(PoserMPFIT)
MANUAL_DRIVER_REGISTRATION(DriverRegHTCVive)
MANUAL_DRIVER_REGISTRATION(DriverRegPlayback)
diff --git a/winbuild/libsurvive/libsurvive.vcxproj b/winbuild/libsurvive/libsurvive.vcxproj
index fb1b9a5..8a0aaf1 100644
--- a/winbuild/libsurvive/libsurvive.vcxproj
+++ b/winbuild/libsurvive/libsurvive.vcxproj
@@ -244,6 +244,7 @@
<ClCompile Include="..\..\redist\json_helpers.c" />
<ClCompile Include="..\..\redist\linmath.c" />
<ClCompile Include="..\..\redist\minimal_opencv.c" />
+ <ClCompile Include="..\..\redist\mpfit\mpfit.c" />
<ClCompile Include="..\..\redist\puff.c" />
<ClCompile Include="..\..\redist\sba\sba_chkjac.c" />
<ClCompile Include="..\..\redist\sba\sba_crsm.c" />
@@ -254,10 +255,13 @@
<ClCompile Include="..\..\src\epnp\epnp.c" />
<ClCompile Include="..\..\src\ootx_decoder.c" />
<ClCompile Include="..\..\src\poser.c" />
+ <ClCompile Include="..\..\src\poser_charlesrefine.c" />
<ClCompile Include="..\..\src\poser_charlesslow.c" />
<ClCompile Include="..\..\src\poser_daveortho.c" />
<ClCompile Include="..\..\src\poser_dummy.c" />
<ClCompile Include="..\..\src\poser_epnp.c" />
+ <ClCompile Include="..\..\src\poser_general_optimizer.c" />
+ <ClCompile Include="..\..\src\poser_mpfit.c" />
<ClCompile Include="..\..\src\poser_octavioradii.c" />
<ClCompile Include="..\..\src\poser_sba.c" />
<ClCompile Include="..\..\src\poser_turveytori.c" />
@@ -288,11 +292,13 @@
<ClInclude Include="..\..\redist\json_helpers.h" />
<ClInclude Include="..\..\redist\linmath.h" />
<ClInclude Include="..\..\redist\minimal_opencv.h" />
+ <ClInclude Include="..\..\redist\mpfit\mpfit.h" />
<ClInclude Include="..\..\redist\os_generic.h" />
<ClInclude Include="..\..\redist\sba\sba.h" />
<ClInclude Include="..\..\redist\symbol_enumerator.h" />
<ClInclude Include="..\..\src\epnp\epnp.h" />
<ClInclude Include="..\..\src\ootx_decoder.h" />
+ <ClInclude Include="..\..\src\poser_general_optimizer.h" />
<ClInclude Include="..\..\src\survive_cal.h" />
<ClInclude Include="..\..\src\survive_config.h" />
<ClInclude Include="..\..\src\survive_default_devices.h" />
diff --git a/winbuild/libsurvive/libsurvive.vcxproj.filters b/winbuild/libsurvive/libsurvive.vcxproj.filters
index d06f083..019631b 100644
--- a/winbuild/libsurvive/libsurvive.vcxproj.filters
+++ b/winbuild/libsurvive/libsurvive.vcxproj.filters
@@ -138,6 +138,18 @@
<ClCompile Include="..\..\src\survive_imu.c">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\redist\mpfit\mpfit.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\poser_general_optimizer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\poser_mpfit.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\poser_charlesrefine.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\ootx_decoder.h">
@@ -191,6 +203,12 @@
<ClInclude Include="..\..\redist\sba\sba.h">
<Filter>Source Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\redist\mpfit\mpfit.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\poser_general_optimizer.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />