|
Formula Student Autonomous Systems
The code for the main driverless system
|
Extended Kalman Filter class. More...
#include <ekf.hpp>

Public Member Functions | |
| ExtendedKalmanFilter (std::shared_ptr< ObservationModel > observation_model, std::shared_ptr< DataAssociationModel > data_association_model) | |
| Extended Kalman Filter constructor declaration. | |
| void | update (std::shared_ptr< common_lib::structures::VehicleState > vehicle_state, std::shared_ptr< std::vector< common_lib::structures::Cone > > track_map) |
| Updates vehicle state and map variables according to the state vector x_vector | |
| void | prediction_step (const MotionUpdate &motion_update, const std::string &sensor_type) |
| Prediction step: | |
| void | correct_with_matched_ids (const std::vector< int > &matched_ids, const std::vector< Eigen::Vector2f > &matched_cone_positions) |
| Correct the state vector with matched cones, 2 vector inputs the first is the id of the cone in the map matched and the second is the position (observed) of the cone. | |
| void | correct_with_matched_ids_full_state (const std::vector< int > &matched_ids, const std::vector< Eigen::Vector2f > &matched_cone_positions) |
| Correct the state vector with matched cones, 2 vector inputs the first is the id of the cone in the map matched and the second is the position (observed) of the cone. | |
| void | augment_state (const std::vector< Eigen::Vector2f > &new_features) |
| Augment the state vector with new features, vector input has the new features. | |
| void | add_motion_model (const std::string &model_name, std::shared_ptr< MotionModel > motion_model) |
| Add a motion model to the motion model map. | |
| void | correction_step (const std::vector< common_lib::structures::Cone > &perception_map) |
| Correction step: | |
| Eigen::VectorXf | get_state () const |
| Get the state vector. | |
| Eigen::MatrixXf | get_covariance () const |
| Get the state covariance matrix. | |
| rclcpp::Time | get_last_update () const |
| Get the last update timestamp. | |
Private Member Functions | |
| Eigen::MatrixXf | get_kalman_gain (const Eigen::MatrixXf &H, const Eigen::MatrixXf &_p_matrix_, const Eigen::MatrixXf &Q) const |
| Flags used to mark first prediction step. | |
Private Attributes | |
| Eigen::VectorXf | _x_vector_ |
| Expected state vector (localization + mapping) | |
| Eigen::MatrixXf | _p_matrix_ = Eigen::MatrixXf::Identity(6, 6) |
| rclcpp::Time | _last_update_ = rclcpp::Clock().now() |
| Timestamp of last update. | |
| std::map< std::string, std::shared_ptr< MotionModel > > | _motion_models_ |
| std::shared_ptr< ObservationModel > | _observation_model_ |
| Observation Model chosen for correction step. | |
| std::shared_ptr< DataAssociationModel > | _data_association_model_ |
| Data Association Model. | |
| bool | _fixed_map = false |
| Flag to indicate if the map is fixed. | |
| bool | _first_prediction_ = true |
Friends | |
| class | PerformanceTest |
Extended Kalman Filter class.
The Extended Kalman Filter (EKF) is a recursive state estimator for nonlinear systems. It is a nonlinear version of the Kalman Filter (KF). This implementation is used to perform state estimation for the localization of the vehicle and the map.
| ExtendedKalmanFilter::ExtendedKalmanFilter | ( | std::shared_ptr< ObservationModel > | observation_model, |
| std::shared_ptr< DataAssociationModel > | data_association_model | ||
| ) |
|
inline |
| void ExtendedKalmanFilter::augment_state | ( | const std::vector< Eigen::Vector2f > & | new_features | ) |
| void ExtendedKalmanFilter::correct_with_matched_ids | ( | const std::vector< int > & | matched_ids, |
| const std::vector< Eigen::Vector2f > & | matched_cone_positions | ||
| ) |
Correct the state vector with matched cones, 2 vector inputs the first is the id of the cone in the map matched and the second is the position (observed) of the cone.
| matched_ids | vector of matched ids |
| matched_cone_positions | vector of matched cone positions |
Definition at line 73 of file ekf.cpp.

| void ExtendedKalmanFilter::correct_with_matched_ids_full_state | ( | const std::vector< int > & | matched_ids, |
| const std::vector< Eigen::Vector2f > & | matched_cone_positions | ||
| ) |
Correct the state vector with matched cones, 2 vector inputs the first is the id of the cone in the map matched and the second is the position (observed) of the cone.
| matched_ids | vector of matched ids |
| matched_cone_positions | vector of matched cone positions |
Definition at line 95 of file ekf.cpp.

| void ExtendedKalmanFilter::correction_step | ( | const std::vector< common_lib::structures::Cone > & | perception_map | ) |
Correction step:
| perception_map | map from perception |
Definition at line 53 of file ekf.cpp.

|
inline |
|
private |
|
inline |
|
inline |
| void ExtendedKalmanFilter::prediction_step | ( | const MotionUpdate & | motion_update, |
| const std::string & | sensor_type | ||
| ) |
| void ExtendedKalmanFilter::update | ( | std::shared_ptr< common_lib::structures::VehicleState > | vehicle_state, |
| std::shared_ptr< std::vector< common_lib::structures::Cone > > | track_map | ||
| ) |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |