Skip to content

Commit 08a061e

Browse files
[eigen] rename organize eigen file and documentation (#66)
1 parent 1a1cbbf commit 08a061e

File tree

4 files changed

+111
-4
lines changed

4 files changed

+111
-4
lines changed

include/fcarouge/internal/kalman_eigen.hpp include/fcarouge/internal/eigen.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ OTHER DEALINGS IN THE SOFTWARE.
3636
3737
For more information, please refer to <https://unlicense.org> */
3838

39-
#ifndef FCAROUGE_INTERNAL_KALMAN_EIGEN_HPP
40-
#define FCAROUGE_INTERNAL_KALMAN_EIGEN_HPP
39+
#ifndef FCAROUGE_INTERNAL_EIGEN_HPP
40+
#define FCAROUGE_INTERNAL_EIGEN_HPP
4141

4242
//! @file
4343
//! @brief Kalman operation for Eigen 3 types.
@@ -255,4 +255,4 @@ using kalman = fcarouge::kalman<
255255

256256
} // namespace fcarouge::eigen::internal
257257

258-
#endif // FCAROUGE_INTERNAL_KALMAN_EIGEN_HPP
258+
#endif // FCAROUGE_INTERNAL_EIGEN_HPP

include/fcarouge/internal/format.hpp

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*_ __ _ __ __ _ _
2+
| |/ / /\ | | | \/ | /\ | \ | |
3+
| ' / / \ | | | \ / | / \ | \| |
4+
| < / /\ \ | | | |\/| | / /\ \ | . ` |
5+
| . \ / ____ \| |____| | | |/ ____ \| |\ |
6+
|_|\_\/_/ \_\______|_| |_/_/ \_\_| \_|
7+
8+
Kalman Filter for C++
9+
Version 0.1.0
10+
https://github.com/FrancoisCarouge/Kalman
11+
12+
SPDX-License-Identifier: Unlicense
13+
14+
This is free and unencumbered software released into the public domain.
15+
16+
Anyone is free to copy, modify, publish, use, compile, sell, or
17+
distribute this software, either in source code form or as a compiled
18+
binary, for any purpose, commercial or non-commercial, and by any
19+
means.
20+
21+
In jurisdictions that recognize copyright laws, the author or authors
22+
of this software dedicate any and all copyright interest in the
23+
software to the public domain. We make this dedication for the benefit
24+
of the public at large and to the detriment of our heirs and
25+
successors. We intend this dedication to be an overt act of
26+
relinquishment in perpetuity of all present and future rights to this
27+
software under copyright law.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
30+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
32+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
33+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
34+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
35+
OTHER DEALINGS IN THE SOFTWARE.
36+
37+
For more information, please refer to <https://unlicense.org> */
38+
39+
#ifndef FCAROUGE_INTERNAL_FORMAT_HPP
40+
#define FCAROUGE_INTERNAL_FORMAT_HPP
41+
42+
#endif // FCAROUGE_INTERNAL_FORMAT_HPP

include/fcarouge/kalman.hpp

+65
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ For more information, please refer to <https://unlicense.org> */
4242
//! @file
4343
//! @brief The main Kalman filter class.
4444

45+
#include "internal/format.hpp"
4546
#include "internal/kalman.hpp"
4647

4748
#include <concepts>
@@ -602,6 +603,11 @@ class kalman<Type, State, Output, Input, Transpose, Symmetrize, Divide,
602603

603604
//! @brief Sets the state transition matrix F function.
604605
//!
606+
//! @details For non-linear system, or extended filter, F is the Jacobian of
607+
//! the state transition function: `F = ∂f/∂X = ∂fj/∂xi` that is each row i
608+
//! contains the derivatives of the state transition function for every
609+
//! element j in the state vector X.
610+
//!
605611
//! @param callable The copied target Callable object (function object,
606612
//! pointer to function, reference to function, pointer to member function, or
607613
//! pointer to data member) that will be bound to the prediction arguments and
@@ -619,6 +625,11 @@ class kalman<Type, State, Output, Input, Transpose, Symmetrize, Divide,
619625

620626
//! @brief Sets the state transition matrix F function.
621627
//!
628+
//! @details For non-linear system, or extended filter, F is the Jacobian of
629+
//! the state transition function: `F = ∂f/∂X = ∂fj/∂xi` that is each row i
630+
//! contains the derivatives of the state transition function for every
631+
//! element j in the state vector X.
632+
//!
622633
//! @param callable The moved target Callable object (function object,
623634
//! pointer to function, reference to function, pointer to member function, or
624635
//! pointer to data member) that will be bound to the prediction arguments and
@@ -679,6 +690,11 @@ class kalman<Type, State, Output, Input, Transpose, Symmetrize, Divide,
679690

680691
//! @brief Sets the observation, measurement transition matrix H function.
681692
//!
693+
//! @details For non-linear system, or extended filter, H is the Jacobian of
694+
//! the state observation function: `H = ∂h/∂X = ∂hj/∂xi` that is each row i
695+
//! contains the derivatives of the state observation function for every
696+
//! element j in the state vector X.
697+
//!
682698
//! @param callable The copied target Callable object (function object,
683699
//! pointer to function, reference to function, pointer to member function, or
684700
//! pointer to data member) that will be bound to the prediction arguments and
@@ -698,6 +714,11 @@ class kalman<Type, State, Output, Input, Transpose, Symmetrize, Divide,
698714

699715
//! @brief Sets the observation, measurement transition matrix H function.
700716
//!
717+
//! @details For non-linear system, or extended filter, H is the Jacobian of
718+
//! the state observation function: `H = ∂h/∂X = ∂hj/∂xi` that is each row i
719+
//! contains the derivatives of the state observation function for every
720+
//! element j in the state vector X.
721+
//!
701722
//! @param callable The moved target Callable object (function object,
702723
//! pointer to function, reference to function, pointer to member function, or
703724
//! pointer to data member) that will be bound to the prediction arguments and
@@ -817,6 +838,17 @@ class kalman<Type, State, Output, Input, Transpose, Symmetrize, Divide,
817838
"discarded.")]] inline constexpr auto
818839
s() const -> innovation_uncertainty;
819840

841+
//! @brief Sets the extended state transition function f(x).
842+
//!
843+
//! @param callable The copied target Callable object (function object,
844+
//! pointer to function, reference to function, pointer to member function, or
845+
//! pointer to data member) that will be called to compute the next state X on
846+
//! prediction steps. The default function `f(x) = F * X` is suitable for
847+
//! linear systems. For non-linear system, or extended filter, implement a
848+
//! linearization of the transition function f and the state transition F
849+
//! matrix is the Jacobian of the state transition function.
850+
//!
851+
//! @complexity Constant.
820852
inline constexpr void
821853
transition(const auto &callable) requires std::is_invocable_r_v < state,
822854
std::decay_t<decltype(callable)>,
@@ -825,6 +857,17 @@ class kalman<Type, State, Output, Input, Transpose, Symmetrize, Divide,
825857
filter.transition = callable;
826858
}
827859

860+
//! @brief Sets the extended state transition function f(x).
861+
//!
862+
//! @param callable The moved target Callable object (function object,
863+
//! pointer to function, reference to function, pointer to member function, or
864+
//! pointer to data member) that will be called to compute the next state X on
865+
//! prediction steps. The default function `f(x) = F * X` is suitable for
866+
//! linear systems. For non-linear system, or extended filter, implement a
867+
//! linearization of the transition function f and the state transition F
868+
//! matrix is the Jacobian of the state transition function.
869+
//!
870+
//! @complexity Constant.
828871
inline constexpr void
829872
transition(auto &&callable) requires std::is_invocable_r_v < state,
830873
std::decay_t<decltype(callable)>,
@@ -833,6 +876,17 @@ class kalman<Type, State, Output, Input, Transpose, Symmetrize, Divide,
833876
filter.transition = std::forward<decltype(callable)>(callable);
834877
}
835878

879+
//! @brief Sets the extended state observation function h(x).
880+
//!
881+
//! @param callable The copied target Callable object (function object,
882+
//! pointer to function, reference to function, pointer to member function, or
883+
//! pointer to data member) that will be called to compute the observation Z
884+
//! on update steps. The default function `h(x) = H * X` is suitable for
885+
//! linear systems. For non-linear system, or extended filter, the client
886+
//! implements a linearization of the observation function hand the state
887+
//! observation H matrix is the Jacobian of the state observation function.
888+
//!
889+
//! @complexity Constant.
836890
inline constexpr void
837891
observation(const auto &callable) requires std::is_invocable_r_v < output,
838892
std::decay_t<decltype(callable)>,
@@ -841,6 +895,17 @@ class kalman<Type, State, Output, Input, Transpose, Symmetrize, Divide,
841895
filter.observation = callable;
842896
}
843897

898+
//! @brief Sets the extended state observation function h(x).
899+
//!
900+
//! @param callable The moved target Callable object (function object,
901+
//! pointer to function, reference to function, pointer to member function, or
902+
//! pointer to data member) that will be called to compute the observation Z
903+
//! on update steps. The default function `h(x) = H * X` is suitable for
904+
//! linear systems. For non-linear system, or extended filter, the client
905+
//! implements a linearization of the observation function hand the state
906+
//! observation H matrix is the Jacobian of the state observation function.
907+
//!
908+
//! @complexity Constant.
844909
inline constexpr void
845910
observation(auto &&callable) requires std::is_invocable_r_v < output,
846911
std::decay_t<decltype(callable)>,

include/fcarouge/kalman_eigen.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ For more information, please refer to <https://unlicense.org> */
4242
//! @file
4343
//! @brief Kalman operation for Eigen 3 types.
4444

45-
#include "internal/kalman_eigen.hpp"
45+
#include "internal/eigen.hpp"
4646

4747
#include <cstddef>
4848
#include <tuple>

0 commit comments

Comments
 (0)