From e8f58435a996edffd32940d245353e421aec32b2 Mon Sep 17 00:00:00 2001 From: beuchatp <beuchatp@control.ee.ethz.ch> Date: Tue, 5 Dec 2017 07:50:35 +0100 Subject: [PATCH] Adjusted the node handles in the fetch callbacks --- pps_ws/src/d_fall_pps/src/CustomControllerService.cpp | 10 +++++----- pps_ws/src/d_fall_pps/src/PPSClient.cpp | 8 ++++---- pps_ws/src/d_fall_pps/src/SafeControllerService.cpp | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pps_ws/src/d_fall_pps/src/CustomControllerService.cpp b/pps_ws/src/d_fall_pps/src/CustomControllerService.cpp index 1dbde303..d4480f4b 100644 --- a/pps_ws/src/d_fall_pps/src/CustomControllerService.cpp +++ b/pps_ws/src/d_fall_pps/src/CustomControllerService.cpp @@ -817,7 +817,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. > Now fetching the parameter values from this machine."); + ROS_INFO("The CustomControllerService received the message that YAML parameters were (re-)loaded. > Now fetching the parameter values from this agent."); // 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 @@ -831,8 +831,7 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) // Let the user know that this message was received ROS_INFO("The CustomControllerService received the message that YAML parameters were (re-)loaded. > 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 = ros::NodeHandle(); - ros::NodeHandle nodeHandle_to_coordinator_parameter_service(nodeHandle_to_coordinator,namespace_to_coordinator_parameter_service); + ros::NodeHandle nodeHandle_to_coordinator_parameter_service(namespace_to_coordinator_parameter_service); // Call the function that fetches the parameters fetchYamlParameters(nodeHandle_to_coordinator_parameter_service); break; @@ -1165,8 +1164,9 @@ int main(int argc, char* argv[]) { // Set the class variable "nodeHandle_to_coordinator_parameter_service" to be a node handle // for the parameter service that is running on the coordinate machine - //std::string m_ros_namespace = ros::getNamespace(); - namespace_to_coordinator_parameter_service = "ParameterService"; + // NOTE: the backslash here (i.e., "/") before the name of the node ("ParameterService") + // is very important because it specifies that the name is global + namespace_to_coordinator_parameter_service = "/ParameterService"; // Create a node handle to the parameter service running on the coordinator machine ros::NodeHandle nodeHandle_to_coordinator = ros::NodeHandle(); diff --git a/pps_ws/src/d_fall_pps/src/PPSClient.cpp b/pps_ws/src/d_fall_pps/src/PPSClient.cpp index 72ea2823..993a2e1d 100755 --- a/pps_ws/src/d_fall_pps/src/PPSClient.cpp +++ b/pps_ws/src/d_fall_pps/src/PPSClient.cpp @@ -809,8 +809,7 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) // > 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. > 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 = ros::NodeHandle(); - ros::NodeHandle nodeHandle_to_coordinator_parameter_service(nodeHandle_to_coordinator,namespace_to_coordinator_parameter_service); + ros::NodeHandle nodeHandle_to_coordinator_parameter_service(namespace_to_coordinator_parameter_service); // Call the function that fetches the parameters fetchYamlParametersForSafeController(nodeHandle_to_coordinator_parameter_service); break; @@ -1030,8 +1029,9 @@ int main(int argc, char* argv[]) // Set the class variable "nodeHandle_to_coordinator_parameter_service" to be a node handle // for the parameter service that is running on the coordinate machine - //std::string m_ros_namespace = ros::getNamespace(); - namespace_to_coordinator_parameter_service = "ParameterService"; + // NOTE: the backslash here (i.e., "/") before the name of the node ("ParameterService") + // is very important because it specifies that the name is global + namespace_to_coordinator_parameter_service = "/ParameterService"; // Create a node handle to the parameter service running on the coordinator machine ros::NodeHandle nodeHandle_to_coordinator = ros::NodeHandle(); diff --git a/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp b/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp index 9ead5c48..98a42079 100755 --- a/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp +++ b/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp @@ -402,8 +402,7 @@ void yamlReadyForFetchCallback(const std_msgs::Int32& msg) // Let the user know that this message was received ROS_INFO("The SafeControllerService received the message that YAML parameters were (re-)loaded. > 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 = ros::NodeHandle(); - ros::NodeHandle nodeHandle_to_coordinator_parameter_service(nodeHandle_to_coordinator,namespace_to_coordinator_parameter_service); + ros::NodeHandle nodeHandle_to_coordinator_parameter_service(namespace_to_coordinator_parameter_service); // Call the function that fetches the parameters fetchYamlParameters(nodeHandle_to_coordinator_parameter_service); break; @@ -608,8 +607,9 @@ int main(int argc, char* argv[]) { // Set the class variable "nodeHandle_to_coordinator_parameter_service" to be a node handle // for the parameter service that is running on the coordinate machine - //std::string m_ros_namespace = ros::master::getNamespace(); - namespace_to_coordinator_parameter_service = "ParameterService"; + // NOTE: the backslash here (i.e., "/") before the name of the node ("ParameterService") + // is very important because it specifies that the name is global + namespace_to_coordinator_parameter_service = "/ParameterService"; // Create a node handle to the parameter service running on the coordinator machine ros::NodeHandle nodeHandle_to_coordinator = ros::NodeHandle(); -- GitLab