t/file: Expose non-hack version of the calibration data save function

This commit is contained in:
Jakob Bornecrantz 2020-04-08 00:59:10 +01:00 committed by Jakob Bornecrantz
parent f47c384b79
commit 7b049a9d65
4 changed files with 16 additions and 5 deletions

View file

@ -0,0 +1 @@
tracking: Expose save function with none hardcode path for calibration data.

View file

@ -268,7 +268,8 @@ t_stereo_camera_calibration_load_v1(
*/
extern "C" bool
t_file_save_raw_data(FILE *calib_file, struct t_stereo_camera_calibration *data)
t_stereo_camera_calibration_save_v1(FILE *calib_file,
struct t_stereo_camera_calibration *data)
{
StereoCameraCalibrationWrapper wrapped(data);
// Dummy matrix
@ -343,7 +344,8 @@ t_stereo_camera_calibration_load_v1_hack(
}
extern "C" bool
t_file_save_raw_data_hack(struct t_stereo_camera_calibration *data)
t_stereo_camera_calibration_save_v1_hack(
struct t_stereo_camera_calibration *data)
{
char path_string[PATH_MAX];
char file_string[PATH_MAX];
@ -366,7 +368,7 @@ t_file_save_raw_data_hack(struct t_stereo_camera_calibration *data)
return false;
}
t_file_save_raw_data(calib_file, data);
t_stereo_camera_calibration_save_v1(calib_file, data);
fclose(calib_file);

View file

@ -185,12 +185,20 @@ bool
t_stereo_camera_calibration_load_v1_hack(
struct t_stereo_camera_calibration **out_data);
/*!
* Save the given stereo calibration data to the given file.
*/
bool
t_stereo_camera_calibration_save_v1(FILE *calib_file,
struct t_stereo_camera_calibration *data);
/*!
* Save raw calibration data to file, hack until prober has storage for such
* things.
*/
bool
t_file_save_raw_data_hack(struct t_stereo_camera_calibration *data);
t_stereo_camera_calibration_save_v1_hack(
struct t_stereo_camera_calibration *data);
/*

View file

@ -66,7 +66,7 @@ save_calibration(struct calibration_scene *cs)
}
// Save the data.
t_file_save_raw_data_hack(cs->status.stereo_data);
t_stereo_camera_calibration_save_v1_hack(cs->status.stereo_data);
// Free data, no longer needed.
t_stereo_camera_calibration_reference(&cs->status.stereo_data, NULL);