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

logger: poll sensor_combined if estimator replay enabled #14734

Closed
wants to merge 1 commit into from
Closed
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
26 changes: 23 additions & 3 deletions src/modules/logger/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,21 @@ bool Logger::initialize_topics()
}
}

if (!logged_topics.initialize_logged_topics(sdlog_profile)) {
if (logged_topics.initialize_logged_topics(sdlog_profile)) {

// if no polling configured then use sensor_combined if Estimator Replay profile is enabled
if (!_polling_topic_meta && (sdlog_profile & SDLogProfileMask::ESTIMATOR_REPLAY)) {
const auto &topics = orb_get_topics();

for (size_t i = 0; i < orb_topics_count(); i++) {
if (strcmp("sensor_combined", topics[i]->o_name) == 0) {
_polling_topic_meta = topics[i];
break;
}
}
}

} else {
return false;
}

Expand All @@ -503,8 +517,14 @@ bool Logger::initialize_topics()

for (int i = 0; i < logged_topics.subscriptions().count; ++i) {
const LoggedTopics::RequestedSubscription &sub = logged_topics.subscriptions().sub[i];
// if we poll on a topic, we don't use the interval and let the polled topic define the maximum interval
uint16_t interval_ms = _polling_topic_meta ? 0 : sub.interval_ms;

uint16_t interval_ms = sub.interval_ms;

if (_polling_topic_meta && (get_orb_meta(sub.id) == _polling_topic_meta)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still breaks replay.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you expand on that? What would you suggest given the overall goal?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rate limitation of the topics uses the absolute time which does not match the replay time.
We need to use the time abstraction for replay to resolve this cleanly.
The quick-and-dirty way would be to check _replay_file_name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll put this on hold depending on the outcome of #14759.

// if we poll on a topic, we don't use the interval and let the polled topic define the maximum interval
interval_ms = 0;
}

_subscriptions[i] = LoggerSubscription(sub.id, interval_ms, sub.instance);
_subscriptions[i].subscribe();
}
Expand Down