The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

t/slam: Prioritize SLAM_CONFIG over driver calibration if set

authored by

Mateo de Mayo and committed by
Jakob Bornecrantz
6bc551d0 e24ec3d4

+27 -20
+27 -20
src/xrt/auxiliary/tracking/t_tracker_slam.cpp
··· 847 847 t.slam->use_feature(F_ADD_IMU_CALIBRATION, params, result); 848 848 } 849 849 850 + static void 851 + send_calibration(const TrackerSlam &t, const t_slam_tracker_config &c) 852 + { 853 + // Try to send camera calibration data to the SLAM system 854 + if (c.stereo_calib && c.extra_calib && t.slam->supports_feature(F_ADD_CAMERA_CALIBRATION)) { 855 + SLAM_INFO("Sending Camera calibration from Monado"); 856 + add_camera_calibration(t, c.stereo_calib, c.extra_calib); 857 + } else { 858 + SLAM_INFO("Cameras will use the calibration provided by the SLAM_CONFIG file"); 859 + } 860 + 861 + // Try to send IMU calibration data to the SLAM system 862 + if (c.imu_calib && c.extra_calib && t.slam->supports_feature(F_ADD_IMU_CALIBRATION)) { 863 + SLAM_INFO("Sending IMU calibration from Monado"); 864 + add_imu_calibration(t, c.imu_calib, c.extra_calib); 865 + } else { 866 + SLAM_INFO("The IMU will use the calibration provided by the SLAM_CONFIG file"); 867 + } 868 + } 869 + 870 + 850 871 } // namespace xrt::auxiliary::tracking::slam 851 872 852 873 using namespace xrt::auxiliary::tracking::slam; ··· 1066 1087 const char *config_file = config->slam_config; 1067 1088 bool some_calib = config->stereo_calib || config->imu_calib; 1068 1089 if (!config_file && !some_calib) { 1069 - U_LOG_IFL_W(log_level, "Unable to determine sensor calibration, did you forgot to set SLAM_CONFIG?"); 1090 + U_LOG_IFL_W(log_level, "Unable to determine sensor calibration, did you forget to set SLAM_CONFIG?"); 1070 1091 return -1; 1071 - } 1072 - 1073 - if (!config_file) { 1074 - // Indicate the external system to use default (non-calibration) settings 1075 - config_file = "DEFAULT"; 1076 1092 } 1077 1093 1078 1094 auto &t = *(new TrackerSlam{}); ··· 1081 1097 1082 1098 t.base.get_tracked_pose = t_slam_get_tracked_pose; 1083 1099 1084 - std::string config_file_string = std::string(config_file); 1100 + std::string config_file_string = std::string(config_file ? config_file : "DEFAULT"); 1085 1101 t.slam = new slam_tracker{config_file_string}; 1086 1102 1087 - // Try to send camera calibration data to the SLAM system 1088 - if (config->stereo_calib && config->extra_calib && t.slam->supports_feature(F_ADD_CAMERA_CALIBRATION)) { 1089 - SLAM_INFO("Sending Camera calibration from Monado"); 1090 - add_camera_calibration(t, config->stereo_calib, config->extra_calib); 1103 + if (!config_file) { 1104 + SLAM_INFO("Using calibration from driver and default pipeline settings"); 1105 + send_calibration(t, *config); 1091 1106 } else { 1092 - SLAM_INFO("Cameras will use the calibration provided by the SLAM_CONFIG file"); 1093 - } 1094 - 1095 - // Try to send IMU calibration data to the SLAM system 1096 - if (config->imu_calib && config->extra_calib && t.slam->supports_feature(F_ADD_IMU_CALIBRATION)) { 1097 - SLAM_INFO("Sending IMU calibration from Monado"); 1098 - add_imu_calibration(t, config->imu_calib, config->extra_calib); 1099 - } else { 1100 - SLAM_INFO("The IMU will use the calibration provided by the SLAM_CONFIG file"); 1107 + SLAM_INFO("Using sensor calibration provided by the SLAM_CONFIG file"); 1101 1108 } 1102 1109 1103 1110 t.slam->initialize();