Added real frequency to log #3076
Conversation
|
@tonynajjar, please properly fill in PR template in the future. @SteveMacenski, use this instead.
|
2abe01c to
8588e28
Compare
|
Thanks for the addition, I agree, this is useful information! |
SteveMacenski
left a comment
There was a problem hiding this comment.
LGTM, just some sanity checking from the linters
|
Just waiting on CI |
|
I believe I fixed the linting issues, but before merging, do you have any idea why it sometimes print frequencies higher than the target frequency? If we are in that condition, the frequency shouldn't be higher... See above screenshot in case you missed it |
|
I'd say first try nanoseconds rather than microseconds to give you more resolution, then try the high resolution clock[1], if that doesn't work, the ROS Steady Clock[2]. If it doesn't work by then, I can take a look. ROS Clock is probably the right move, but its worth trying those other options first to see if its a resolution issue, but it might be a time source issue. [1] https://en.cppreference.com/w/cpp/chrono/high_resolution_clock |
|
on it |
|
I give up 🤷♂️ I can't find anything wrong with the PR, maybe that's really the achieved rate. This could be related https://answers.ros.org/question/244688/frequency-of-c-while-loop-higher-than-desired/? |
|
It doesn't seem like this is something we should merge if it doesn't strictly speaking... work 😦 |
|
I actually agree, unless the wallrate is actually unstable and this only exposes that. I doubt it though, will investigate a bit more tomorrow |
|
I can't find what's wrong and can't spend more time on it. I'm fine to close this PR if you want |
|
OK |


Basic Info
Description of contribution in a few bullet points
It's unfortunate that rclcpp::WallRate doesn't offer a way to get the achieved period/frequency when sleep returns fals
Description of documentation updates required from your changes
Future work that may be required in bullet points
For Maintainers: