From 22d40fb360fdb65da7916fb87f9b199f4f401f05 Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Sun, 1 Apr 2018 07:52:00 -0600 Subject: overhal to calibration --- include/libsurvive/survive_reproject.h | 35 ++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'include/libsurvive/survive_reproject.h') diff --git a/include/libsurvive/survive_reproject.h b/include/libsurvive/survive_reproject.h index 961db2a..c90d39c 100644 --- a/include/libsurvive/survive_reproject.h +++ b/include/libsurvive/survive_reproject.h @@ -1,6 +1,8 @@ #pragma once + #include "survive.h" #include +#include #include #ifdef __cplusplus @@ -13,7 +15,7 @@ typedef struct { bool swap; } survive_calibration_options_config; -typedef struct { +typedef struct survive_calibration_config { survive_calibration_options_config phase, tilt, curve, gibMag, gibPhase; @@ -21,10 +23,10 @@ typedef struct { } survive_calibration_config; -void survive_calibration_options_config_apply( - const survive_calibration_options_config *option, const FLT *input, - FLT *output); -const survive_calibration_config *survive_calibration_default_config(); +void survive_calibration_options_config_apply(const survive_calibration_options_config *option, const FLT *input, + FLT *output); + +const survive_calibration_config *survive_calibration_default_config(const SurviveContext *ctx); size_t survive_calibration_config_max_idx(); @@ -32,10 +34,9 @@ survive_calibration_config survive_calibration_config_create_from_idx(size_t v); size_t survive_calibration_config_index(const survive_calibration_config *config); -void survive_reproject(const SurviveContext *ctx, int lighthouse, FLT *point3d, - FLT *out); -void survive_reproject_from_pose(const SurviveContext *ctx, int lighthouse, - const SurvivePose *pose, FLT *point3d, +void survive_reproject(const SurviveContext *ctx, int lighthouse, FLT *point3d, FLT *out); + +void survive_reproject_from_pose(const SurviveContext *ctx, int lighthouse, const SurvivePose *pose, FLT *point3d, FLT *out); // This is given a lighthouse -- in the same system as stored in BaseStationData, and @@ -44,9 +45,19 @@ void survive_reproject_from_pose(const SurviveContext *ctx, int lighthouse, // While this is typically opposite of what we want to do -- we want to find the 3d // position from a 2D coordinate, this is helpful since the minimization of reprojection // error is a core mechanism to many types of solvers. -void survive_reproject_from_pose_with_config( - const SurviveContext *ctx, const survive_calibration_config *config, - int lighthouse, const SurvivePose *pose, const FLT *point3d, FLT *out); +void survive_reproject_from_pose_with_config(const SurviveContext *ctx, const survive_calibration_config *config, + int lighthouse, const SurvivePose *pose, const FLT *point3d, FLT *out); + +void survive_reproject_from_pose_with_bsd(const BaseStationData *bsd, const survive_calibration_config *config, + const SurvivePose *pose, const FLT *point3d, FLT *out); + +void survive_reproject_with_config(const SurviveContext *ctx, const survive_calibration_config *config, int lighthouse, + const FLT *point3d, FLT *out); + +void survive_calibration_config_fprint(FILE *file, const survive_calibration_config *config); + +void survive_apply_bsd_calibration_by_flag(SurviveContext *ctx, int lh, enum SurviveCalFlag f, const FLT *in, FLT *out); +void survive_apply_bsd_calibration(SurviveContext *ctx, int lh, const FLT *in, FLT *out); #ifdef __cplusplus } -- cgit v1.2.3