diff --git a/pps_ws/src/d_fall_pps/src/CustomControllerService.cpp b/pps_ws/src/d_fall_pps/src/CustomControllerService.cpp index eae858d8b4570e957b77b1471f683bff378e9c86..678b1ba3c222d194dbfd8be0087b6d28566b8929 100644 --- a/pps_ws/src/d_fall_pps/src/CustomControllerService.cpp +++ b/pps_ws/src/d_fall_pps/src/CustomControllerService.cpp @@ -815,9 +815,7 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) case FETCH_YAML_CUSTOM_CONTROLLER_COORDINATOR: { // Let the user know that this message was received - ROS_INFO("The CustomControllerService received the message that YAML parameters were (re-)loaded"); - // Let the user know from where the paramters are being fetched - ROS_INFO("> Now fetching the parameter values from the this machine"); + ROS_INFO("The CustomControllerService received the message that YAML parameters were (re-)loaded.\r> Now fetching the parameter values from the this machine."); // Create a node handle to the parameter service running on the coordinator machine ros::NodeHandle nodeHandle_to_coordinator_parameter_service = ros::NodeHandle(namespace_to_coordinator_parameter_service); // Call the function that fetches the parameters @@ -828,9 +826,7 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) case FETCH_YAML_CUSTOM_CONTROLLER_AGENT: { // Let the user know that this message was received - ROS_INFO("The CustomControllerService received the message that YAML parameters were (re-)loaded"); - // Let the user know which paramters are being fetch - ROS_INFO("> Now fetching the parameter values from the this machine"); + ROS_INFO("The CustomControllerService received the message that YAML parameters were (re-)loaded.\r> Now fetching the parameter values from the this machine"); // Create a node handle to the parameter service running on this agent's machine ros::NodeHandle nodeHandle_to_own_agent_parameter_service = ros::NodeHandle(namespace_to_own_agent_parameter_service); // Call the function that fetches the parameters @@ -841,8 +837,8 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) default: { // Let the user know that the command was not relevant - ROS_INFO("The CustomControllerService received the message that YAML parameters were (re-)loaded"); - ROS_INFO("> However the parameters do not relate to this controller, hence nothing will be fetched."); + //ROS_INFO("The CustomControllerService received the message that YAML parameters were (re-)loaded"); + //ROS_INFO("> However the parameters do not relate to this controller, hence nothing will be fetched."); break; } } @@ -954,7 +950,7 @@ void processFetchedParameters() // Check whether we found our own agent ID if (!foundMyAgentID) { - ROS_INFO("DEBUGGING: not following because my ID was not found"); + //ROS_INFO("DEBUGGING: not following because my ID was not found"); // Revert to the default of not following any agent shouldFollowAnotherAgent = false; agentID_to_follow = 0; diff --git a/pps_ws/src/d_fall_pps/src/PPSClient.cpp b/pps_ws/src/d_fall_pps/src/PPSClient.cpp index 5d7bea66c77282014fca029306864d687ac94423..244dd7e199b9fbca9b0bbdf3d46baa749cc913b3 100755 --- a/pps_ws/src/d_fall_pps/src/PPSClient.cpp +++ b/pps_ws/src/d_fall_pps/src/PPSClient.cpp @@ -793,7 +793,7 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) { // Let the user know that this message was received // > and also from where the paramters are being fetched - ROS_INFO("The PPSClient received the message that YAML parameters were (re-)loaded for the Safe Controller.\n>Now fetching the parameter values from the this machine."); + ROS_INFO("The PPSClient received the message that YAML parameters were (re-)loaded for the Safe Controller.\r>Now fetching the parameter values from the coordinator."); // Create a node handle to the parameter service running on the coordinator machine ros::NodeHandle nodeHandle_to_coordinator_parameter_service = ros::NodeHandle(namespace_to_coordinator_parameter_service); // Call the function that fetches the parameters @@ -804,9 +804,9 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) case FETCH_YAML_SAFE_CONTROLLER_AGENT: { // Let the user know that this message was received - ROS_INFO("The PPSClient received the message that YAML parameters were (re-)loaded for the Safe Controller"); + ROS_INFO("The PPSClient received the message that YAML parameters were (re-)loaded for the Safe Controller.\r> Now fetching the parameter values from the this machine"); // Let the user know which paramters are being fetch - ROS_INFO("> Now fetching the parameter values from the this machine"); + ROS_INFO(""); // Create a node handle to the parameter service running on this agent's machine ros::NodeHandle nodeHandle_to_own_agent_parameter_service(namespace_to_own_agent_parameter_service); // Call the function that fetches the parameters @@ -817,8 +817,7 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) default: { // Let the user know that the command was not relevant - ROS_INFO("The PPSClient received the message that YAML parameters were (re-)loaded"); - ROS_INFO("> However the parameters do not relate to this service, hence nothing will be fetched."); + //ROS_INFO("The PPSClient received the message that YAML parameters were (re-)loaded.\r> However the parameters do not relate to this service, hence nothing will be fetched."); break; } } diff --git a/pps_ws/src/d_fall_pps/src/ParameterService.cpp b/pps_ws/src/d_fall_pps/src/ParameterService.cpp index 6ba594eb2fdcc6eb49d362d58a95ae921af8b661..b5c75792a55c2eff82fed02ff3373f369a0f84c6 100755 --- a/pps_ws/src/d_fall_pps/src/ParameterService.cpp +++ b/pps_ws/src/d_fall_pps/src/ParameterService.cpp @@ -176,59 +176,58 @@ void requestLoadControllerYamlCallback(const std_msgs::Int32& msg) // Instantiate a local varaible to confirm that something was actually loaded from // a YAML file - bool isReadyForFetch = true; + bool isValidToAttemptLoad = true; // Instantiate a local variable for the string that will be passed to the "system" std::string cmd; // Get the abolute path to "d_fall_pps" std::string d_fall_pps_path = ros::package::getPath("d_fall_pps"); - ROS_INFO_STREAM(d_fall_pps_path); // Switch between loading for the different controllers if ( (controller_to_load_yaml==LOAD_YAML_SAFE_CONTROLLER_COORDINATOR) && (my_type==TYPE_COORDINATOR) ) { // Re-load the parameters of the safe controller: cmd = "rosparam load " + d_fall_pps_path + "/param/SafeController.yaml " + m_ros_namespace + "/SafeControllerService"; - system(cmd.c_str()); - ROS_INFO_STREAM(cmd); } else if ( (controller_to_load_yaml==LOAD_YAML_SAFE_CONTROLLER_AGENT) && (my_type==TYPE_AGENT) ) { // Re-load the parameters of the safe controller: cmd = "rosparam load " + d_fall_pps_path + "/param/SafeController.yaml " + m_ros_namespace + "/SafeControllerService"; - system(cmd.c_str()); - ROS_INFO_STREAM(cmd); } else if ( (controller_to_load_yaml==LOAD_YAML_CUSTOM_CONTROLLER_COORDINATOR) && (my_type==TYPE_COORDINATOR) ) { // Re-load the parameters of the custom controller: cmd = "rosparam load " + d_fall_pps_path + "/param/CustomController.yaml " + m_ros_namespace + "/CustomControllerService"; - system(cmd.c_str()); - ROS_INFO_STREAM(cmd); } else if ( (controller_to_load_yaml==LOAD_YAML_CUSTOM_CONTROLLER_AGENT) && (my_type==TYPE_AGENT) ) { // Re-load the parameters of the custom controller: cmd = "rosparam load " + d_fall_pps_path + "/param/CustomController.yaml " + m_ros_namespace + "/CustomControllerService"; - system(cmd.c_str()); - ROS_INFO_STREAM(cmd); } else { // Let the user know that the command was not recognised - ROS_INFO("Unknown 'controller to load yaml' command, thus nothing will be loaded"); + ROS_INFO("> Unknown 'controller to load yaml' command, thus nothing will be loaded"); // Set the boolean that prevents the fetch message from being sent - isReadyForFetch = false; + isValidToAttemptLoad = false; } - // Pause breifly to ensure that the yaml file is fully loaded - ros::Duration(0.2).sleep(); - // Only bother with sending the "ready for fetch" message if something was actually - // loaded from a YAML file - if (isReadyForFetch) + // Only bother with ttempting to loaded the .yaml file, and subseuently send the "ready for fetch" + // message if something can actually be loaded from a YAML file + if (isValidToAttemptLoad) { + // Let the user know what is about to happen + ROS_INFO_STREAM("> The following path will be used for locating the .yaml file:\r" << d_fall_pps_path << "\rThe comand line string sent to the 'system' is:\r" << cmd ); + + // Re-load the parameters by pass the command line string via a "system" call + // > i.e., this replicates pasting this string in a new terminal window and pressing enter + system(cmd.c_str()); + + // Pause breifly to ensure that the yaml file is fully loaded + ros::Duration(0.2).sleep(); + // Instantiate a local variable for the fetch message std_msgs::Int32 fetch_msg; // Fill in the data of the fetch message diff --git a/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp b/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp index 89a6a96bf2ca92e0aa4a871aaf7d4037b3d2198d..afd8806055e64a86592a8de3650243808b37aad1 100755 --- a/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp +++ b/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp @@ -386,9 +386,7 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) case FETCH_YAML_SAFE_CONTROLLER_COORDINATOR: { // Let the user know that this message was received - ROS_INFO("The SafeControllerService received the message that YAML parameters were (re-)loaded"); - // Let the user know from where the paramters are being fetched - ROS_INFO("> Now fetching the parameter values from the this machine"); + ROS_INFO("The SafeControllerService received the message that YAML parameters were (re-)loaded.\r> Now fetching the parameter values from the coordinator."); // Create a node handle to the parameter service running on the coordinator machine ros::NodeHandle nodeHandle_to_coordinator_parameter_service = ros::NodeHandle(namespace_to_coordinator_parameter_service); // Call the function that fetches the parameters @@ -399,9 +397,7 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) case FETCH_YAML_SAFE_CONTROLLER_AGENT: { // Let the user know that this message was received - ROS_INFO("The SafeControllerService received the message that YAML parameters were (re-)loaded"); - // Let the user know which paramters are being fetch - ROS_INFO("> Now fetching the parameter values from the this machine"); + ROS_INFO("The SafeControllerService received the message that YAML parameters were (re-)loaded.\r> Now fetching the parameter values from the this machine."); // Create a node handle to the parameter service running on this agent's machine ros::NodeHandle nodeHandle_to_own_agent_parameter_service = ros::NodeHandle(namespace_to_own_agent_parameter_service); // Call the function that fetches the parameters @@ -412,8 +408,7 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) default: { // Let the user know that the command was not relevant - ROS_INFO("The SafeControllerService received the message that YAML parameters were (re-)loaded"); - ROS_INFO("> However the parameters do not relate to this controller, hence nothing will be fetched."); + //ROS_INFO("The SafeControllerService received the message that YAML parameters were (re-)loaded.\r> However the parameters do not relate to this controller, hence nothing will be fetched."); break; } }