-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add standalone version of LPF #222
base: ros2-master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ros2-master #222 +/- ##
===============================================
+ Coverage 50.41% 51.17% +0.76%
===============================================
Files 9 10 +1
Lines 486 510 +24
Branches 62 66 +4
===============================================
+ Hits 245 261 +16
- Misses 215 221 +6
- Partials 26 28 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@roncapat what do you think? |
if (!this->configured_ || !lpf_ || !lpf_->is_configured()) | ||
{ | ||
if (logger_) | ||
RCLCPP_ERROR_SKIPFIRST_THROTTLE((*logger_), *clock_, 2000, "Filter is not configured"); |
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 the filter is not configured, i think it's better to throw an exception rather than continuing right?
msg_filtered = b1_ * msg_old + a1_ * msg_filtered_old; | ||
msg_filtered_old = msg_filtered; | ||
|
||
// TODO(destogl): use wrenchMsgToEigen | ||
msg_old[0] = data_in.wrench.force.x; | ||
msg_old[1] = data_in.wrench.force.y; | ||
msg_old[2] = data_in.wrench.force.z; | ||
msg_old[3] = data_in.wrench.torque.x; | ||
msg_old[4] = data_in.wrench.torque.y; | ||
msg_old[5] = data_in.wrench.torque.z; | ||
|
||
data_out.wrench.force.x = msg_filtered[0]; | ||
data_out.wrench.force.y = msg_filtered[1]; | ||
data_out.wrench.force.z = msg_filtered[2]; | ||
data_out.wrench.torque.x = msg_filtered[3]; | ||
data_out.wrench.torque.y = msg_filtered[4]; | ||
data_out.wrench.torque.z = msg_filtered[5]; | ||
|
||
// copy the header | ||
data_out.header = data_in.header; |
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.
May be the update method specific to geometry_msgs Wrench should be removed?. It kinda has same content of templated one right?
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.
the math is the same, but here it uses the Eigen matrices to do the linear combination. this can't work with the templated method alone?
Replaces #192 and closes #164
Changes on top:
filters
control_toolbox
namespace.The filter plugins should still work as before without any changes (see the test files).