mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 11:23:33 +08:00
PX4 sensor driver helpers
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
class Integrator
|
||||
{
|
||||
public:
|
||||
Integrator(uint64_t auto_reset_interval = 4000 /* 250 Hz */, bool coning_compensation = false);
|
||||
Integrator(uint32_t auto_reset_interval = 4000 /* 250 Hz */, bool coning_compensation = false);
|
||||
~Integrator() = default;
|
||||
|
||||
// no copy, assignment, move, move assignment
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
* @return true if putting the item triggered an integral reset and the integral should be
|
||||
* published.
|
||||
*/
|
||||
bool put(uint64_t timestamp, matrix::Vector3f &val, matrix::Vector3f &integral, uint32_t &integral_dt);
|
||||
bool put(const uint64_t ×tamp, const matrix::Vector3f &val, matrix::Vector3f &integral, uint32_t &integral_dt);
|
||||
|
||||
/**
|
||||
* Put an item into the integral but provide an interval instead of a timestamp.
|
||||
@@ -108,12 +108,12 @@ public:
|
||||
/**
|
||||
* Set auto reset interval during runtime. This won't reset the integrator.
|
||||
*
|
||||
* @param auto_reset_interval New reset time interval for the integrator.
|
||||
* @param auto_reset_interval New reset time interval for the integrator (+- 10%).
|
||||
*/
|
||||
void set_autoreset_interval(uint64_t auto_reset_interval) { _auto_reset_interval = auto_reset_interval; }
|
||||
void set_autoreset_interval(uint32_t auto_reset_interval) { _auto_reset_interval = 0.90f * auto_reset_interval; }
|
||||
|
||||
private:
|
||||
uint64_t _auto_reset_interval{0}; /**< the interval after which the content will be published
|
||||
uint32_t _auto_reset_interval{0}; /**< the interval after which the content will be published
|
||||
and the integrator reset, 0 if no auto-reset */
|
||||
|
||||
uint64_t _last_integration_time{0}; /**< timestamp of the last integration step */
|
||||
|
||||
Reference in New Issue
Block a user