Skip to content

Commit

Permalink
[documentation] alphanumeric sorting of modifier operation (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoisCarouge committed Sep 11, 2023
1 parent 872b306 commit 84e8293
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions include/fcarouge/internal/kalman.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,10 @@ struct kalman<State, Output, void, pack<UpdateTypes...>,
//! cases?
//! @todo Do we want to pass z to `observation()`? What are the use cases?
//! @todo Use operator `+=` for the state update?
template <typename Output0, typename... OutputN>
inline constexpr void update(const UpdateTypes &...update_pack,
const Output0 &output_z,
const OutputN &...outputs_z) {
const auto &...output_pack_z) {
update_arguments = {update_pack...};
z = output{output_z, outputs_z...};
z = output{output_pack_z...};
h = observation_state_h(x, update_pack...);
r = noise_observation_r(x, z, update_pack...);
s = innovation_uncertainty{h * p * t(h) + r};
Expand Down Expand Up @@ -257,12 +255,10 @@ struct kalman<State, Output, Input, pack<UpdateTypes...>,
//! @todo Do we want to pass z to `observation_state_h()`? What are the use
//! cases?
//! @todo Do we want to pass z to `observation()`? What are the use cases?
template <typename Output0, typename... OutputN>
inline constexpr void update(const UpdateTypes &...update_pack,
const Output0 &output_z,
const OutputN &...outputs_z) {
const auto &...output_pack_z) {
update_arguments = {update_pack...};
z = output{output_z, outputs_z...};
z = output{output_pack_z...};
h = observation_state_h(x, update_pack...);
r = noise_observation_r(x, z, update_pack...);
s = h * p * t(h) + r;
Expand All @@ -280,18 +276,30 @@ struct kalman<State, Output, Input, pack<UpdateTypes...>,
//! @todo Do we want to pass u to `noise_process_q()`? What are the use cases?
//! @todo Do we want to pass x, u to `transition_control_g()`? What are the
//! use cases?
template <typename Input0, typename... InputN>
inline constexpr void predict(const PredictionTypes &...prediction_pack,
const Input0 &input_u,
const InputN &...inputs_u) {
const auto &...input_pack_u)
requires(sizeof...(PredictionTypes) > 0)
{
prediction_arguments = {prediction_pack...};
u = input{input_u, inputs_u...};
u = input{input_pack_u...};
f = transition_state_f(x, u, prediction_pack...);
q = noise_process_q(x, prediction_pack...);
g = transition_control_g(prediction_pack...);
x = transition(x, u, prediction_pack...);
p = estimate_uncertainty{f * p * t(f) + q};
}

//! @todo Collapse the two predict implementations when MSVC supports it.
inline constexpr void predict(const auto &...input_pack_u)
requires(sizeof...(PredictionTypes) == 0)
{
u = input{input_pack_u...};
f = transition_state_f(x, u);
q = noise_process_q(x);
g = transition_control_g();
x = transition(x, u);
p = estimate_uncertainty{f * p * t(f) + q};
}
};
} // namespace fcarouge::internal

Expand Down

0 comments on commit 84e8293

Please sign in to comment.