mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 16:03:34 +08:00
move vehicle at rest detection ekf2 -> land_detector
- move vehicle at reset detection ekf2 -> land_detector - ekf_unit: reduce init period - Fake fusion is when at rest is quite strong and makes the variance reduce rapidly. Reduce the amount of time we wait before checking if the variances are still large enough. - ekf_unit: reduce minimum vel/pos variance required after init - Fake pos fusion has a low observation noise, making the vel/pos variances reduce quickly. Co-authored-by:: bresch <brescianimathieu@gmail.com>
This commit is contained in:
@@ -55,6 +55,11 @@ public:
|
||||
void setAccelData(const Vector3f &accel);
|
||||
void setGyroData(const Vector3f &gyro);
|
||||
|
||||
bool moving()
|
||||
{
|
||||
return ((fabsf(_accel_data.norm() - CONSTANTS_ONE_G) > 0.01f) || (_gyro_data.norm() > 0.01f));
|
||||
}
|
||||
|
||||
private:
|
||||
Vector3f _accel_data;
|
||||
Vector3f _gyro_data;
|
||||
|
||||
@@ -154,6 +154,7 @@ void SensorSimulator::runMicroseconds(uint32_t duration)
|
||||
|
||||
if (update_imu) {
|
||||
// Update at IMU rate
|
||||
_ekf->set_vehicle_at_rest(!_imu.moving());
|
||||
_ekf->update();
|
||||
}
|
||||
}
|
||||
@@ -193,6 +194,7 @@ void SensorSimulator::runReplayMicroseconds(uint32_t duration)
|
||||
updateSensors();
|
||||
|
||||
if (update_imu) {
|
||||
_ekf->set_vehicle_at_rest(!_imu.moving());
|
||||
_ekf->update();
|
||||
}
|
||||
}
|
||||
@@ -316,6 +318,7 @@ void SensorSimulator::runTrajectoryMicroseconds(uint32_t duration)
|
||||
updateSensors();
|
||||
|
||||
if (update_imu) {
|
||||
_ekf->set_vehicle_at_rest(!_imu.moving());
|
||||
_ekf->update();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user