Expand test framework and test cases (#685)

* Fix comment

* Ekf wrapper for testing

Add utility function for accessing information in the ekf object

* Add step function for Gps sensor

* Add RangeFinder and Flow to simulated sensors

* Add first fusion logic tests

* Add units to function name

* Use EXPECT_TRUE

* Adding missing qualifiers

* Improve EXPECT_ calls

* Improve naming
This commit is contained in:
kritz
2019-12-17 11:35:45 +01:00
committed by Mathieu Bresciani
parent 6c25ac5731
commit 532c9abd4a
23 changed files with 679 additions and 115 deletions
+2 -3
View File
@@ -344,7 +344,7 @@ void EstimatorInterface::setRangeData(uint64_t time_usec, float data, int8_t qua
}
}
// set optical flow data
// TODO: Change pointer to constant reference
void EstimatorInterface::setOpticalFlowData(uint64_t time_usec, flow_message *flow)
{
if (!_initialised || _flow_buffer_fail) {
@@ -366,7 +366,7 @@ void EstimatorInterface::setOpticalFlowData(uint64_t time_usec, flow_message *fl
if ((time_usec - _time_last_optflow) > _min_obs_interval_us) {
// check if enough integration time and fail if integration time is less than 50%
// of min arrival interval because too much data is being lost
float delta_time = 1e-6f * (float)flow->dt;
float delta_time = 1e-6f * (float)flow->dt; // in seconds
float delta_time_min = 5e-7f * (float)_min_obs_interval_us;
bool delta_time_good = delta_time >= delta_time_min;
@@ -407,7 +407,6 @@ void EstimatorInterface::setOpticalFlowData(uint64_t time_usec, flow_message *fl
optflow_sample_new.gyroXYZ = - flow->gyrodata;
optflow_sample_new.flowRadXY = -flow->flowdata;
// convert integration interval to seconds
optflow_sample_new.dt = delta_time;
_time_last_optflow = time_usec;