Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions control_toolbox/test/control_filters/test_low_pass_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ TEST_F(FilterTest, TestLowPassWrenchFilterMissingParameter)
node_->get_node_parameters_interface()));
}

TEST_F(FilterTest, TestLowPassWrenchFilterInvalidThenFixedParameter)
TEST_F(FilterTest, TestLowPassWrenchFilterInvalidParameter)
{
std::shared_ptr<filters::FilterBase<geometry_msgs::msg::WrenchStamped>> filter_ =
std::make_shared<control_filters::LowPassFilter<geometry_msgs::msg::WrenchStamped>>();
Expand All @@ -60,13 +60,10 @@ TEST_F(FilterTest, TestLowPassWrenchFilterInvalidThenFixedParameter)
ASSERT_FALSE(filter_->configure(
"", "TestLowPassFilter", node_->get_node_logging_interface(),
node_->get_node_parameters_interface()));

// fix the param
node_->set_parameter(rclcpp::Parameter("sampling_frequency", 1000.0));
// should allow configuration and pass second call to unconfigured filter
ASSERT_TRUE(filter_->configure(
"", "TestLowPassFilter", node_->get_node_logging_interface(),
node_->get_node_parameters_interface()));
// remains now undeclared, so should throw if we try to set it
ASSERT_THROW(
node_->set_parameter(rclcpp::Parameter("sampling_frequency", 1000.0)),
rclcpp::exceptions::ParameterNotDeclaredException);
}

TEST_F(FilterTest, TestLowPassFilterThrowsUnconfigured)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TestLowPassWrenchFilterMissingParameter:
damping_frequency: 20.5
damping_intensity: 1.25

TestLowPassWrenchFilterInvalidThenFixedParameter:
TestLowPassWrenchFilterInvalidParameter:
ros__parameters:
sampling_frequency: 0.0
damping_frequency: 20.5
Expand Down
Loading