diff --git a/controller_interface/src/chainable_controller_interface.cpp b/controller_interface/src/chainable_controller_interface.cpp index 4bf9fe0101..9f4a171ec3 100644 --- a/controller_interface/src/chainable_controller_interface.cpp +++ b/controller_interface/src/chainable_controller_interface.cpp @@ -48,18 +48,6 @@ std::vector ChainableControllerInterface::export_state_interfaces() { auto state_interfaces = on_export_state_interfaces(); - // check if the "state_interfaces_values_" variable is resized to number of interfaces - if (state_interfaces_values_.size() != state_interfaces.size()) - { - RCLCPP_FATAL( - get_node()->get_logger(), - "The internal storage for exported state values 'state_interfaces_values_' variable has size " - "'%zu', but it is expected to have the size '%zu' equal to the number of exported state " - "interfaces. No state interface will be exported. Please correct and recompile " - "the controller with name '%s' and try again.", - state_interfaces_values_.size(), state_interfaces.size(), get_node()->get_name()); - state_interfaces.clear(); - } // check if the names of the controller state interfaces begin with the controller's name for (const auto & interface : state_interfaces) @@ -85,21 +73,6 @@ ChainableControllerInterface::export_reference_interfaces() { auto reference_interfaces = on_export_reference_interfaces(); - // check if the "reference_interfaces_" variable is resized to number of interfaces - if (reference_interfaces_.size() != reference_interfaces.size()) - { - // TODO(destogl): Should here be "FATAL"? It is fatal in terms of controller but not for the - // framework - RCLCPP_FATAL( - get_node()->get_logger(), - "The internal storage for reference values 'reference_interfaces_' variable has size '%zu', " - "but it is expected to have the size '%zu' equal to the number of exported reference " - "interfaces. No reference interface will be exported. Please correct and recompile " - "the controller with name '%s' and try again.", - reference_interfaces_.size(), reference_interfaces.size(), get_node()->get_name()); - reference_interfaces.clear(); - } - // check if the names of the reference interfaces begin with the controller's name for (const auto & interface : reference_interfaces) { diff --git a/controller_interface/test/test_chainable_controller_interface.cpp b/controller_interface/test/test_chainable_controller_interface.cpp index 7380b222e1..2f04273f3e 100644 --- a/controller_interface/test/test_chainable_controller_interface.cpp +++ b/controller_interface/test/test_chainable_controller_interface.cpp @@ -74,27 +74,6 @@ TEST_F(ChainableControllerInterfaceTest, export_reference_interfaces) EXPECT_EQ(reference_interfaces[0].get_value(), INTERFACE_VALUE); } -TEST_F(ChainableControllerInterfaceTest, interfaces_storage_not_correct_size) -{ - TestableChainableControllerInterface controller; - - // initialize, create node - const auto node_options = controller.define_custom_node_options(); - ASSERT_EQ( - controller.init(TEST_CONTROLLER_NAME, "", 50.0, "", node_options), - controller_interface::return_type::OK); - ASSERT_NO_THROW(controller.get_node()); - - // expect empty return because storage is not resized - controller.reference_interfaces_.clear(); - auto reference_interfaces = controller.export_reference_interfaces(); - ASSERT_THAT(reference_interfaces, IsEmpty()); - // expect empty return because storage is not resized - controller.state_interfaces_values_.clear(); - auto exported_state_interfaces = controller.export_state_interfaces(); - ASSERT_THAT(exported_state_interfaces, IsEmpty()); -} - TEST_F(ChainableControllerInterfaceTest, interfaces_prefix_is_not_node_name) { TestableChainableControllerInterface controller;