Skip to content

Commit

Permalink
fix coalesce_interval_ms not working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
sathyas2023 committed Jan 2, 2025
1 parent 881f3a5 commit 5ee71d9
Showing 1 changed file with 2 additions and 10 deletions.
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

0 comments on commit 5ee71d9

Please sign in to comment.