@@ -362,27 +362,42 @@ void ControllerManager::init_resource_manager(const std::string & robot_descript
362362 using lifecycle_msgs::msg::State;
363363
364364 std::vector<std::string> configure_components_on_start = std::vector<std::string>({});
365- get_parameter (" configure_components_on_start" , configure_components_on_start);
366- rclcpp_lifecycle::State inactive_state (
367- State::PRIMARY_STATE_INACTIVE, hardware_interface::lifecycle_state_names::INACTIVE);
368- for (const auto & component : configure_components_on_start)
365+ if (get_parameter (" configure_components_on_start" , configure_components_on_start))
369366 {
370- resource_manager_->set_component_state (component, inactive_state);
367+ RCLCPP_WARN_STREAM (
368+ get_logger (),
369+ " [Deprecated]: Usage of parameter \" activate_components_on_start\" is deprecated. Use "
370+ " hardware_spawner instead." );
371+ rclcpp_lifecycle::State inactive_state (
372+ State::PRIMARY_STATE_INACTIVE, hardware_interface::lifecycle_state_names::INACTIVE);
373+ for (const auto & component : configure_components_on_start)
374+ {
375+ resource_manager_->set_component_state (component, inactive_state);
376+ }
371377 }
372378
373379 std::vector<std::string> activate_components_on_start = std::vector<std::string>({});
374- get_parameter (" activate_components_on_start" , activate_components_on_start);
375- rclcpp_lifecycle::State active_state (
376- State::PRIMARY_STATE_ACTIVE, hardware_interface::lifecycle_state_names::ACTIVE);
377- for (const auto & component : activate_components_on_start)
380+ if (get_parameter (" activate_components_on_start" , activate_components_on_start))
378381 {
379- resource_manager_->set_component_state (component, active_state);
382+ RCLCPP_WARN_STREAM (
383+ get_logger (),
384+ " [Deprecated]: Usage of parameter \" activate_components_on_start\" is deprecated. Use "
385+ " hardware_spawner instead." );
386+ rclcpp_lifecycle::State active_state (
387+ State::PRIMARY_STATE_ACTIVE, hardware_interface::lifecycle_state_names::ACTIVE);
388+ for (const auto & component : activate_components_on_start)
389+ {
390+ resource_manager_->set_component_state (component, active_state);
391+ }
380392 }
381-
382393 // if both parameter are empty or non-existing preserve behavior where all components are
383394 // activated per default
384395 if (configure_components_on_start.empty () && activate_components_on_start.empty ())
385396 {
397+ RCLCPP_WARN_STREAM (
398+ get_logger (),
399+ " [Deprecated]: Automatic activation of all hardware components will not be supported in the "
400+ " future anymore. Use hardware_spawner instead." );
386401 resource_manager_->activate_all_components ();
387402 }
388403}
0 commit comments