![]() |
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the source code of this file.
Data Structures | |
struct | EKFRange |
EKF_range structure. More... | |
Macros | |
#define | EKF_RANGE_DIM 6 |
Functions | |
void | ekf_range_init (struct EKFRange *ekf_range, float P0_pos, float P0_speed, float Q_sigma2, float R_dist, float R_speed, float dt) |
Init EKF_range internal struct. | |
void | ekf_range_set_state (struct EKFRange *ekf_range, struct EnuCoor_f pos, struct EnuCoor_f speed) |
Set initial state vector. | |
void | ekf_range_get_state (struct EKFRange *ekf_range, struct EnuCoor_f *pos, struct EnuCoor_f *speed) |
Get current state. | |
struct EnuCoor_f | ekf_range_get_pos (struct EKFRange *ekf_range) |
Get current pos. | |
struct EnuCoor_f | ekf_range_get_speed (struct EKFRange *ekf_range) |
Get current speed. | |
void | ekf_range_update_noise (struct EKFRange *ekf_range, float Q_sigma2, float R_dist, float R_speed) |
Update process and measurement noises. | |
void | ekf_range_predict (struct EKFRange *ekf_range) |
Prediction step. | |
void | ekf_range_update_dist (struct EKFRange *ekf_range, float dist, struct EnuCoor_f anchor) |
Update step based on each new distance data. | |
void | ekf_range_update_speed (struct EKFRange *ekf_range, float speed, uint8_t type) |
Update step based on speed measure. | |
Definition in file ekf_range.h.
struct EKFRange |
EKF_range structure.
state vector: X = [ x xd y yd z zd ]' command vector: U = 0 (constant velocity model) dynamic model: basic kinematic model x_k+1 = x_k + xd_k * dt measures: distance between (fixed and known) anchors and UAV
Definition at line 43 of file ekf_range.h.
Data Fields | ||
---|---|---|
float | dt | prediction step (in seconds) |
float | P[EKF_RANGE_DIM][EKF_RANGE_DIM] | covariance matrix |
float | Q[EKF_RANGE_DIM][EKF_RANGE_DIM] | process noise matrix |
float | R_dist | measurement noise on distances (assumed the same for all anchors) |
float | R_speed | measurement noise on speed (assumed the same for all axis) |
float | state[EKF_RANGE_DIM] | state vector |
#define EKF_RANGE_DIM 6 |
Definition at line 33 of file ekf_range.h.
Get current pos.
[in] | ekf_range | EKFRange structure |
Definition at line 75 of file ekf_range.c.
References EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.
Referenced by check_and_compute_data(), and dw1000_arduino_periodic().
Get current speed.
[in] | ekf_range | EKFRange structure |
Definition at line 84 of file ekf_range.c.
References EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.
Referenced by check_and_compute_data(), and dw1000_arduino_periodic().
|
extern |
Get current state.
[in] | ekf_range | EKFRange structure |
[out] | pos | current position |
[out] | speed | current speed |
Definition at line 65 of file ekf_range.c.
References EKFRange::state, EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.
|
extern |
Init EKF_range internal struct.
[in] | ekf_range | EKFRange structure |
[in] | P0_pos | initial covariance on position |
[in] | P0_speed | initial covariance on speed |
[in] | Q_sigma2 | process noise |
[in] | R_dist | measurement noise on distance |
[in] | R_speed | measurement noise on speed |
[in] | dt | prediction time step in seconds |
Definition at line 29 of file ekf_range.c.
References EKFRange::dt, EKF_RANGE_DIM, foo, EKFRange::P, EKFRange::Q, EKFRange::R_dist, EKFRange::R_speed, and EKFRange::state.
Referenced by dw1000_arduino_init().
Prediction step.
[in] | ekf_range | EKFRange structure |
Prediction step.
F = [ 1 dt 0 0 0 0 0 1 0 0 0 0 0 0 1 dt 0 0 0 0 0 1 0 0 0 0 0 0 1 dt 0 0 0 0 0 1 ]
Definition at line 119 of file ekf_range.c.
References EKFRange::dt, EKF_RANGE_DIM, foo, EKFRange::P, EKFRange::Q, and EKFRange::state.
Referenced by dw1000_arduino_periodic().
|
extern |
Set initial state vector.
This function should be called after initialization of the ekf struct and before running the filter for better results and faster convergence
[in] | ekf_range | EKFRange structure |
[in] | pos | initial position |
[in] | speed | initial speed |
Definition at line 55 of file ekf_range.c.
References EKFRange::state, EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.
Referenced by check_and_compute_data().
|
extern |
Update step based on each new distance data.
[in] | ekf_range | EKFRange structure |
[in] | dist | new distance measurement |
[in] | anchor | position of the anchor from which the distance is measured |
Update step based on each new distance data.
K = PHt(HPHt+R)^1 X = X + K(z-h(X)) P = (I-KH)P
Definition at line 143 of file ekf_range.c.
References foo, K, EKFRange::P, EKFRange::R_dist, and EKFRange::state.
Referenced by check_and_compute_data().
|
extern |
Update process and measurement noises.
[in] | ekf_range | EKFRange structure |
[in] | Q_sigma2 | process noise |
[in] | R_dist | measurement noise on distance |
[in] | R_speed | measurement noise on speed |
Definition at line 93 of file ekf_range.c.
References EKFRange::dt, EKF_RANGE_DIM, foo, EKFRange::Q, EKFRange::R_dist, and EKFRange::R_speed.
Referenced by dw1000_arduino_update_ekf_q(), dw1000_arduino_update_ekf_r_dist(), and dw1000_arduino_update_ekf_r_speed().
Update step based on speed measure.
[in] | ekf_range | EKFRange structure |
[in] | speed | new speed measurement |
[in] | type | 1: horizontal ground speed norm, 2: vertical ground speed norm, 3: 3D ground speed norm |
Definition at line 191 of file ekf_range.c.
References foo.