Replace EKF/common.h #defines with enums.

This commit is contained in:
mcsauder
2022-04-21 15:49:50 -06:00
committed by Daniel Agar
parent 8f2c84d36f
commit ea10eacb99
17 changed files with 171 additions and 164 deletions
+7 -7
View File
@@ -129,7 +129,7 @@ void EstimatorInterface::setMagData(const magSample &mag_sample)
}
}
void EstimatorInterface::setGpsData(const gps_message &gps)
void EstimatorInterface::setGpsData(const gpsMessage &gps)
{
if (!_initialised) {
return;
@@ -382,7 +382,7 @@ void EstimatorInterface::setDragData(const imuSample &imu)
{
// down-sample the drag specific force data by accumulating and calculating the mean when
// sufficient samples have been collected
if ((_params.fusion_mode & MASK_USE_DRAG)) {
if ((_params.fusion_mode & SensorFusionMask::USE_DRAG)) {
// Allocate the required buffer size if not previously done
if (_drag_buffer == nullptr) {
@@ -447,24 +447,24 @@ bool EstimatorInterface::initialise_interface(uint64_t timestamp)
}
// mag mode
if (_params.mag_fusion_type != MAG_FUSE_TYPE_NONE) {
if (_params.mag_fusion_type != MagFuseType::NONE) {
max_time_delay_ms = math::max(_params.mag_delay_ms, max_time_delay_ms);
}
// range aid or range height
if (_params.range_aid || (_params.vdist_sensor_type == VDIST_SENSOR_RANGE)) {
if (_params.range_aid || (_params.vdist_sensor_type == VerticalHeightSensor::RANGE)) {
max_time_delay_ms = math::max(_params.range_delay_ms, max_time_delay_ms);
}
if (_params.fusion_mode & MASK_USE_GPS) {
if (_params.fusion_mode & SensorFusionMask::USE_GPS) {
max_time_delay_ms = math::max(_params.gps_delay_ms, max_time_delay_ms);
}
if (_params.fusion_mode & MASK_USE_OF) {
if (_params.fusion_mode & SensorFusionMask::USE_OPT_FLOW) {
max_time_delay_ms = math::max(_params.flow_delay_ms, max_time_delay_ms);
}
if (_params.fusion_mode & (MASK_USE_EVPOS | MASK_USE_EVYAW | MASK_USE_EVVEL)) {
if (_params.fusion_mode & (SensorFusionMask::USE_EXT_VIS_POS | SensorFusionMask::USE_EXT_VIS_YAW | SensorFusionMask::USE_EXT_VIS_VEL)) {
max_time_delay_ms = math::max(_params.ev_delay_ms, max_time_delay_ms);
}