mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 14:51:37 +08:00
EKF: ImuDownSampler pass imuSample as const reference
- inline ImuDownSampler::getDownSampledImuAndTriggerReset() - minor formatting and initialization cleanup
This commit is contained in:
+14
-10
@@ -46,18 +46,22 @@ using namespace estimator;
|
||||
|
||||
class ImuDownSampler {
|
||||
public:
|
||||
ImuDownSampler(float target_dt_sec);
|
||||
~ImuDownSampler();
|
||||
explicit ImuDownSampler(float target_dt_sec);
|
||||
~ImuDownSampler() = default;
|
||||
|
||||
bool update(imuSample imu_sample_new);
|
||||
imuSample getDownSampledImuAndTriggerReset();
|
||||
bool update(const imuSample &imu_sample_new);
|
||||
|
||||
imuSample getDownSampledImuAndTriggerReset() {
|
||||
_do_reset = true;
|
||||
return _imu_down_sampled;
|
||||
}
|
||||
|
||||
private:
|
||||
imuSample _imu_down_sampled;
|
||||
Quatf _delta_angle_accumulated;
|
||||
const float _target_dt; // [sec]
|
||||
float _imu_collection_time_adj;
|
||||
bool _do_reset;
|
||||
|
||||
void reset();
|
||||
|
||||
imuSample _imu_down_sampled{};
|
||||
Quatf _delta_angle_accumulated{};
|
||||
const float _target_dt; // [sec]
|
||||
float _imu_collection_time_adj{0.f};
|
||||
bool _do_reset{true};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user