From 7b3a674d668b52fc3fde3a0f63a45f39944d61f2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 9 Sep 2013 19:18:52 +1000 Subject: [PATCH] AP_InertialSensor: added set_default_filter() method --- libraries/AP_InertialSensor/AP_InertialSensor.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor.h b/libraries/AP_InertialSensor/AP_InertialSensor.h index fb87056b12..ff0f973c3e 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor.h @@ -131,6 +131,13 @@ public: _board_orientation = orientation; } + // override default filter frequency + void set_default_filter(float filter_hz) { + if (!_mpu6000_filter.load()) { + _mpu6000_filter.set(filter_hz); + } + } + protected: // sensor specific init to be overwritten by descendant classes