-
Notifications
You must be signed in to change notification settings - Fork 51
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
set_capacity
not defined for realtime_circular_buffer
?
#74
Comments
Yep, doesn't seem to be implemented. A PR would be appreciated, thanks! |
Will do :) |
@jonbinney The seems to be a bit of ambiguity about the original meaning of this function. In Boost:
Given the signature of the missing |
From the boost documentation of That doesn't sound like the behavior I'd usually want. What use case do you have in mind? I wouldn't worry too much about keeping the signature of |
@jonbinney IMHO new items should be somehow initialized, so the user has to provide a value. My use case is that I implemented an average filter on top of this buffer, by averaging latest N samples of an incoming measure. I would not change size of the buffer at runtime, but it would come handy to change the size of a default-constructed one during for example initialization of a controller - like,
Could you elaborate a bit? Let's discuss what is your ideal behaviour, maybe we can implement it inside this class here. |
I may misunderstand, but wouldn't your rolling window average be wrong at the start? For example, assume N=10 for your case. You If we have a |
The point is: let's say we construct a About the averaging in my use case: in the first few cycles I may be able to accept a transient with "wrong values" (a sort of ramp effect), but truly I use a counter to keep track of the number of real measures obtained up to that moment (i.e. something that grows like 1 2 3 4 5 5 5 5 5 5...) |
You're right - I misunderstood how |
There is still a thing to notice:
Given this, the problem here is to choose between @jonbinney do you have any opinion or more background on this? |
It looks like both the mean and median filters in this repo use |
I would propose to drop But I can imagine breaking some possible packages in the wild doing so... |
I should have asked this earlier, but at some point is it worth encouraging people to just use |
Am I right or
set_capacity()
member is not implemented? I searched in the whole repo, only one result for this symbol, and it's the line at the link below.https://github.com/ros/filters/blob/e33463aebca78471c0e52f45eaf31585b781af61/include/filters/realtime_circular_buffer.hpp#L83C8-L83C20
In this case, would you like me to provide a PR?
The text was updated successfully, but these errors were encountered: