ekf.hpp
Go to the documentation of this file.
1 /*********************************************************************
2 * Copyright (c) 2017 Robert Bosch GmbH.
3 * All rights reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 * *********************************************************************/
17 
18 #ifndef EKF_HPP
19 #define EKF_HPP
20 
21 #include <Eigen/Dense>
22 
24 
25 namespace steering
26 {
27 
28 typedef Eigen::Matrix<double, 2, 2> Matrix2d;
29 typedef Eigen::Matrix<double, 3, 3> Matrix3d;
30 typedef Eigen::Matrix<double, 3, 2> Matrix32d;
31 typedef Eigen::Matrix<double, 2, 3> Matrix23d;
32 
33 class EKF
34 {
35 public:
37  EKF();
38 
40  void set_parameters(const Motion_Noise &motion_noise, const Measurement_Noise &measurement_noise,
41  const Controller &_controller);
42 
44  Matrix3d covariance_to_eigen(const double covariance[16]) const;
45 
47  void eigen_to_covariance(const Matrix3d &covariance_eigen, double covariance[16]) const;
48 
50  void get_motion_jacobi(const State &state, const Control &control, double integration_step, Matrix3d &F_x,
51  Matrix32d &F_u) const;
52 
55 
57  Matrix2d get_motion_covariance(const State &state, const Control &control, double integration_step) const;
58 
61 
63  Matrix23d get_controller_gain(const Control &control) const;
64 
66  Matrix3d get_rotation_matrix(double angle) const;
67 
70  void predict(const State_With_Covariance &state, const Control &control, double integration_step,
71  State_With_Covariance &state_pred) const;
72 
74  void update(const State_With_Covariance &state_pred, State_With_Covariance &state_corr) const;
75 
78 
79 private:
82 
85 
88 
90  Matrix3d I_;
91 };
92 
93 } // namespace steering
94 
95 #endif
steering::EKF::get_motion_jacobi
void get_motion_jacobi(const State &state, const Control &control, double integration_step, Matrix3d &F_x, Matrix32d &F_u) const
Computes the Jacobians of the motion equations with respect to the state and control.
Definition: ekf.cpp:78
steering::EKF::measurement_noise_
Measurement_Noise measurement_noise_
Measurement noise.
Definition: ekf.hpp:99
steering::EKF::EKF
EKF()
Definition: ekf.cpp:41
steering::State
Description of a kinematic car's state.
Definition: steering_functions.hpp:44
steering::Matrix32d
Eigen::Matrix< double, 3, 2 > Matrix32d
Definition: ekf.hpp:45
steering::EKF::covariance_to_eigen
Matrix3d covariance_to_eigen(const double covariance[16]) const
Converts a covariance given by a double array to an Eigen matrix.
Definition: ekf.cpp:54
steering::EKF::get_observation_jacobi
Matrix3d get_observation_jacobi() const
Computes the Jacobian of the observation equations with respect to the state.
Definition: ekf.cpp:181
steering::EKF::I_
Matrix3d I_
Identity matrix.
Definition: ekf.hpp:105
steering::EKF::get_motion_covariance
Matrix2d get_motion_covariance(const State &state, const Control &control, double integration_step) const
Returns the motion covariance in control space.
Definition: ekf.cpp:186
steering::Matrix3d
Eigen::Matrix< double, 3, 3 > Matrix3d
Definition: ekf.hpp:44
steering::Control
Description of a path segment with its corresponding control inputs.
Definition: steering_functions.hpp:82
steering::EKF::update
void update(const State_With_Covariance &state_pred, State_With_Covariance &state_corr) const
Predicts the covariances.
Definition: ekf.cpp:251
steering::EKF::set_parameters
void set_parameters(const Motion_Noise &motion_noise, const Measurement_Noise &measurement_noise, const Controller &_controller)
Sets the parameters required by the EKF.
Definition: ekf.cpp:46
steering::EKF::motion_noise_
Motion_Noise motion_noise_
Motion noise.
Definition: ekf.hpp:96
steering::Motion_Noise
Parameters of the motion noise model according to the book: Probabilistic Robotics,...
Definition: steering_functions.hpp:96
steering::EKF::get_controller_gain
Matrix23d get_controller_gain(const Control &control) const
Returns the gain of the controller.
Definition: ekf.cpp:205
steering::EKF::controller_
Controller controller_
Feedback controller.
Definition: ekf.hpp:102
steering::EKF::predict
void predict(const State_With_Covariance &state, const Control &control, double integration_step, State_With_Covariance &state_pred) const
Predicts the covariances based on the paper: Rapidly-exploring random belief trees for motion plannin...
Definition: ekf.cpp:227
steering::EKF::get_rotation_matrix
Matrix3d get_rotation_matrix(double angle) const
Returns the rotation matrix from a global frame to a local frame.
Definition: ekf.cpp:214
steering::EKF::eigen_to_covariance
void eigen_to_covariance(const Matrix3d &covariance_eigen, double covariance[16]) const
Converts a covariance given by an Eigen matrix to a double array.
Definition: ekf.cpp:67
steering_functions.hpp
steering::State_With_Covariance
Description of a kinematic car's state with covariance.
Definition: steering_functions.hpp:63
steering::Controller
Parameters of the feedback controller.
Definition: steering_functions.hpp:121
steering
Definition: dubins_state_space.hpp:70
steering::EKF::EIGEN_MAKE_ALIGNED_OPERATOR_NEW
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Overload operator new for fixed-size vectorizable Eigen member variable.
Definition: ekf.hpp:92
steering::Matrix2d
Eigen::Matrix< double, 2, 2 > Matrix2d
Definition: ekf.hpp:43
steering::EKF::get_observation_covariance
Matrix3d get_observation_covariance() const
Returns the observation covariance.
Definition: ekf.cpp:196
steering::Measurement_Noise
Parameters of the measurement noise.
Definition: steering_functions.hpp:108
steering::Matrix23d
Eigen::Matrix< double, 2, 3 > Matrix23d
Definition: ekf.hpp:46


steering_functions
Author(s): Holger Banzhaf
autogenerated on Mon Dec 11 2023 03:27:43