diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index dafc650852..eec1fe7bbc 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -1490,8 +1490,8 @@ controller_interface::return_type ControllerManager::switch_controller( controller.info.claimed_interfaces.clear(); } if ( - std::find(activate_request_.begin(), activate_request_.end(), controller.info.name) != - activate_request_.end()) + std::find(activate_controllers.begin(), activate_controllers.end(), controller.info.name) != + activate_controllers.end()) { if (!is_controller_active(controller.c)) { @@ -1501,8 +1501,9 @@ controller_interface::return_type ControllerManager::switch_controller( } } if ( - std::find(deactivate_request_.begin(), deactivate_request_.end(), controller.info.name) != - deactivate_request_.end()) + std::find( + deactivate_controllers.begin(), deactivate_controllers.end(), controller.info.name) != + deactivate_controllers.end()) { if (is_controller_active(controller.c)) { diff --git a/controller_manager/test/test_controllers_chaining_with_controller_manager.cpp b/controller_manager/test/test_controllers_chaining_with_controller_manager.cpp index c143ab4862..48f5509794 100644 --- a/controller_manager/test/test_controllers_chaining_with_controller_manager.cpp +++ b/controller_manager/test/test_controllers_chaining_with_controller_manager.cpp @@ -1177,7 +1177,7 @@ TEST_P( switch_test_controllers( {DIFF_DRIVE_CONTROLLER, ODOM_PUBLISHER_CONTROLLER, SENSOR_FUSION_CONTROLLER}, {PID_RIGHT_WHEEL}, test_param.strictness, expected.at(test_param.strictness).future_status, - expected.at(test_param.strictness).return_type); + controller_interface::return_type::ERROR); // Preceding controller should stay deactivated and following controller // should be deactivated (if BEST_EFFORT) @@ -1508,8 +1508,7 @@ TEST_P( switch_test_controllers( {DIFF_DRIVE_CONTROLLER}, {PID_LEFT_WHEEL, PID_RIGHT_WHEEL}, test_param.strictness, - expected.at(test_param.strictness).future_status, - expected.at(test_param.strictness).return_type); + expected.at(test_param.strictness).future_status, controller_interface::return_type::ERROR); // Preceding controller should stay deactivated and following controller // should be deactivated (if BEST_EFFORT) diff --git a/controller_manager/test/test_release_interfaces.cpp b/controller_manager/test/test_release_interfaces.cpp index 9caef761ab..4dedb47241 100644 --- a/controller_manager/test/test_release_interfaces.cpp +++ b/controller_manager/test/test_release_interfaces.cpp @@ -84,7 +84,7 @@ TEST_F(TestReleaseInterfaces, switch_controllers_same_interface) ASSERT_EQ(std::future_status::timeout, switch_future.wait_for(std::chrono::milliseconds(100))) << "switch_controller should be blocking until next update cycle"; ControllerManagerRunner cm_runner(this); - EXPECT_EQ(controller_interface::return_type::OK, switch_future.get()); + EXPECT_EQ(controller_interface::return_type::ERROR, switch_future.get()); ASSERT_EQ( lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE, abstract_test_controller1.c->get_lifecycle_state().id()); @@ -188,7 +188,7 @@ TEST_F(TestReleaseInterfaces, switch_controllers_same_interface) ASSERT_EQ(std::future_status::timeout, switch_future.wait_for(std::chrono::milliseconds(100))) << "switch_controller should be blocking until next update cycle"; ControllerManagerRunner cm_runner(this); - EXPECT_EQ(controller_interface::return_type::OK, switch_future.get()); + EXPECT_EQ(controller_interface::return_type::ERROR, switch_future.get()); ASSERT_EQ( lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE, abstract_test_controller1.c->get_lifecycle_state().id());