-
Notifications
You must be signed in to change notification settings - Fork 301
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
coalesce_interval_ms parameter has no effect #284
Comments
Well I stumbled upon the same issue. 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.
//
// 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;
if ((autorepeat_rate_ > 0.0 &&
RCL_NS_TO_MS(diff_since_last_publish.nanoseconds()) >= autorepeat_interval_ms_) ||
publish_soon_)
{
last_publish = now;
should_publish = true;
publish_soon_ = false;
}
} with the following: if(should_publish) {
const rclcpp::Time now = this->now();
const rclcpp::Duration diff_since_last_publish = now - last_publish;
if(RCL_NS_TO_MS(diff_since_last_publish.nanoseconds()) < coalesce_interval_ms_)
should_publish = false;
else
last_publish = now;
} Then just recompile as usual ( After my bachelor thesis I might have the time to look at what the actual issue is and submit a pull request. But maybe one of the maintainers can figure this out faster. |
And a minor inconvenience: The params like <launch>
<node pkg="joy" exec="joy_node">
<param name="coalesce_interval_ms" value="500"/>
<param name="autorepeat_rate" value="0.0"/><!-- Unit in ns -->
</node>
</launch> |
it seems like setting i.e. replace lines (455 - 474)
with
I can't think of a reason why |
I tested |
I am trying to limit the data usage of my system by reducing the maximum rate of joy message transmission. To accomplish this in the past (in ros1) I would lower the auto repeat rate and the coalescence_interval. However, in the ros2 version the coalescence_interval_ms seems to have no effect. Here are the parameters from my node:
when I move the sticks rapidly I am still seeing data rates well over 200hz
The text was updated successfully, but these errors were encountered: