mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 11:13:35 +08:00
Decrease PAW3902 and PAA3905 backup schedule to 200ms
This commit is contained in:
@@ -234,7 +234,7 @@ void PAA3905::RunImpl()
|
||||
}
|
||||
|
||||
// push backup schedule back
|
||||
ScheduleDelayed(1_s);
|
||||
ScheduleDelayed(kBackupScheduleIntervalUs);
|
||||
}
|
||||
|
||||
struct TransferBuffer {
|
||||
@@ -415,7 +415,7 @@ void PAA3905::RunImpl()
|
||||
}
|
||||
|
||||
// only publish when there's motion or at least every second
|
||||
if (motion_reported || (hrt_elapsed_time(&_last_publish) >= 1_s)) {
|
||||
if (motion_reported || (hrt_elapsed_time(&_last_publish) >= kBackupScheduleIntervalUs)) {
|
||||
|
||||
sensor_optical_flow.timestamp = hrt_absolute_time();
|
||||
_sensor_optical_flow_pub.publish(sensor_optical_flow);
|
||||
|
||||
@@ -121,6 +121,7 @@ private:
|
||||
bool _data_ready_interrupt_enabled{false};
|
||||
|
||||
uint32_t _scheduled_interval_us{SAMPLE_INTERVAL_MODE_0 / 2};
|
||||
static constexpr uint32_t kBackupScheduleIntervalUs{200_ms};
|
||||
|
||||
Mode _mode{Mode::LowLight};
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ void PAW3902::RunImpl()
|
||||
}
|
||||
|
||||
// push backup schedule back
|
||||
ScheduleDelayed(1_s);
|
||||
ScheduleDelayed(kBackupScheduleIntervalUs);
|
||||
}
|
||||
|
||||
struct TransferBuffer {
|
||||
@@ -418,7 +418,7 @@ void PAW3902::RunImpl()
|
||||
}
|
||||
|
||||
// only publish when there's motion or at least every second
|
||||
if (motion_reported || (hrt_elapsed_time(&_last_publish) >= 1_s)) {
|
||||
if (motion_reported || (hrt_elapsed_time(&_last_publish) >= kBackupScheduleIntervalUs)) {
|
||||
|
||||
sensor_optical_flow.timestamp = hrt_absolute_time();
|
||||
_sensor_optical_flow_pub.publish(sensor_optical_flow);
|
||||
|
||||
@@ -121,6 +121,7 @@ private:
|
||||
bool _data_ready_interrupt_enabled{false};
|
||||
|
||||
uint32_t _scheduled_interval_us{SAMPLE_INTERVAL_MODE_0 / 2};
|
||||
static constexpr uint32_t kBackupScheduleIntervalUs{200_ms};
|
||||
|
||||
Mode _mode{Mode::LowLight};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user