diff --git a/src/xrt/auxiliary/tracking/t_calibration.cpp b/src/xrt/auxiliary/tracking/t_calibration.cpp index 4cd07e1f8..e633e81d9 100644 --- a/src/xrt/auxiliary/tracking/t_calibration.cpp +++ b/src/xrt/auxiliary/tracking/t_calibration.cpp @@ -209,7 +209,7 @@ ensure_buffers_are_allocated(class Calibration &c, int rows, int cols) } // If our rgb is not allocated but our gray already is, alloc our rgb - // now. We will hit this path if we receive L8 format. + // now. We will end up in this path if we receive L8 format. if (c.gray.cols == cols && c.gray.rows == rows) { refresh_gui_frame(c, rows, cols); return; @@ -352,7 +352,7 @@ do_view_sb_checkers(class Calibration &c, struct ViewState &view, cv::Mat &gray, #ifdef SB_CHEESBOARD_CORNERS_MARKER_SUPPORTED if (c.board.marker) { - // Only available in OpenCV 4.3 and above. + // Only available in OpenCV 4.3 and newer. flags += cv::CALIB_CB_MARKER; } #endif diff --git a/src/xrt/auxiliary/tracking/t_calibration_opencv.hpp b/src/xrt/auxiliary/tracking/t_calibration_opencv.hpp index bea5b1bb6..4c3a73396 100644 --- a/src/xrt/auxiliary/tracking/t_calibration_opencv.hpp +++ b/src/xrt/auxiliary/tracking/t_calibration_opencv.hpp @@ -25,7 +25,7 @@ namespace xrt::auxiliary::tracking { /*! * @brief Essential calibration data wrapped for C++. * - * Just like the cv::Mat that it holds, this object does not own all the memory + * Like the cv::Mat that it holds, this object does not own all the memory * it points to! */ struct CameraCalibrationWrapper @@ -67,7 +67,7 @@ struct CameraCalibrationWrapper /*! * @brief Essential stereo calibration data wrapped for C++. * - * Just like the cv::Mat that it holds, this object does not own (all) the + * Like the cv::Mat that it holds, this object does not own (all) the * memory it points to! */ struct StereoCameraCalibrationWrapper @@ -198,8 +198,7 @@ struct StereoRectificationMaps /*! - * @brief Provides cached, precomputed access to normalized image coordinates - * from original, distorted ones. + * @brief Provides cached, precomputed normalized image coordinates from original, distorted ones. * * Populates internal structures using cv::undistortPoints() and performs * subpixel sampling to interpolate for each query. Essentially, this class lets diff --git a/src/xrt/auxiliary/tracking/t_data_utils.c b/src/xrt/auxiliary/tracking/t_data_utils.c index fa493f3c5..f7cd42f4c 100644 --- a/src/xrt/auxiliary/tracking/t_data_utils.c +++ b/src/xrt/auxiliary/tracking/t_data_utils.c @@ -346,7 +346,7 @@ t_calibration_gui_params_load_or_default(struct t_calibration_params *p) { t_calibration_gui_params_default(p); - // Load defaults from file, if it exists. This overwrites the above + // Load defaults from file, if it exists. This overwrites the preceding struct u_config_json config_json = {0}; u_gui_state_open_file(&config_json); diff --git a/src/xrt/auxiliary/tracking/t_euroc_recorder.cpp b/src/xrt/auxiliary/tracking/t_euroc_recorder.cpp index 1ad092d67..a4cd143eb 100644 --- a/src/xrt/auxiliary/tracking/t_euroc_recorder.cpp +++ b/src/xrt/auxiliary/tracking/t_euroc_recorder.cpp @@ -100,7 +100,7 @@ euroc_recorder_flush(struct euroc_recorder *er) er->imu_queue.pop(); } - // Flush csv streams. Not necessary, just doing it to increase flush frequency + // Flush csv streams. Not necessary, doing it only to increase flush frequency er->imu_csv->flush(); er->left_cam_csv->flush(); er->right_cam_csv->flush(); diff --git a/src/xrt/auxiliary/tracking/t_file.cpp b/src/xrt/auxiliary/tracking/t_file.cpp index 7d0cc696a..bd692defb 100644 --- a/src/xrt/auxiliary/tracking/t_file.cpp +++ b/src/xrt/auxiliary/tracking/t_file.cpp @@ -119,7 +119,7 @@ StereoRectificationMaps::StereoRectificationMaps(t_stereo_camera_calibration *da //! @todo for some reason this looks weird? // Alpha of 1.0 kinda works, not really. int flags = cv::CALIB_ZERO_DISPARITY; - double balance = 0.0; // aka alpha. + double balance = 0.0; // also known as alpha. double fov_scale = 1.0; cv::fisheye::stereoRectify( @@ -217,8 +217,8 @@ t_stereo_camera_calibration_load_v1(FILE *calib_file, struct t_stereo_camera_cal t_stereo_camera_calibration_alloc(&data_ptr, 5); // Hardcoded to 5 distortion parameters. StereoCameraCalibrationWrapper wrapped(data_ptr); - // Dummy matrix - cv::Mat dummy; + // Scratch-space temporary matrix + cv::Mat scratch; // Read our calibration from this file // clang-format off @@ -229,13 +229,13 @@ t_stereo_camera_calibration_load_v1(FILE *calib_file, struct t_stereo_camera_cal result = result && read_cv_mat(calib_file, &wrapped.view[1].distortion_mat, "r_distortion"); // 5 x 1 result = result && read_cv_mat(calib_file, &wrapped.view[0].distortion_fisheye_mat, "l_distortion_fisheye"); // 4 x 1 result = result && read_cv_mat(calib_file, &wrapped.view[1].distortion_fisheye_mat, "r_distortion_fisheye"); // 4 x 1 - result = result && read_cv_mat(calib_file, &dummy, "l_rotation"); // 3 x 3 - result = result && read_cv_mat(calib_file, &dummy, "r_rotation"); // 3 x 3 - result = result && read_cv_mat(calib_file, &dummy, "l_translation"); // empty - result = result && read_cv_mat(calib_file, &dummy, "r_translation"); // empty - result = result && read_cv_mat(calib_file, &dummy, "l_projection"); // 3 x 4 - result = result && read_cv_mat(calib_file, &dummy, "r_projection"); // 3 x 4 - result = result && read_cv_mat(calib_file, &dummy, "disparity_to_depth"); // 4 x 4 + result = result && read_cv_mat(calib_file, &scratch, "l_rotation"); // 3 x 3 + result = result && read_cv_mat(calib_file, &scratch, "r_rotation"); // 3 x 3 + result = result && read_cv_mat(calib_file, &scratch, "l_translation"); // empty + result = result && read_cv_mat(calib_file, &scratch, "r_translation"); // empty + result = result && read_cv_mat(calib_file, &scratch, "l_projection"); // 3 x 4 + result = result && read_cv_mat(calib_file, &scratch, "r_projection"); // 3 x 4 + result = result && read_cv_mat(calib_file, &scratch, "disparity_to_depth"); // 4 x 4 result = result && read_cv_mat(calib_file, &mat_image_size, "mat_image_size"); if (!result) { @@ -447,8 +447,8 @@ t_stereo_camera_calibration_save_v1(FILE *calib_file, struct t_stereo_camera_cal CALIB_WARN("Deprecated function: %s", __func__); StereoCameraCalibrationWrapper wrapped(data); - // Dummy matrix - cv::Mat dummy; + // Scratch-space temporary matrix + cv::Mat scratch; write_cv_mat(calib_file, &wrapped.view[0].intrinsics_mat); write_cv_mat(calib_file, &wrapped.view[1].intrinsics_mat); @@ -456,13 +456,13 @@ t_stereo_camera_calibration_save_v1(FILE *calib_file, struct t_stereo_camera_cal write_cv_mat(calib_file, &wrapped.view[1].distortion_mat); write_cv_mat(calib_file, &wrapped.view[0].distortion_fisheye_mat); write_cv_mat(calib_file, &wrapped.view[1].distortion_fisheye_mat); - write_cv_mat(calib_file, &dummy); // view[0].rotation_mat - write_cv_mat(calib_file, &dummy); // view[1].rotation_mat - write_cv_mat(calib_file, &dummy); // l_translation - write_cv_mat(calib_file, &dummy); // r_translation - write_cv_mat(calib_file, &dummy); // view[0].projection_mat - write_cv_mat(calib_file, &dummy); // view[1].projection_mat - write_cv_mat(calib_file, &dummy); // disparity_to_depth_mat + write_cv_mat(calib_file, &scratch); // view[0].rotation_mat + write_cv_mat(calib_file, &scratch); // view[1].rotation_mat + write_cv_mat(calib_file, &scratch); // l_translation + write_cv_mat(calib_file, &scratch); // r_translation + write_cv_mat(calib_file, &scratch); // view[0].projection_mat + write_cv_mat(calib_file, &scratch); // view[1].projection_mat + write_cv_mat(calib_file, &scratch); // disparity_to_depth_mat cv::Mat mat_image_size; mat_image_size.create(1, 2, CV_32F); diff --git a/src/xrt/auxiliary/tracking/t_imu_fusion.hpp b/src/xrt/auxiliary/tracking/t_imu_fusion.hpp index 8676ee18c..0f12131e6 100644 --- a/src/xrt/auxiliary/tracking/t_imu_fusion.hpp +++ b/src/xrt/auxiliary/tracking/t_imu_fusion.hpp @@ -268,7 +268,7 @@ SimpleIMUFusion::handleAccel(Eigen::Vector3d const &accel, timepoint_ns timestam return false; } - // Initially, just set it to totally trust gravity. + // Initially, set it to totally trust gravity. started_ = true; quat_ = Eigen::Quaterniond::FromTwoVectors(accel.normalized(), Eigen::Vector3d::UnitY()); accel_filter_.addSample(accel, timestamp); diff --git a/src/xrt/auxiliary/tracking/t_tracker_psmv.cpp b/src/xrt/auxiliary/tracking/t_tracker_psmv.cpp index fe7fcbbe3..bf5d2f9b7 100644 --- a/src/xrt/auxiliary/tracking/t_tracker_psmv.cpp +++ b/src/xrt/auxiliary/tracking/t_tracker_psmv.cpp @@ -173,8 +173,8 @@ do_view(TrackerPSMV &t, View &view, cv::Mat &grey, cv::Mat &rgb) * computed by your functor. * * Having this as a struct with a method, instead of a single "algorithm"-style - * function, allows you to keep your complicated filtering logic in your own - * loop, just calling in when you have a new candidate for "best". + * function, lets you keep your complicated filtering logic in your own + * loop, calling in when you have a new candidate for "best". * * @note Create by calling make_lowest_score_finder() with your * function/lambda that takes an element and returns the score, to deduce the diff --git a/src/xrt/auxiliary/tracking/t_tracker_psmv_fusion.cpp b/src/xrt/auxiliary/tracking/t_tracker_psmv_fusion.cpp index 0e45869f5..f40ae64cf 100644 --- a/src/xrt/auxiliary/tracking/t_tracker_psmv_fusion.cpp +++ b/src/xrt/auxiliary/tracking/t_tracker_psmv_fusion.cpp @@ -119,7 +119,7 @@ namespace { imu.handleGyro(map_vec3(sample->gyro_rad_secs).cast(), timestamp_ns); imu.postCorrect(); - //! @todo use better measurements instead of the above "simple + //! @todo use better measurements instead of the preceding "simple //! fusion" if (filter_time_ns != 0 && filter_time_ns != timestamp_ns) { float dt = time_ns_to_s(timestamp_ns - filter_time_ns); diff --git a/src/xrt/auxiliary/tracking/t_tracker_psvr.cpp b/src/xrt/auxiliary/tracking/t_tracker_psvr.cpp index ea6fc016e..5fc613827 100644 --- a/src/xrt/auxiliary/tracking/t_tracker_psvr.cpp +++ b/src/xrt/auxiliary/tracking/t_tracker_psvr.cpp @@ -197,7 +197,7 @@ typedef struct match_data { float angle = {}; // angle from reference vector float distance = {}; // distance from base of reference vector - int32_t vertex_index = {}; // index aka tag + int32_t vertex_index = {}; // index also known as tag Eigen::Vector4f position = {}; // 3d position of vertex blob_point_t src_blob = {}; // blob this vertex was derived from } match_data_t; @@ -915,7 +915,7 @@ disambiguate(TrackerPSVR &t, uint32_t matched_vertex_indices[PSVR_NUM_LEDS]; // we can early-out if we are 'close enough' to our last match model. - // if we just hold the previous led configuration, this increases + // if we hold the previous led configuration, this increases // performance and should cut down on jitter. if (t.last_optical_model > 0 && t.done_correction) { @@ -1293,9 +1293,8 @@ sample_line(cv::Mat &src, const cv::Point2i &start, const cv::Point2i &end, int // cv is row, column uint8_t *val = src.ptr(curr_y, curr_x); - // @todo: we are just counting pixels rather - // than measuring length - bresenhams may introduce some - // inaccuracy here. + /// @todo: we are counting pixels rather than measuring length - bresenhams may introduce some + /// inaccuracy here. if (*val > 128) { (*inside_length) += 1; }