ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
VectorKalmanFilter.h
Go to the documentation of this file.
1/**
2 * @file VectorKalmanFilter.h
3 * @brief Implements a Kalman filter for 3D vector smoothing.
4 *
5 * The `VectorKalmanFilter` class applies independent Kalman filters to each component (X, Y, Z)
6 * of a 3D vector to smooth noisy data.
7 *
8 * @date 22/12/2024
9 * @version 1.0
10 * @author Coela Can't
11 */
12
13#pragma once
14
15#include "KalmanFilter.h"
16#include "../Math/Vector3D.h"
17
18/**
19 * @class VectorKalmanFilter
20 * @brief Applies Kalman filtering independently to each component of a 3D vector.
21 *
22 * The `VectorKalmanFilter` class uses three `KalmanFilter` instances to process the
23 * X, Y, and Z components of a `Vector3D`, providing a smooth output for noisy 3D data.
24 *
25 * @tparam T The numeric type used for calculations (e.g., `float` or `double`).
26 */
27template <typename T>
29private:
30 KalmanFilter<T> X; ///< Kalman filter for the X component of the vector.
31 KalmanFilter<T> Y; ///< Kalman filter for the Y component of the vector.
32 KalmanFilter<T> Z; ///< Kalman filter for the Z component of the vector.
33
34public:
35 /**
36 * @brief Constructs a `VectorKalmanFilter` with specified parameters.
37 *
38 * Initializes the Kalman filters for each component with the given process noise,
39 * sensor noise, and error covariance.
40 *
41 * @param processNoise The process noise for the Kalman filter.
42 * @param sensorNoise The sensor noise for the Kalman filter.
43 * @param errorCovariance The initial error covariance for the Kalman filter.
44 */
45 VectorKalmanFilter(T processNoise, T sensorNoise, T errorCovariance);
46
47 /**
48 * @brief Filters a 3D vector input using the Kalman filter.
49 *
50 * Applies Kalman filtering independently to the X, Y, and Z components of the input vector.
51 *
52 * @param input The input `Vector3D` to filter.
53 * @return The filtered `Vector3D`.
54 */
56};
Provides a template-based implementation of a Kalman Filter.
Implements a generic Kalman Filter for 1D data.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
Definition Vector3D.h:26
Applies Kalman filtering independently to each component of a 3D vector.
KalmanFilter< T > Z
Kalman filter for the Z component of the vector.
Vector3D Filter(Vector3D input)
Filters a 3D vector input using the Kalman filter.
KalmanFilter< T > X
Kalman filter for the X component of the vector.
KalmanFilter< T > Y
Kalman filter for the Y component of the vector.