···22// SPDX-License-Identifier: BSL-1.0
33/*!
44 * @file
55- * @brief Header with just documentation.
55+ * @brief Header with only documentation.
66 * @author Ryan Pavlik <ryan.pavlik@collabora.com>
77 * @ingroup aux_math
88 */
+1-1
src/xrt/auxiliary/math/m_filter_fifo.c
···22// SPDX-License-Identifier: BSL-1.0
33/*!
44 * @file
55- * @brief A fifo that also allows you to dynamically filter.
55+ * @brief A fifo that also lets you dynamically filter.
66 * @author Jakob Bornecrantz <jakob@collabora.com>
77 * @ingroup aux_math
88 */
+2-3
src/xrt/auxiliary/math/m_filter_fifo.h
···22// SPDX-License-Identifier: BSL-1.0
33/*!
44 * @file
55- * @brief A fifo that also allows you to dynamically filter.
55+ * @brief A fifo that also lets you dynamically filter.
66 * @author Jakob Bornecrantz <jakob@collabora.com>
77 * @ingroup aux_math
88 */
···9494m_ff_f64_push(struct m_ff_f64 *ff, const double *sample, uint64_t timestamp_ns);
95959696/*!
9797- * Return the sample at the index, zero means the last sample push, one second
9898- * last and so on.
9797+ * Return the sample at the index, 0 means the last sample push, 1 second-to-last, etc.
9998 */
10099bool
101100m_ff_f64_get(struct m_ff_f64 *ff, size_t num, double *out_sample, uint64_t *out_timestamp_ns);
+2-1
src/xrt/auxiliary/math/m_filter_one_euro.c
···197197{
198198199199 if (filter_one_euro_handle_first_sample(&f->base, ts, false)) {
200200- // First sample - no filtering yet - and we're not committing anything to the filter so just return
200200+ // First sample - no filtering yet - and we're not committing anything to the filter so return right
201201+ // away
201202 *out_y = *in_y;
202203 return;
203204 }
+1-1
src/xrt/auxiliary/math/m_imu_pre.h
···5656};
57575858/*!
5959- * A simple init function that just takes the two ticks_to_float values, all
5959+ * A simple init function that takes the two ticks_to_float values, all
6060 * other values are set to identity.
6161 */
6262void
+3-3
src/xrt/auxiliary/math/m_lowpass_float.h
···5151m_lowpass_float_add_sample(struct m_lowpass_float *mlf, float sample, timepoint_ns timestamp_ns);
52525353/*!
5454- * Access the filtered value.
5454+ * Get the filtered value.
5555 *
5656 * Probably 0 or other meaningless value if it's not initialized: see @ref m_lowpass_float_is_initialized
5757 *
···6363m_lowpass_float_get_state(const struct m_lowpass_float *mlf);
64646565/*!
6666- * Access the time of last update
6666+ * Get the time of last update
6767 *
6868 * @param mlf self-pointer
6969 *
···7373m_lowpass_float_get_timestamp_ns(const struct m_lowpass_float *mlf);
74747575/*!
7676- * Access whether we have initialized state.
7676+ * Get whether we have initialized state.
7777 *
7878 * @param mlf self-pointer
7979 *
+6-6
src/xrt/auxiliary/math/m_lowpass_float.hpp
···4545 * blocked.
4646 *
4747 * @param val The value to initialize the filter with. Does not
4848- * affect the filter itself: only seen if you access state
4848+ * affect the filter itself: only seen if you get state
4949 * before initializing the filter with the first sample.
5050 */
5151 explicit LowPassIIR(Scalar cutoff_hz, Value const &val) noexcept
···5353 {}
54545555 /*!
5656- * Reset the filter to just-created state.
5656+ * Reset the filter to newly-created state.
5757 */
5858 void
5959 reset(Value const &val) noexcept
···122122123123124124 /*!
125125- * Reset the filter to just-created state.
125125+ * Reset the filter to newly-created state.
126126 */
127127 void
128128 reset() noexcept
···146146 }
147147148148 /*!
149149- * Access the filtered value.
149149+ * Get the filtered value.
150150 */
151151 Scalar
152152 getState() const noexcept
···155155 }
156156157157 /*!
158158- * Access the time of last update.
158158+ * Get the time of last update.
159159 */
160160 timepoint_ns
161161 getTimestampNs() const noexcept
···164164 }
165165166166 /*!
167167- * Access whether we have initialized state.
167167+ * Get whether we have initialized state.
168168 */
169169 bool
170170 isInitialized() const noexcept
+4-4
src/xrt/auxiliary/math/m_lowpass_float_vector.hpp
···444445454646 /*!
4747- * Reset the filter to just-created state.
4747+ * Reset the filter to newly-created state.
4848 */
4949 void
5050 reset() noexcept
···6868 }
69697070 /*!
7171- * Access the filtered value.
7171+ * Get the filtered value.
7272 */
7373 Vector const &
7474 getState() const noexcept
···7777 }
78787979 /*!
8080- * Access the time of last update.
8080+ * Get the time of last update.
8181 */
8282 std::uint64_t
8383 getTimestampNs() const noexcept
···8686 }
87878888 /*!
8989- * Access whether we have initialized state.
8989+ * Get whether we have initialized state.
9090 */
9191 bool
9292 isInitialized() const noexcept
+2-2
src/xrt/auxiliary/math/m_lowpass_integer.h
···5353m_lowpass_integer_add_sample(struct m_lowpass_integer *mli, int64_t sample);
54545555/*!
5656- * Access the filtered value.
5656+ * Get the filtered value.
5757 *
5858 * Probably 0 or other meaningless value if it's not initialized: see @ref m_lowpass_integer_is_initialized
5959 *
···6565m_lowpass_integer_get_state(const struct m_lowpass_integer *mli);
66666767/*!
6868- * Access whether we have initialized state.
6868+ * Get whether we have initialized state.
6969 *
7070 * @param mli self-pointer
7171 *
+6-6
src/xrt/auxiliary/math/m_lowpass_integer.hpp
···4444 * more influence from new input. @p alpha_.isBetweenZeroAndOne() must be true.
4545 *
4646 * @param val The value to initialize the filter with. Does not
4747- * affect the filter itself: only seen if you access state
4747+ * affect the filter itself: only seen if you get the state
4848 * before initializing the filter with the first sample.
4949 */
5050 explicit IntegerLowPassIIR(math::Rational<Scalar> alpha_, Value const &val)
···5656 }
57575858 /*!
5959- * Reset the filter to just-created state.
5959+ * Reset the filter to newly-created state.
6060 */
6161 void
6262 reset(Value const &val) noexcept
···100100101101/*!
102102 * A very simple integer low-pass filter, using a "one-pole infinite impulse response"
103103- * design (one-pole IIR), aka exponential filter.
103103+ * design (one-pole IIR), also known as an exponential filter.
104104 *
105105 * Configurable in scalar type.
106106 */
···121121 }
122122123123 /*!
124124- * Reset the filter to just-created state.
124124+ * Reset the filter to newly-created state.
125125 */
126126 void
127127 reset() noexcept
···144144 }
145145146146 /*!
147147- * Access the filtered value.
147147+ * Get the filtered value.
148148 */
149149 Scalar
150150 getState() const noexcept
···154154155155156156 /*!
157157- * Access whether we have initialized state.
157157+ * Get whether we have initialized state.
158158 */
159159 bool
160160 isInitialized() const noexcept
+2-2
src/xrt/auxiliary/math/m_quatexpmap.cpp
···8888 return ret.normalized();
8989}
90909191-/// Taylor series expansion of theta over sin(theta), aka cosecant, for
9191+/// Taylor series expansion of theta over sin(theta), also known as cosecant, for
9292/// use near 0 when you want continuity and validity at 0.
9393template <typename Scalar>
9494inline Scalar
···112112{
113113 // ln q = ( (phi)/(norm of vec) vec, ln(norm of quat))
114114 // When we assume a unit quaternion, ln(norm of quat) = 0
115115- // so then we just scale the vector part by phi/sin(phi) to get the
115115+ // so then we scale the vector part by phi/sin(phi) to get the
116116 // result (i.e., ln(qv, qw) = (phi/sin(phi)) * qv )
117117 Scalar vecnorm = quat.vec().norm();
118118
+4-4
src/xrt/auxiliary/math/m_relation_history.cpp
···6868 // if we aren't empty, we can compare against the latest timestamp.
6969 if (rh->impl.empty() || rhe.timestamp > rh->impl.back().timestamp) {
7070 // Everything explodes if the timestamps in relation_history aren't monotonically increasing. If
7171- // we get a timestamp that's before the most recent timestamp in the buffer, just don't put it
7171+ // we get a timestamp that's before the most recent timestamp in the buffer, don't put it
7272 // in the history.
7373 rh->impl.push_back(rhe);
7474 ret = true;
···103103 if (it == e) {
104104 // lower bound is at the end:
105105 // The desired timestamp is after what our buffer contains.
106106- // Aka pose-prediction.
106106+ // (pose-prediction)
107107 int64_t diff_prediction_ns = static_cast<int64_t>(at_timestamp_ns) - rh->impl.back().timestamp;
108108 double delta_s = time_ns_to_s(diff_prediction_ns);
109109···121121 if (it == b) {
122122 // lower bound is at the beginning (and it's not an exact match):
123123 // The desired timestamp is before what our buffer contains.
124124- // Aka a weird edge case where somebody asks for a really old pose and we do our best.
124124+ // (an edge case where somebody asks for a really old pose and we do our best)
125125 int64_t diff_prediction_ns = static_cast<int64_t>(at_timestamp_ns) - rh->impl.front().timestamp;
126126 double delta_s = time_ns_to_s(diff_prediction_ns);
127127 U_LOG_T("Extrapolating %f s before the front of the buffer!", delta_s);
···145145 xrt_space_relation result{};
146146 result.relation_flags = (enum xrt_space_relation_flags)(predecessor.relation.relation_flags &
147147 successor.relation.relation_flags);
148148- // First-order implementation - just lerp between the before and after
148148+ // First-order implementation - lerp between the before and after
149149 if (0 != (result.relation_flags & XRT_SPACE_RELATION_POSITION_VALID_BIT)) {
150150 result.pose.position = m_vec3_lerp(predecessor.relation.pose.position,
151151 successor.relation.pose.position, amount_to_lerp);
+2-2
src/xrt/auxiliary/math/m_space.cpp
···251251 */
252252253253 int new_flags = 0;
254254- // Make sure to not drop a orientation, even if just one is valid.
254254+ // Make sure to not drop a orientation, even if only one is valid.
255255 if (af.has_orientation || bf.has_orientation) {
256256 new_flags |= XRT_SPACE_RELATION_ORIENTATION_VALID_BIT;
257257 }
258258259259 /*
260260- * Make sure to not drop a position, even if just one is valid.
260260+ * Make sure to not drop a position, even if only one is valid.
261261 *
262262 * When position is valid, always set orientation valid to "upgrade"
263263 * poses with valid position but invalid orientation to fully valid