Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sub: support MASK_LOG_IMU_FAST (loop rate logging) #28747

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ArduSub/ArduSub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const AP_Scheduler::Task Sub::scheduler_tasks[] = {
#if HAL_LOGGING_ENABLED
SCHED_TASK(ten_hz_logging_loop, 10, 350, 51),
SCHED_TASK(twentyfive_hz_logging, 25, 110, 54),
SCHED_TASK(loop_rate_logging, LOOP_RATE, 50, 55),
SCHED_TASK_CLASS(AP_Logger, &sub.logger, periodic_tasks, 400, 300, 57),
#endif
SCHED_TASK_CLASS(AP_InertialSensor, &sub.ins, periodic, 400, 50, 60),
Expand Down Expand Up @@ -234,7 +235,15 @@ void Sub::twentyfive_hz_logging()
}

// log IMU data if we're not already logging at the higher rate
if (should_log(MASK_LOG_IMU) && !should_log(MASK_LOG_IMU_RAW)) {
if (should_log(MASK_LOG_IMU) && !should_log(MASK_LOG_IMU_FAST)) {
AP::ins().Write_IMU();
}
}

// Full rate logging of IMU
void Sub::loop_rate_logging()
{
if (should_log(MASK_LOG_IMU_FAST)) {
AP::ins().Write_IMU();
}
}
Expand Down
1 change: 1 addition & 0 deletions ArduSub/Sub.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ class Sub : public AP_Vehicle {
void update_batt_compass(void);
void ten_hz_logging_loop();
void twentyfive_hz_logging();
void loop_rate_logging();
void three_hz_loop();
void one_hz_loop();
void update_turn_counter();
Expand Down
Loading