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

Recorder discovery does not restart after being stopped #1893

Open
oysstu opened this issue Jan 8, 2025 · 0 comments
Open

Recorder discovery does not restart after being stopped #1893

oysstu opened this issue Jan 8, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@oysstu
Copy link
Contributor

oysstu commented Jan 8, 2025

The discovery is currently not restarted properly in record() when previously stopped through stop(). This implies that no new topics are subscribed to on subsequent calls to resume and no topics at all when simulation time is used due to how these topics are initialized.

The cause is the following comparison, which needs to be inverted:

void RecorderImpl::start_discovery()
{
std::lock_guard<std::mutex> state_lock(discovery_mutex_);
if (stop_discovery_.exchange(false)) {
RCLCPP_DEBUG(node->get_logger(), "Recorder topic discovery is already running.");
} else {
discovery_future_ =
std::async(std::launch::async, std::bind(&RecorderImpl::topics_discovery, this));
}
}

The stop_discovery_ atomic should then also be initialized to true in order for the first start_discovery call to succeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants