Skip to content

Commit

Permalink
Remove test applicable only to rolling
Browse files Browse the repository at this point in the history
Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
  • Loading branch information
christophfroehlich and saikishor authored Mar 28, 2024
1 parent ed491ed commit 104289f
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions controller_manager/test/test_controller_manager_srvs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,49 +466,6 @@ TEST_F(TestControllerManagerSrvs, unload_controller_srv)
EXPECT_EQ(0u, cm_->get_loaded_controllers().size());
}

TEST_F(TestControllerManagerSrvs, robot_description_on_load_and_unload_controller)
{
rclcpp::executors::SingleThreadedExecutor srv_executor;
rclcpp::Node::SharedPtr srv_node = std::make_shared<rclcpp::Node>("srv_client");
srv_executor.add_node(srv_node);
rclcpp::Client<controller_manager_msgs::srv::UnloadController>::SharedPtr unload_client =
srv_node->create_client<controller_manager_msgs::srv::UnloadController>(
"test_controller_manager/unload_controller");

auto test_controller = std::make_shared<TestController>();
auto abstract_test_controller = cm_->add_controller(
test_controller, test_controller::TEST_CONTROLLER_NAME,
test_controller::TEST_CONTROLLER_CLASS_NAME);
EXPECT_EQ(1u, cm_->get_loaded_controllers().size());

// check the robot description
ASSERT_EQ(ros2_control_test_assets::minimal_robot_urdf, test_controller->get_robot_description());

// Now change the robot description and then see that the controller maintains the old URDF until
// it is unloaded and loaded again
auto msg = std_msgs::msg::String();
msg.data = ros2_control_test_assets::minimal_robot_missing_state_keys_urdf;
cm_->robot_description_callback(msg);
ASSERT_EQ(ros2_control_test_assets::minimal_robot_urdf, test_controller->get_robot_description());

// now unload and load the controller and see if the controller gets the new robot description
auto unload_request = std::make_shared<controller_manager_msgs::srv::UnloadController::Request>();
unload_request->name = test_controller::TEST_CONTROLLER_NAME;
auto result = call_service_and_wait(*unload_client, unload_request, srv_executor, true);
EXPECT_EQ(
lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, test_controller->get_state().id());
EXPECT_EQ(0u, cm_->get_loaded_controllers().size());

// now load it and check if it got the new robot description
cm_->add_controller(
test_controller, test_controller::TEST_CONTROLLER_NAME,
test_controller::TEST_CONTROLLER_CLASS_NAME);
EXPECT_EQ(1u, cm_->get_loaded_controllers().size());
ASSERT_EQ(
ros2_control_test_assets::minimal_robot_missing_state_keys_urdf,
test_controller->get_robot_description());
}

TEST_F(TestControllerManagerSrvs, configure_controller_srv)
{
rclcpp::executors::SingleThreadedExecutor srv_executor;
Expand Down

0 comments on commit 104289f

Please sign in to comment.