-
Notifications
You must be signed in to change notification settings - Fork 59
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
Resetting KalmanFilter is broken #27
Comments
Couldn't this bug be resolved by changing the body of Reset() from
to
like what is done in the constructor of KalmanFilter? |
Hi Marc, (my C++ skills are a bit rusty, so please correct me if I got it wrong) Thx for your input! However, your suggestion leads to a memory leak (the old _post is not freed). You would first need to perfom a delete operation. Also, even if you would do so, this requires memory allocation and hence will break real-time behaviour if you would execute the .reset() operation in a real-time thread. Johannes' patch (see original comment of the migrate bug) is definitely an alternative, but as he points out, it's not complete: the bug needs to be tackled in all subclasses. Also, I would need to figure out how real-time operating systems deal with the dynamic_cast... |
How is the old |
First of all, no need for apologies ;-) (orocos stands for open real-time control software) Currently, _post is freed in the destructor, but that's one reason why this bug exist. If a reset is performed on a filter,
and the memory block originally pointed to by _post is lost |
Ah right. That definitely causes a problem. After calling |
Using smart pointers might be an answer. But that might requiring compulsory use of either Boost or a recent C++ compiler. If C++14 is used, using Another option is always creating new pointers and copying data from the user-owned pointers. This requires ensuring the user knows their pointers do not affect the BFL data. As for Dynamic Cast, you can eliminate that making |
@kunaltyagi Note that |
AFAICS, the RTT uses boost::intrusive_ptr ( see http://www.orocos.org/stable/documentation/rtt/v2.x/api/html/classRTT_1_1base_1_1DataSourceBase.html#af764490461a162f4a62c63770535fb7b ), probably due to its real-time suitedness (but I didn't check it). Are you guys using BFL as standalone, or together with other orocos libraries? |
@kam3k Oops, my bad. I thought C++11 had I'm using BFL standalone, but there must be people using it with the wider orocos lib suite. |
@toeklk I'm using BFL standalone as well. |
migrated from Bugzilla #798
status NEW severity normal in component core for ---
Reported in version trunk on platform All
Assigned to: BFL mailinglist
Original attachment names and IDs:
On 2010-12-03 15:41:06 +0100, Johannes Meyer wrote:
The text was updated successfully, but these errors were encountered: