-
Notifications
You must be signed in to change notification settings - Fork 102
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
Logging macro conditional on a latch/flipflop #456
Comments
Currently, the log provides the function RCLCPP_INFO_ONCE(), but it doesn't fully meet your needs.
I'm curious why not implement it with code instead of relying on log functions? Implementing it by the user would also be simple. |
Thanks.
You could say that about all the log macros. We have ended up implementing many "simple" things throughout our code base in relation to rclcpp functionality and it get tiring writing out the same boilerplate. I intend to follow the same approach here but I wanted to see if it was possible using log macros. If it can, then great I will create a PR, if not, it goes into our private libraries never seeing the light of day. |
I have no reason to oppose adding such a feature to the log function. It brings convenience to the users. Let's hear the opinions of other community members. |
@russkel thanks for creating issue. hardware not ready yet
// and finally system swaps over
System in good state, ready.
// and then back again
hardware not ready yet i guess maybe there are some constraints, but i would not use topics to share the hardware or sensor state. instead,
|
This was an example (and it's dealing with the data stream such as serial from a hardware sensor), this is pretty common where sensors will report their state at > 1Hz. There's no publishing in the example. I imagine there's a few use cases outside of this example too. |
A common pattern of logging I have come across in hardware integration is a flipflop kind of pattern:
e.g. Hardware callback reports at 10Hz "BAD" for X seconds, and then reports "GOOD" when hardware state good:
Would spam debug msgs:
Ideally it would be something like:
Yielding:
I'd be willing to write this feature if someone could give me instructions on how it would be implemented in the rcutils framework, and if it would actually be merged.
I am not too sure on how to define the static/global that can be referenced in other functions.
The text was updated successfully, but these errors were encountered: