mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 07:23:33 +08:00
ekf2_test: add test case for accel clipping handling
This commit is contained in:
@@ -22,6 +22,9 @@ void Imu::send(uint64_t time)
|
||||
imu_sample.delta_ang = _gyro_data * imu_sample.delta_ang_dt;
|
||||
imu_sample.delta_vel_dt = dt;
|
||||
imu_sample.delta_vel = _accel_data * imu_sample.delta_vel_dt;
|
||||
imu_sample.delta_vel_clipping[0] = _is_accel_clipping[0];
|
||||
imu_sample.delta_vel_clipping[1] = _is_accel_clipping[1];
|
||||
imu_sample.delta_vel_clipping[2] = _is_accel_clipping[2];
|
||||
|
||||
_ekf->setIMUData(imu_sample);
|
||||
}
|
||||
@@ -42,5 +45,12 @@ void Imu::setGyroData(const Vector3f &gyro)
|
||||
_gyro_data = gyro;
|
||||
}
|
||||
|
||||
void Imu::setAccelClipping(bool x, bool y, bool z)
|
||||
{
|
||||
_is_accel_clipping[0] = x;
|
||||
_is_accel_clipping[1] = y;
|
||||
_is_accel_clipping[2] = z;
|
||||
}
|
||||
|
||||
} // namespace sensor
|
||||
} // namespace sensor_simulator
|
||||
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
void setData(const Vector3f &accel, const Vector3f &gyro);
|
||||
void setAccelData(const Vector3f &accel);
|
||||
void setGyroData(const Vector3f &gyro);
|
||||
void setAccelClipping(bool x, bool y, bool z);
|
||||
|
||||
bool moving()
|
||||
{
|
||||
@@ -63,6 +64,7 @@ public:
|
||||
private:
|
||||
Vector3f _accel_data;
|
||||
Vector3f _gyro_data;
|
||||
bool _is_accel_clipping[3] {};
|
||||
|
||||
void send(uint64_t time) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user