Skip to content
Open
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
12 changes: 2 additions & 10 deletions joy/src/joy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,8 @@ void Joy::eventThread()
} else {
RCLCPP_INFO(get_logger(), "Unknown event type %d", e.type);
}
}

if (!should_publish) {
// So far, nothing has indicated that we should publish. However we need to
// do additional checking since there are several possible reasons:
// 1. SDL_WaitEventTimeout failed
// 2. SDL_WaitEventTimeout timed out
// 3. SDL_WaitEventTimeout succeeded, but the event that happened didn't cause
// a publish to happen.
//
} else {
// We didn't succeed, either because of a failure or because of a timeout.
// If we are autorepeating and enough time has passed, set should_publish.
rclcpp::Time now = this->now();
rclcpp::Duration diff_since_last_publish = now - last_publish;
Expand Down