From c47826bb1171083377309e356168b46cb3621df7 Mon Sep 17 00:00:00 2001 From: dpeter99 Date: Sun, 25 Mar 2018 21:06:27 +0200 Subject: Started the VS project update --- .gitignore | 1 + src/poser.c | 5 ++++- src/poser_charlesslow.c | 2 +- src/poser_daveortho.c | 2 +- src/poser_epnp.c | 4 ++-- src/poser_sba.c | 22 +++++++++++----------- src/poser_turveytori.c | 2 +- src/survive_cal.c | 2 +- src/survive_playback.c | 8 ++++---- winbuild/calibrate/calibrate.vcxproj | 1 + winbuild/libsurvive/libsurvive.vcxproj | 7 ++++++- winbuild/libsurvive/libsurvive.vcxproj.filters | 21 ++++++++++++++++++--- 12 files changed, 51 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index e5f098b..712fde2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ winbuild/calibrate/calinfo/* winbuild/calibrate/config.json winbuild/calibrate/x64/* winbuild/libsurvive/x64/* +winbuild/data_recorder/x64/* winbuild/.vs/* *.user *.ipch diff --git a/src/poser.c b/src/poser.c index 2cfe28d..1c638f8 100644 --- a/src/poser.c +++ b/src/poser.c @@ -3,6 +3,9 @@ #include #include +#define _USE_MATH_DEFINES // for C +#include + void PoserData_poser_raw_pose_func(PoserData *poser_data, SurviveObject *so, uint8_t lighthouse, SurvivePose *pose) { if (poser_data->rawposeproc) { poser_data->rawposeproc(so, lighthouse, pose, poser_data->userdata); @@ -44,7 +47,7 @@ void PoserData_lighthouse_pose_func(PoserData *poser_data, SurviveObject *so, ui ApplyPoseToPose(&lighthouse2obj, &arb2object, &lighthouse2arb); // Now find the space with the same origin, but rotated so that gravity is up - SurvivePose lighthouse2objUp = {}, object2objUp = {}; + SurvivePose lighthouse2objUp = {0}, object2objUp = {0}; if (quatmagnitude(so->activations.accel)) { quatfrom2vectors(object2objUp.Rot, so->activations.accel, up); } else { diff --git a/src/poser_charlesslow.c b/src/poser_charlesslow.c index c7d9033..bc6683a 100644 --- a/src/poser_charlesslow.c +++ b/src/poser_charlesslow.c @@ -53,7 +53,7 @@ int PoserCharlesSlow( SurviveObject * so, PoserData * pd ) printf( "%f %f %f\n", hmd_points[p*3+0], hmd_points[p*3+1], hmd_points[p*3+2] ); } - SurvivePose additionalTx = {}; + SurvivePose additionalTx = {0}; int lh, cycle; FLT dz, dy, dx; diff --git a/src/poser_daveortho.c b/src/poser_daveortho.c index c922b2e..c47bceb 100644 --- a/src/poser_daveortho.c +++ b/src/poser_daveortho.c @@ -127,7 +127,7 @@ int PoserDaveOrtho( SurviveObject * so, PoserData * pd ) PoserDataFullScene * fs = (PoserDataFullScene*)pd; int LH_ID; - SurvivePose alignLh0ToXAxis = {}; + SurvivePose alignLh0ToXAxis = {0}; for( LH_ID = 0; LH_ID < 2; LH_ID++ ) { int i; diff --git a/src/poser_epnp.c b/src/poser_epnp.c index 401ea2a..f5fa127 100644 --- a/src/poser_epnp.c +++ b/src/poser_epnp.c @@ -13,7 +13,7 @@ #include "stdio.h" static SurvivePose solve_correspondence(SurviveObject *so, epnp *pnp, bool cameraToWorld) { - SurvivePose rtn = {}; + SurvivePose rtn = {0}; // std::cerr << "Solving for " << cal_imagePoints.size() << " correspondents" << std::endl; if (pnp->number_of_correspondences <= 3) { SurviveContext *ctx = so->ctx; @@ -128,7 +128,7 @@ int PoserEPNP(SurviveObject *so, PoserData *pd) { SurvivePose pose = solve_correspondence(so, &pnp, false); - SurvivePose txPose = {}; + SurvivePose txPose = {0}; quatrotatevector(txPose.Pos, so->ctx->bsd[lh].Pose.Rot, pose.Pos); for (int i = 0; i < 3; i++) { txPose.Pos[i] += so->ctx->bsd[lh].Pose.Pos[i]; diff --git a/src/poser_sba.c b/src/poser_sba.c index c01cc61..a1fdea6 100644 --- a/src/poser_sba.c +++ b/src/poser_sba.c @@ -44,7 +44,7 @@ void metric_function(int j, int i, double *aj, double *xij, void *adata) { SurviveObject *so = ctx->so; SurvivePose obj2world = ctx->obj_pose; - FLT sensorInWorld[3] = {}; + FLT sensorInWorld[3] = {0}; ApplyPoseToPoint(sensorInWorld, &obj2world, &so->sensor_locations[i * 3]); survive_reproject_from_pose_with_config(so->ctx, &ctx->calibration_config, j, (SurvivePose *)aj, sensorInWorld, xij); @@ -210,7 +210,7 @@ static double run_sba_find_3d_structure_single_sweep(survive_calibration_config pdl->hdr.pt = hdr.pt; pdl->hdr.rawposeproc = sba_set_position; - sba_set_position_t locations = {}; + sba_set_position_t locations = {0}; pdl->hdr.userdata = &locations; driver(so, &pdl->hdr); pdl->hdr = hdr; @@ -226,8 +226,8 @@ static double run_sba_find_3d_structure_single_sweep(survive_calibration_config } } - double opts[SBA_OPTSSZ] = {}; - double info[SBA_INFOSZ] = {}; + double opts[SBA_OPTSSZ] = {0}; + double info[SBA_INFOSZ] = {0}; sba_context_single_sweep ctx = {.hdr = {options, &pdl->hdr, so}, .acode = acode, .lh = lh}; @@ -306,7 +306,7 @@ static double run_sba_find_3d_structure(SBAData *d, survive_calibration_config o pdl->hdr.pt = hdr.pt; pdl->hdr.rawposeproc = sba_set_position; - sba_set_position_t locations = {}; + sba_set_position_t locations = {0}; pdl->hdr.userdata = &locations; driver(so, &pdl->hdr); pdl->hdr = hdr; @@ -323,8 +323,8 @@ static double run_sba_find_3d_structure(SBAData *d, survive_calibration_config o } } - double opts[SBA_OPTSSZ] = {}; - double info[SBA_INFOSZ] = {}; + double opts[SBA_OPTSSZ] = {0}; + double info[SBA_INFOSZ] = {0}; sba_context ctx = {options, &pdl->hdr, so}; @@ -399,7 +399,7 @@ static double run_sba(survive_calibration_config options, PoserDataFullScene *pd } else { SV_INFO("Not using a seed poser for SBA; results will likely be way off"); for (int i = 0; i < 2; i++) { - so->ctx->bsd[i].Pose = (SurvivePose){}; + so->ctx->bsd[i].Pose = (SurvivePose){0}; so->ctx->bsd[i].Pose.Rot[0] = 1.; } } @@ -407,8 +407,8 @@ static double run_sba(survive_calibration_config options, PoserDataFullScene *pd // PoserCharlesSlow(so, (PoserData *)pdfs); } - double opts[SBA_OPTSSZ] = {}; - double info[SBA_INFOSZ] = {}; + double opts[SBA_OPTSSZ] = {0}; + double info[SBA_INFOSZ] = {0}; opts[0] = SBA_INIT_MU; opts[1] = SBA_STOP_THRESH; @@ -435,7 +435,7 @@ static double run_sba(survive_calibration_config options, PoserDataFullScene *pd info); // info if (status >= 0) { - SurvivePose additionalTx = {}; + SurvivePose additionalTx = {0}; 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); } else { diff --git a/src/poser_turveytori.c b/src/poser_turveytori.c index 2d3f802..035fca7 100644 --- a/src/poser_turveytori.c +++ b/src/poser_turveytori.c @@ -1443,7 +1443,7 @@ static Point SolveForLighthouse(FLT posOut[3], FLT quatOut[4], TrackedObject *ob lighthousePose.Pos[1] = refinedEstimateGd.y; lighthousePose.Pos[2] = refinedEstimateGd.z; - SurvivePose assumedObj = {}; + SurvivePose assumedObj = {0}; FLT negZ[3] = {0, 0, 1}; quatfrom2vectors(assumedObj.Rot, toriData->down, negZ); diff --git a/src/survive_cal.c b/src/survive_cal.c index 218f5c1..25e43b9 100755 --- a/src/survive_cal.c +++ b/src/survive_cal.c @@ -599,7 +599,7 @@ static void handle_calibration( struct SurviveCalData *cd ) for( obj = 0; obj < cd->numPoseObjects; obj++ ) { int i, j; - PoserDataFullScene fsd = {}; + PoserDataFullScene fsd = {0}; fsd.hdr.pt = POSERDATA_FULL_SCENE; for( j = 0; j < NUM_LIGHTHOUSES; j++ ) for( i = 0; i < SENSORS_PER_OBJECT; i++ ) diff --git a/src/survive_playback.c b/src/survive_playback.c index dc9a330..de26f73 100644 --- a/src/survive_playback.c +++ b/src/survive_playback.c @@ -6,7 +6,7 @@ #include #include -#include +//#include #include "survive_config.h" #include "survive_default_devices.h" @@ -274,7 +274,7 @@ static int playback_poll(struct SurviveContext *ctx, void *_driver) { if (driver->next_time_us == 0) { char *buffer; size_t n = 0; - ssize_t r = getdelim(&line, &n, ' ', f); + int r = getdelim(&line, &n, ' ', f); if (r <= 0) return 0; @@ -292,7 +292,7 @@ static int playback_poll(struct SurviveContext *ctx, void *_driver) { char *buffer; size_t n = 0; - ssize_t r = getline(&line, &n, f); + int r = getline(&line, &n, f); if (r <= 0) return 0; @@ -397,7 +397,7 @@ int DriverRegPlayback(SurviveContext *ctx) { while (!feof(sp->playback_file) && !ferror(sp->playback_file)) { char *line = 0; size_t n; - ssize_t r = getline(&line, &n, sp->playback_file); + int r = getline(&line, &n, sp->playback_file); if (r <= 0) continue; diff --git a/winbuild/calibrate/calibrate.vcxproj b/winbuild/calibrate/calibrate.vcxproj index 7a62c14..4392e49 100644 --- a/winbuild/calibrate/calibrate.vcxproj +++ b/winbuild/calibrate/calibrate.vcxproj @@ -111,6 +111,7 @@ Disabled USE_DOUBLE;RUNTIME_SYMNUMX;HIDAPI;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) ..\..\windows;..\..\include\libsurvive;..\..\redist;%(AdditionalIncludeDirectories) + true Console diff --git a/winbuild/libsurvive/libsurvive.vcxproj b/winbuild/libsurvive/libsurvive.vcxproj index 725243a..3ce9dd3 100644 --- a/winbuild/libsurvive/libsurvive.vcxproj +++ b/winbuild/libsurvive/libsurvive.vcxproj @@ -150,6 +150,7 @@ + @@ -157,11 +158,15 @@ + - + + + + diff --git a/winbuild/libsurvive/libsurvive.vcxproj.filters b/winbuild/libsurvive/libsurvive.vcxproj.filters index 4c8c3c5..e96e220 100644 --- a/winbuild/libsurvive/libsurvive.vcxproj.filters +++ b/winbuild/libsurvive/libsurvive.vcxproj.filters @@ -39,9 +39,6 @@ Source Files - - Source Files - Source Files @@ -93,6 +90,24 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + -- cgit v1.2.3