Skip to content
Snippets Groups Projects
Commit b587dec6 authored by beuchatp's avatar beuchatp
Browse files

Adjusted namespacing from the Safe Controller to link with the Parameer Service

parent e40fcfbe
No related branches found
No related tags found
No related merge requests found
...@@ -333,7 +333,7 @@ int main(int argc, char* argv[]) ...@@ -333,7 +333,7 @@ int main(int argc, char* argv[])
case TYPE_AGENT: case TYPE_AGENT:
{ {
//m_ros_namespace = ros::this_node::getNamespace(); //m_ros_namespace = ros::this_node::getNamespace();
m_ros_namespace = "/" + std::to_string(my_agentID) + "/" + "ParameterService"; m_ros_namespace = "/" + std::to_string(my_agentID) + '/' + "ParameterService";
ROS_INFO_STREAM("This Paramter Sercice will load .yaml file parameters into the 'base' namespace: " << m_ros_namespace); ROS_INFO_STREAM("This Paramter Sercice will load .yaml file parameters into the 'base' namespace: " << m_ros_namespace);
break; break;
} }
...@@ -343,7 +343,7 @@ int main(int argc, char* argv[]) ...@@ -343,7 +343,7 @@ int main(int argc, char* argv[])
case TYPE_COORDINATOR: case TYPE_COORDINATOR:
{ {
//m_ros_namespace = ros::this_node::getNamespace(); //m_ros_namespace = ros::this_node::getNamespace();
m_ros_namespace = "/" + "ParameterService"; m_ros_namespace = '/' + "ParameterService";
ROS_INFO_STREAM("This Paramter Sercice will load .yaml file parameters into the 'base' namespace: " << m_ros_namespace); ROS_INFO_STREAM("This Paramter Sercice will load .yaml file parameters into the 'base' namespace: " << m_ros_namespace);
break; break;
} }
......
...@@ -584,7 +584,7 @@ int main(int argc, char* argv[]) { ...@@ -584,7 +584,7 @@ int main(int argc, char* argv[]) {
// Set the class variable "namespace_to_own_agent_parameter_service" to be a the // Set the class variable "namespace_to_own_agent_parameter_service" to be a the
// namespace string for the parameter service that is running on the machine of this // namespace string for the parameter service that is running on the machine of this
// agent // agent
namespace_to_own_agent_parameter_service = "ParameterService"; namespace_to_own_agent_parameter_service = m_namespace + "/ParameterService";
// Create a node handle to the parameter service running on this agent's machine // 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); ros::NodeHandle nodeHandle_to_own_agent_parameter_service(namespace_to_own_agent_parameter_service);
...@@ -611,6 +611,11 @@ int main(int argc, char* argv[]) { ...@@ -611,6 +611,11 @@ int main(int argc, char* argv[]) {
// "yamlReadyForFetchCallback" class function. // "yamlReadyForFetchCallback" class function.
ros::Subscriber controllerYamlReadyForFetchSubscriber_to_coordinator = nodeHandle_to_coordinator_parameter_service.subscribe("controllerYamlReadyForFetch", 1, yamlReadyForFetchCallback); ros::Subscriber controllerYamlReadyForFetchSubscriber_to_coordinator = nodeHandle_to_coordinator_parameter_service.subscribe("controllerYamlReadyForFetch", 1, yamlReadyForFetchCallback);
// Let the user know what namespaces are being used for linking to the parameter service
ROS_INFO_STREAM("The namespace string for accessing the Paramter Services are:");
ROS_INFO_STREAM("namespace_to_own_agent_parameter_service = " << namespace_to_own_agent_parameter_service);
ROS_INFO_STREAM("namespace_to_coordinator_parameter_service = " << namespace_to_coordinator_parameter_service);
// Call the class function that loads the parameters for this class. // Call the class function that loads the parameters for this class.
fetchYamlParameters(nodeHandle_to_own_agent_parameter_service); fetchYamlParameters(nodeHandle_to_own_agent_parameter_service);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment