Decrease PAW3902 and PAA3905 backup schedule to 200ms

This commit is contained in:
alexklimaj
2022-12-22 20:46:19 -05:00
committed by Daniel Agar
parent c3e70b03aa
commit 2f1b3142a6
4 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -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};
+2 -2
View File
@@ -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};