-
Notifications
You must be signed in to change notification settings - Fork 331
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
Allow timer rate to be configurable inmessage_lost_talker
#679
base: rolling
Are you sure you want to change the base?
Conversation
Signed-off-by: Yadunund <yadunund@gmail.com>
Signed-off-by: Yadunund <yadunund@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Command line arg looks wrong.
Co-authored-by: Michael Carroll <michael@openrobotics.org> Signed-off-by: Yadu <yadunund@gmail.com>
@@ -156,8 +156,8 @@ and the "Deadline missed" messages will no longer be printed. | |||
This demo shows how to get a notification when a subscription loses a message. | |||
|
|||
This feature is not available in all RMW implementations. | |||
`rmw_cyclonedds_cpp` and `rmw_connextdds` do support this feature. | |||
CycloneDDS partially implements the feature and it only triggers the event under some limited circumstances, thus it's recommended to try the demo with Connext. | |||
`rmw_zenoh_cpp`, `rmw_cyclonedds_cpp` and `rmw_connextdds` do support this feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think RMW_EVENT_MESSAGE_LOST
is supported in rmw_fastrtps, i am not sure why that is not listed here?
`rmw_zenoh_cpp`, `rmw_cyclonedds_cpp` and `rmw_connextdds` do support this feature. | |
`rmw_fastrtps_cpp`, `rmw_zenoh_cpp`, `rmw_cyclonedds_cpp` and `rmw_connextdds` do support this feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I also think it is premature to add in rmw_zenoh_cpp
here, as it is not a Tier-1 RMW.
input_stream >> timer_rate; | ||
if (!input_stream) { | ||
print_usage(); | ||
std::cout << "\n-s must be followed by a positive number, got: '" << |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::cout << "\n-s must be followed by a positive number, got: '" << | |
std::cout << "\n-r must be followed by a positive number, got: '" << |
std::exit(0); | ||
} | ||
timer_period_ = std::chrono::duration_cast<std::chrono::milliseconds>( | ||
std::chrono::duration<double, std::ratio<1>>(1.0 / timer_rate)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if -r 0
, this could generate 0 division exception?
@Yadunund friendly ping 🧇 |
Sorry for the delay. Will have this cleaned up by end of this week |
By default the talker publishes an 8mB message every 3 seconds. I haven't been able to reproduce any message lost callback triggers with such a low frequency. It helps to increase the publishing rate.
This PR
-r
CLI arg tomessage_lost_talker
to configure the timer's period. Default behavior is still the same 3s period.best_effort
to increase the probability of dropping a message. -> I can undo this change if needed.