@@ -689,7 +689,7 @@ void EthercatDriver::loadTransferConfigYamlFile(YAML::Node & node, const std::st
689689 std::string file_path;
690690 if (path.empty ()) {
691691 // Get the fsoe_config or transfer_config parameter of the ethercat_driver hardware plugin
692- if (info_.hardware_parameters .find (" fsoe_config" ) == info_.hardware_parameters .end () ||
692+ if (info_.hardware_parameters .find (" fsoe_config" ) == info_.hardware_parameters .end () &&
693693 info_.hardware_parameters .find (" transfer_config" ) == info_.hardware_parameters .end () )
694694 {
695695 std::string msg (" transfer_config or fsoe_config parameter is missing!" );
@@ -698,10 +698,24 @@ void EthercatDriver::loadTransferConfigYamlFile(YAML::Node & node, const std::st
698698 rclcpp::get_logger (" EthercatDriver" ), msg.c_str ());
699699 throw std::runtime_error (msg);
700700 }
701- if (info_.hardware_parameters .find (" fsoe_config" ) == info_.hardware_parameters .end () ) {
701+ if (info_.hardware_parameters .find (" fsoe_config" ) != info_.hardware_parameters .end () &&
702+ info_.hardware_parameters .find (" transfer_config" ) != info_.hardware_parameters .end ())
703+ {
704+ std::string msg (
705+ " Both transfer_config and fsoe_config parameters are provided! Please provide only one "
706+ " of them." );
707+ RCLCPP_FATAL (
708+ rclcpp::get_logger (" EthercatDriver" ), msg.c_str ());
709+ throw std::runtime_error (msg);
710+ }
711+ if (info_.hardware_parameters .find (" fsoe_config" ) != info_.hardware_parameters .end () ) {
712+ std::string msg (" The fsoe_config parameter is deprecated. "
713+ " Please use transfer_config instead." );
714+ RCLCPP_WARN (
715+ rclcpp::get_logger (" EthercatDriver" ), msg.c_str ());
702716 file_path = info_.hardware_parameters .at (" fsoe_config" );
703717 }
704- if (info_.hardware_parameters .find (" transfer_config" ) = = info_.hardware_parameters .end ()) {
718+ if (info_.hardware_parameters .find (" transfer_config" ) ! = info_.hardware_parameters .end ()) {
705719 file_path = info_.hardware_parameters .at (" transfer_config" );
706720 }
707721 } else {
0 commit comments