mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 18:37:35 +08:00
lpe: update _sensorTimeout and _sensorFault to handle support of more sensors
This commit is contained in:
@@ -180,14 +180,16 @@ BlockLocalPositionEstimator::BlockLocalPositionEstimator() :
|
||||
|
||||
// print fusion settings to console
|
||||
printf("[lpe] fuse gps: %d, flow: %d, vis_pos: %d, "
|
||||
"vis_yaw: %d, land: %d, pub_agl_z: %d, flow_gyro: %d\n",
|
||||
"vis_yaw: %d, land: %d, pub_agl_z: %d, flow_gyro: %d, "
|
||||
"landing_target %d\n",
|
||||
(_fusion.get() & FUSE_GPS) != 0,
|
||||
(_fusion.get() & FUSE_FLOW) != 0,
|
||||
(_fusion.get() & FUSE_VIS_POS) != 0,
|
||||
(_fusion.get() & FUSE_VIS_YAW) != 0,
|
||||
(_fusion.get() & FUSE_LAND) != 0,
|
||||
(_fusion.get() & FUSE_PUB_AGL_Z) != 0,
|
||||
(_fusion.get() & FUSE_FLOW_GYRO_COMP) != 0);
|
||||
(_fusion.get() & FUSE_FLOW_GYRO_COMP) != 0,
|
||||
(_fusion.get() & FUSE_LAND_TARGET) != 0);
|
||||
}
|
||||
|
||||
BlockLocalPositionEstimator::~BlockLocalPositionEstimator()
|
||||
@@ -335,6 +337,7 @@ void BlockLocalPositionEstimator::update()
|
||||
|| !(_sensorTimeout & SENSOR_VISION)
|
||||
|| !(_sensorTimeout & SENSOR_MOCAP)
|
||||
|| !(_sensorTimeout & SENSOR_LAND)
|
||||
|| !(_sensorTimeout & SENSOR_LAND_TARGET)
|
||||
) {
|
||||
_estimatorInitialized |= EST_XY;
|
||||
}
|
||||
|
||||
@@ -122,6 +122,7 @@ public:
|
||||
FUSE_PUB_AGL_Z = 1 << 5,
|
||||
FUSE_FLOW_GYRO_COMP = 1 << 6,
|
||||
FUSE_BARO = 1 << 7,
|
||||
FUSE_LAND_TARGET = 1 << 8
|
||||
};
|
||||
|
||||
enum sensor_t {
|
||||
@@ -133,6 +134,7 @@ public:
|
||||
SENSOR_VISION = 1 << 5,
|
||||
SENSOR_MOCAP = 1 << 6,
|
||||
SENSOR_LAND = 1 << 7,
|
||||
SENSOR_LAND_TARGET = 1 << 8,
|
||||
};
|
||||
|
||||
enum estimate_t {
|
||||
@@ -369,8 +371,8 @@ private:
|
||||
bool _lastArmedState;
|
||||
|
||||
// masks
|
||||
uint8_t _sensorTimeout;
|
||||
uint8_t _sensorFault;
|
||||
uint16_t _sensorTimeout;
|
||||
uint16_t _sensorFault;
|
||||
uint8_t _estimatorInitialized;
|
||||
|
||||
// state space
|
||||
|
||||
Reference in New Issue
Block a user