From 2a54dcdb190ac679b78e57707c23c0a80c7efff6 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 17 May 2022 16:57:53 -0500 Subject: [PATCH] a/math: Improve word choice/clarity --- src/xrt/auxiliary/math/m_documentation.hpp | 2 +- src/xrt/auxiliary/math/m_filter_fifo.c | 2 +- src/xrt/auxiliary/math/m_filter_fifo.h | 5 ++--- src/xrt/auxiliary/math/m_filter_one_euro.c | 3 ++- src/xrt/auxiliary/math/m_imu_pre.h | 2 +- src/xrt/auxiliary/math/m_lowpass_float.h | 6 +++--- src/xrt/auxiliary/math/m_lowpass_float.hpp | 12 ++++++------ src/xrt/auxiliary/math/m_lowpass_float_vector.hpp | 8 ++++---- src/xrt/auxiliary/math/m_lowpass_integer.h | 4 ++-- src/xrt/auxiliary/math/m_lowpass_integer.hpp | 12 ++++++------ src/xrt/auxiliary/math/m_quatexpmap.cpp | 4 ++-- src/xrt/auxiliary/math/m_relation_history.cpp | 8 ++++---- src/xrt/auxiliary/math/m_space.cpp | 4 ++-- 13 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/xrt/auxiliary/math/m_documentation.hpp b/src/xrt/auxiliary/math/m_documentation.hpp index 6ab8d057b..3dac538e2 100644 --- a/src/xrt/auxiliary/math/m_documentation.hpp +++ b/src/xrt/auxiliary/math/m_documentation.hpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: BSL-1.0 /*! * @file - * @brief Header with just documentation. + * @brief Header with only documentation. * @author Ryan Pavlik * @ingroup aux_math */ diff --git a/src/xrt/auxiliary/math/m_filter_fifo.c b/src/xrt/auxiliary/math/m_filter_fifo.c index 8abd75647..071ff2055 100644 --- a/src/xrt/auxiliary/math/m_filter_fifo.c +++ b/src/xrt/auxiliary/math/m_filter_fifo.c @@ -2,7 +2,7 @@ // SPDX-License-Identifier: BSL-1.0 /*! * @file - * @brief A fifo that also allows you to dynamically filter. + * @brief A fifo that also lets you dynamically filter. * @author Jakob Bornecrantz * @ingroup aux_math */ diff --git a/src/xrt/auxiliary/math/m_filter_fifo.h b/src/xrt/auxiliary/math/m_filter_fifo.h index 3992be4f0..72a750698 100644 --- a/src/xrt/auxiliary/math/m_filter_fifo.h +++ b/src/xrt/auxiliary/math/m_filter_fifo.h @@ -2,7 +2,7 @@ // SPDX-License-Identifier: BSL-1.0 /*! * @file - * @brief A fifo that also allows you to dynamically filter. + * @brief A fifo that also lets you dynamically filter. * @author Jakob Bornecrantz * @ingroup aux_math */ @@ -94,8 +94,7 @@ void m_ff_f64_push(struct m_ff_f64 *ff, const double *sample, uint64_t timestamp_ns); /*! - * Return the sample at the index, zero means the last sample push, one second - * last and so on. + * Return the sample at the index, 0 means the last sample push, 1 second-to-last, etc. */ bool m_ff_f64_get(struct m_ff_f64 *ff, size_t num, double *out_sample, uint64_t *out_timestamp_ns); diff --git a/src/xrt/auxiliary/math/m_filter_one_euro.c b/src/xrt/auxiliary/math/m_filter_one_euro.c index 1a7db978a..07d6a419c 100644 --- a/src/xrt/auxiliary/math/m_filter_one_euro.c +++ b/src/xrt/auxiliary/math/m_filter_one_euro.c @@ -197,7 +197,8 @@ m_filter_euro_vec2_run_no_commit(struct m_filter_euro_vec2 *f, { if (filter_one_euro_handle_first_sample(&f->base, ts, false)) { - // First sample - no filtering yet - and we're not committing anything to the filter so just return + // First sample - no filtering yet - and we're not committing anything to the filter so return right + // away *out_y = *in_y; return; } diff --git a/src/xrt/auxiliary/math/m_imu_pre.h b/src/xrt/auxiliary/math/m_imu_pre.h index 70b003bbb..ac295ee88 100644 --- a/src/xrt/auxiliary/math/m_imu_pre.h +++ b/src/xrt/auxiliary/math/m_imu_pre.h @@ -56,7 +56,7 @@ struct m_imu_pre_filter }; /*! - * A simple init function that just takes the two ticks_to_float values, all + * A simple init function that takes the two ticks_to_float values, all * other values are set to identity. */ void diff --git a/src/xrt/auxiliary/math/m_lowpass_float.h b/src/xrt/auxiliary/math/m_lowpass_float.h index e43320a3f..ff4ecd705 100644 --- a/src/xrt/auxiliary/math/m_lowpass_float.h +++ b/src/xrt/auxiliary/math/m_lowpass_float.h @@ -51,7 +51,7 @@ void m_lowpass_float_add_sample(struct m_lowpass_float *mlf, float sample, timepoint_ns timestamp_ns); /*! - * Access the filtered value. + * Get the filtered value. * * Probably 0 or other meaningless value if it's not initialized: see @ref m_lowpass_float_is_initialized * @@ -63,7 +63,7 @@ float m_lowpass_float_get_state(const struct m_lowpass_float *mlf); /*! - * Access the time of last update + * Get the time of last update * * @param mlf self-pointer * @@ -73,7 +73,7 @@ timepoint_ns m_lowpass_float_get_timestamp_ns(const struct m_lowpass_float *mlf); /*! - * Access whether we have initialized state. + * Get whether we have initialized state. * * @param mlf self-pointer * diff --git a/src/xrt/auxiliary/math/m_lowpass_float.hpp b/src/xrt/auxiliary/math/m_lowpass_float.hpp index e6b577edf..a6249c3e1 100644 --- a/src/xrt/auxiliary/math/m_lowpass_float.hpp +++ b/src/xrt/auxiliary/math/m_lowpass_float.hpp @@ -45,7 +45,7 @@ namespace detail { * blocked. * * @param val The value to initialize the filter with. Does not - * affect the filter itself: only seen if you access state + * affect the filter itself: only seen if you get state * before initializing the filter with the first sample. */ explicit LowPassIIR(Scalar cutoff_hz, Value const &val) noexcept @@ -53,7 +53,7 @@ namespace detail { {} /*! - * Reset the filter to just-created state. + * Reset the filter to newly-created state. */ void reset(Value const &val) noexcept @@ -122,7 +122,7 @@ public: /*! - * Reset the filter to just-created state. + * Reset the filter to newly-created state. */ void reset() noexcept @@ -146,7 +146,7 @@ public: } /*! - * Access the filtered value. + * Get the filtered value. */ Scalar getState() const noexcept @@ -155,7 +155,7 @@ public: } /*! - * Access the time of last update. + * Get the time of last update. */ timepoint_ns getTimestampNs() const noexcept @@ -164,7 +164,7 @@ public: } /*! - * Access whether we have initialized state. + * Get whether we have initialized state. */ bool isInitialized() const noexcept diff --git a/src/xrt/auxiliary/math/m_lowpass_float_vector.hpp b/src/xrt/auxiliary/math/m_lowpass_float_vector.hpp index 908defdc3..319a9db2e 100644 --- a/src/xrt/auxiliary/math/m_lowpass_float_vector.hpp +++ b/src/xrt/auxiliary/math/m_lowpass_float_vector.hpp @@ -44,7 +44,7 @@ public: /*! - * Reset the filter to just-created state. + * Reset the filter to newly-created state. */ void reset() noexcept @@ -68,7 +68,7 @@ public: } /*! - * Access the filtered value. + * Get the filtered value. */ Vector const & getState() const noexcept @@ -77,7 +77,7 @@ public: } /*! - * Access the time of last update. + * Get the time of last update. */ std::uint64_t getTimestampNs() const noexcept @@ -86,7 +86,7 @@ public: } /*! - * Access whether we have initialized state. + * Get whether we have initialized state. */ bool isInitialized() const noexcept diff --git a/src/xrt/auxiliary/math/m_lowpass_integer.h b/src/xrt/auxiliary/math/m_lowpass_integer.h index af6a767ac..6f8027ab3 100644 --- a/src/xrt/auxiliary/math/m_lowpass_integer.h +++ b/src/xrt/auxiliary/math/m_lowpass_integer.h @@ -53,7 +53,7 @@ void m_lowpass_integer_add_sample(struct m_lowpass_integer *mli, int64_t sample); /*! - * Access the filtered value. + * Get the filtered value. * * Probably 0 or other meaningless value if it's not initialized: see @ref m_lowpass_integer_is_initialized * @@ -65,7 +65,7 @@ int64_t m_lowpass_integer_get_state(const struct m_lowpass_integer *mli); /*! - * Access whether we have initialized state. + * Get whether we have initialized state. * * @param mli self-pointer * diff --git a/src/xrt/auxiliary/math/m_lowpass_integer.hpp b/src/xrt/auxiliary/math/m_lowpass_integer.hpp index f89691916..25c63f38a 100644 --- a/src/xrt/auxiliary/math/m_lowpass_integer.hpp +++ b/src/xrt/auxiliary/math/m_lowpass_integer.hpp @@ -44,7 +44,7 @@ namespace detail { * more influence from new input. @p alpha_.isBetweenZeroAndOne() must be true. * * @param val The value to initialize the filter with. Does not - * affect the filter itself: only seen if you access state + * affect the filter itself: only seen if you get the state * before initializing the filter with the first sample. */ explicit IntegerLowPassIIR(math::Rational alpha_, Value const &val) @@ -56,7 +56,7 @@ namespace detail { } /*! - * Reset the filter to just-created state. + * Reset the filter to newly-created state. */ void reset(Value const &val) noexcept @@ -100,7 +100,7 @@ namespace detail { /*! * A very simple integer low-pass filter, using a "one-pole infinite impulse response" - * design (one-pole IIR), aka exponential filter. + * design (one-pole IIR), also known as an exponential filter. * * Configurable in scalar type. */ @@ -121,7 +121,7 @@ public: } /*! - * Reset the filter to just-created state. + * Reset the filter to newly-created state. */ void reset() noexcept @@ -144,7 +144,7 @@ public: } /*! - * Access the filtered value. + * Get the filtered value. */ Scalar getState() const noexcept @@ -154,7 +154,7 @@ public: /*! - * Access whether we have initialized state. + * Get whether we have initialized state. */ bool isInitialized() const noexcept diff --git a/src/xrt/auxiliary/math/m_quatexpmap.cpp b/src/xrt/auxiliary/math/m_quatexpmap.cpp index 02e69fb38..2822f892e 100644 --- a/src/xrt/auxiliary/math/m_quatexpmap.cpp +++ b/src/xrt/auxiliary/math/m_quatexpmap.cpp @@ -88,7 +88,7 @@ quat_exp(Eigen::MatrixBase const &vec) return ret.normalized(); } -/// Taylor series expansion of theta over sin(theta), aka cosecant, for +/// Taylor series expansion of theta over sin(theta), also known as cosecant, for /// use near 0 when you want continuity and validity at 0. template inline Scalar @@ -112,7 +112,7 @@ quat_ln(Eigen::Quaternion const &quat) { // ln q = ( (phi)/(norm of vec) vec, ln(norm of quat)) // When we assume a unit quaternion, ln(norm of quat) = 0 - // so then we just scale the vector part by phi/sin(phi) to get the + // so then we scale the vector part by phi/sin(phi) to get the // result (i.e., ln(qv, qw) = (phi/sin(phi)) * qv ) Scalar vecnorm = quat.vec().norm(); diff --git a/src/xrt/auxiliary/math/m_relation_history.cpp b/src/xrt/auxiliary/math/m_relation_history.cpp index 217d8ac45..af8d819fc 100644 --- a/src/xrt/auxiliary/math/m_relation_history.cpp +++ b/src/xrt/auxiliary/math/m_relation_history.cpp @@ -68,7 +68,7 @@ m_relation_history_push(struct m_relation_history *rh, struct xrt_space_relation // if we aren't empty, we can compare against the latest timestamp. if (rh->impl.empty() || rhe.timestamp > rh->impl.back().timestamp) { // Everything explodes if the timestamps in relation_history aren't monotonically increasing. If - // we get a timestamp that's before the most recent timestamp in the buffer, just don't put it + // we get a timestamp that's before the most recent timestamp in the buffer, don't put it // in the history. rh->impl.push_back(rhe); ret = true; @@ -103,7 +103,7 @@ m_relation_history_get(struct m_relation_history *rh, uint64_t at_timestamp_ns, if (it == e) { // lower bound is at the end: // The desired timestamp is after what our buffer contains. - // Aka pose-prediction. + // (pose-prediction) int64_t diff_prediction_ns = static_cast(at_timestamp_ns) - rh->impl.back().timestamp; double delta_s = time_ns_to_s(diff_prediction_ns); @@ -121,7 +121,7 @@ m_relation_history_get(struct m_relation_history *rh, uint64_t at_timestamp_ns, if (it == b) { // lower bound is at the beginning (and it's not an exact match): // The desired timestamp is before what our buffer contains. - // Aka a weird edge case where somebody asks for a really old pose and we do our best. + // (an edge case where somebody asks for a really old pose and we do our best) int64_t diff_prediction_ns = static_cast(at_timestamp_ns) - rh->impl.front().timestamp; double delta_s = time_ns_to_s(diff_prediction_ns); U_LOG_T("Extrapolating %f s before the front of the buffer!", delta_s); @@ -145,7 +145,7 @@ m_relation_history_get(struct m_relation_history *rh, uint64_t at_timestamp_ns, xrt_space_relation result{}; result.relation_flags = (enum xrt_space_relation_flags)(predecessor.relation.relation_flags & successor.relation.relation_flags); - // First-order implementation - just lerp between the before and after + // First-order implementation - lerp between the before and after if (0 != (result.relation_flags & XRT_SPACE_RELATION_POSITION_VALID_BIT)) { result.pose.position = m_vec3_lerp(predecessor.relation.pose.position, successor.relation.pose.position, amount_to_lerp); diff --git a/src/xrt/auxiliary/math/m_space.cpp b/src/xrt/auxiliary/math/m_space.cpp index ee91b7e50..36731f15d 100644 --- a/src/xrt/auxiliary/math/m_space.cpp +++ b/src/xrt/auxiliary/math/m_space.cpp @@ -251,13 +251,13 @@ apply_relation(const struct xrt_space_relation *a, */ int new_flags = 0; - // Make sure to not drop a orientation, even if just one is valid. + // Make sure to not drop a orientation, even if only one is valid. if (af.has_orientation || bf.has_orientation) { new_flags |= XRT_SPACE_RELATION_ORIENTATION_VALID_BIT; } /* - * Make sure to not drop a position, even if just one is valid. + * Make sure to not drop a position, even if only one is valid. * * When position is valid, always set orientation valid to "upgrade" * poses with valid position but invalid orientation to fully valid