Skip to content

Commit

Permalink
Use std::fill since same value is applied to all filters
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahiminfinite committed Apr 11, 2023
1 parent 076bf81 commit e34ceb5
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,7 @@ bool ButterworthFilterPlugin::initialize(rclcpp::Node::SharedPtr node, moveit::c
num_joints_ = num_joints;
auto param_listener_ = std::make_unique<online_signal_smoothing::ParamListener>(node_);
auto filter_coeff = param_listener_->get_params().butterworth_filter_coeff;

for (std::size_t i = 0; i < num_joints_; ++i)
{
position_filters_.emplace_back(filter_coeff);
}
std::fill(position_filters_.begin(), position_filters_.end(), filter_coeff);
return true;
};

Expand Down

0 comments on commit e34ceb5

Please sign in to comment.