mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
move IMU integration out of drivers to sensors hub to handle accel/gyro sync
- IMU integration move from drivers (PX4Accelerometer/PX4Gyroscope) to sensors/vehicle_imu - sensors: voted_sensors_update now consumes vehicle_imu - delete sensor_accel_integrated, sensor_gyro_integrated - merge sensor_accel_status/sensor_gyro_status into vehicle_imu_status - sensors status output minor improvements (ordering, whitespace, show selected sensor device id and instance)
This commit is contained in:
@@ -127,14 +127,30 @@ public:
|
||||
|
||||
void call() override
|
||||
{
|
||||
// schedule immediately if no interval, otherwise check time elapsed
|
||||
if ((_interval_us == 0) || (hrt_elapsed_time_atomic(&_last_update) >= _interval_us)) {
|
||||
_work_item->ScheduleNow();
|
||||
// schedule immediately if updated (queue depth or subscription interval)
|
||||
if ((_required_updates == 0)
|
||||
|| (_subscription.get_node()->published_message_count() >= (_subscription.get_last_generation() + _required_updates))) {
|
||||
if (updated()) {
|
||||
_work_item->ScheduleNow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Optionally limit callback until more samples are available.
|
||||
*
|
||||
* @param required_updates Number of queued updates required before a callback can be called.
|
||||
*/
|
||||
void set_required_updates(uint8_t required_updates)
|
||||
{
|
||||
// TODO: constrain to queue depth?
|
||||
_required_updates = required_updates;
|
||||
}
|
||||
|
||||
private:
|
||||
px4::WorkItem *_work_item;
|
||||
|
||||
uint8_t _required_updates{0};
|
||||
};
|
||||
|
||||
} // namespace uORB
|
||||
|
||||
Reference in New Issue
Block a user