EKF: Add interfaces and variables to use ext vision data

This commit is contained in:
Paul Riseborough
2016-05-14 21:17:29 +10:00
parent 172f4be594
commit 3a0fcd03d7
3 changed files with 55 additions and 0 deletions
+21
View File
@@ -71,6 +71,13 @@ struct flow_message {
uint32_t dt; // integration time of flow samples
};
struct ext_vision_message {
Vector3f posNED; // measured NED position relative to the local origin (m)
Quaternion quat; // measured quaternion orientation defining rotation from NED to body frame
float posErr; // 1-Sigma spherical position accuracy (m)
float angErr; // 1-Sigma angular error (rad)
};
struct outputSample {
Quaternion quat_nominal; // nominal quaternion describing vehicle attitude
Vector3f vel; // NED velocity estimate in earth frame in m/s
@@ -126,6 +133,14 @@ struct flowSample {
uint64_t time_us; // timestamp in microseconds of the integration period mid-point
};
struct extVisionSample {
Vector3f posNED; // measured NED position relative to the local origin (m)
Quaternion quat; // measured quaternion orientation defining rotation from NED to body frame
float posErr; // 1-Sigma spherical position accuracy (m)
float angErr; // 1-Sigma angular error (rad)
uint64_t time_us; // timestamp of the measurement in microseconds
};
// Integer definitions for vdist_sensor_type
#define VDIST_SENSOR_BARO 0 // Use baro height
#define VDIST_SENSOR_GPS 1 // Use GPS height
@@ -140,6 +155,8 @@ struct flowSample {
#define MASK_USE_GPS (1<<0) // set to true to use GPS data
#define MASK_USE_OF (1<<1) // set to true to use optical flow data
#define MASK_INHIBIT_ACC_BIAS (1<<2) // set to true to inhibit estimation of accelerometer delta velocity bias
#define MASK_USE_EVPOS (1<<3) // set to true to use external vision NED position data
#define MASK_USE_EVYAW (1<<4) // set to true to use exernal vision quaternion data for yaw
// Integer definitions for mag_fusion_type
#define MAG_FUSE_TYPE_AUTO 0 // The selection of either heading or 3D magnetometer fusion will be automatic
@@ -163,6 +180,7 @@ struct parameters {
float airspeed_delay_ms; // airspeed measurement delay relative to the IMU (msec)
float flow_delay_ms; // optical flow measurement delay relative to the IMU (msec) - this is to the middle of the optical flow integration interval
float range_delay_ms; // range finder measurement delay relative to the IMU (msec)
float ev_delay_ms; // off-board vision measurement delay relative to the IMU (msec)
// input noise
float gyro_noise; // IMU angular rate noise used for covariance prediction (rad/sec)
@@ -247,6 +265,7 @@ struct parameters {
airspeed_delay_ms = 200.0f;
flow_delay_ms = 5.0f;
range_delay_ms = 5.0f;
ev_delay_ms = 100.0f;
// input noise
gyro_noise = 1.5e-2f;
@@ -383,6 +402,8 @@ union filter_control_status_u {
uint16_t baro_hgt : 1; // 9 - true when baro height is being fused as a primary height reference
uint16_t rng_hgt : 1; // 10 - true when range finder height is being fused as a primary height reference
uint16_t gps_hgt : 1; // 11 - true when range finder height is being fused as a primary height reference
uint16_t ev_pos : 1; // 12 - true when local position data from external vision is being fused
uint16_t ev_yaw : 1; // 13 - true when yaw data from external vision measurements is being fused
} flags;
uint16_t value;
};