Skip to content
Snippets Groups Projects
Commit 9ac23440 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Changed the public_node_handle_ for the private_node_handle_.

parent 98215d0b
No related branches found
No related tags found
1 merge request!1Kinetic migration
......@@ -141,7 +141,7 @@ function check_action_server_attributes_functions
fi
# check the node.cpp file
aux_line="${server_name}(public_node_handle_, \"${topic_name}\")"
aux_line="${server_name}(private_node_handle_, \"${topic_name}\")"
find_comment_in_file "${aux_line}" "${node_c}"
if [[ "${comment_found}" = "true" ]]
then
......@@ -341,7 +341,7 @@ function create_action_server
################################################################################
#modify Node.cpp
line="${server_name}(public_node_handle_, \"${topic_name}\")"
line="${server_name}(private_node_handle_, \"${topic_name}\")"
#check if ':' are needed
comment="${class_name}::${class_name}("
......
......@@ -71,7 +71,7 @@ function check_client_attributes_functions
fi
# check the node.cpp file
line="${client_name} = this->public_node_handle_.serviceClient<${srv_pkg}::${srv_file}>(\"${topic_name}\");"
line="${client_name} = this->private_node_handle_.serviceClient<${srv_pkg}::${srv_file}>(\"${topic_name}\");"
echo "${line}"
find_comment_in_file "${line}" "${node_c}"
if [[ "${comment_found}" = "true" ]]
......@@ -134,7 +134,7 @@ function create_client
################################################################################
#modify Node.cpp
line="${client_name} = this->public_node_handle_.serviceClient<${srv_pkg}::${srv_file}>(\"${topic_name}\");"
line="${client_name} = this->private_node_handle_.serviceClient<${srv_pkg}::${srv_file}>(\"${topic_name}\");"
comment="\[init clients\]"
add_line_to_file "\ \ ${line}\n" "${comment}" "${node_c}"
......
......@@ -136,7 +136,7 @@ function check_publisher_attributes_functions
kill_exit "A message with the same name is already published in file ${node_c} line ${line_number}"
fi
else
line="this->${publisher_name} = this->public_node_handle_.advertise<${msg_pkg}::${msg_file}>(\"${topic_name}\", ${buffer});"
line="this->${publisher_name} = this->private_node_handle_.advertise<${msg_pkg}::${msg_file}>(\"${topic_name}\", ${buffer});"
find_comment_in_file "${line}" "${node_c}"
if [[ "${comment_found}" = "true" ]]
then
......@@ -251,7 +251,7 @@ function create_publisher
# modify Node.cpp #
if [[ "${msg_file}" = "Image" ]]
then
line="it(this->public_node_handle_)"
line="it(this->private_node_handle_)"
find_comment_in_file "${line}" "${node_c}"
if [[ "${comment_found}" = "false" ]]
then
......@@ -317,7 +317,7 @@ function create_publisher
line="${line}${aux_line}\n"
aux_line="\ \ //std::string ${topic_name}_cal_file;"
line="${line}${aux_line}\n"
aux_line="\ \ //public_node_handle_.param<std::string>(\"<cal_file_param>\",${topic_name}_cal_file,\"\");"
aux_line="\ \ //private_node_handle_.param<std::string>(\"<cal_file_param>\",${topic_name}_cal_file,\"\");"
line="${line}${aux_line}\n"
aux_line="\ \ //if(this->${topic_name}_camera_manager.validateURL(${topic_name}_cal_file))"
line="${line}${aux_line}\n"
......@@ -359,7 +359,7 @@ function create_publisher
comment="\[publish messages\]"
add_line_to_file "\ \ ${line}" "${comment}" "${node_c}"
else
line="this->${publisher_name} = this->public_node_handle_.advertise<${msg_pkg}::${msg_file}>(\"${topic_name}\", ${buffer});"
line="this->${publisher_name} = this->private_node_handle_.advertise<${msg_pkg}::${msg_file}>(\"${topic_name}\", ${buffer});"
comment="\[init publishers\]"
add_line_to_file " ${line}" "${comment}" "${node_c}"
aux_line="// Uncomment the following line to publish the topic message"
......
......@@ -99,7 +99,7 @@ function check_server_attributes_functions
fi
# check the node.cpp file
line="this->${server_name} = this->public_node_handle_.advertiseService(\"${topic_name}\", &${class_name}::${callback}, this);"
line="this->${server_name} = this->private_node_handle_.advertiseService(\"${topic_name}\", &${class_name}::${callback}, this);"
find_comment_in_file "${line}" "${node_c}"
if [[ "${comment_found}" = "true" ]]
then
......@@ -192,7 +192,7 @@ function create_server
################################################################################
#modify Node.cpp
aux_line="this->${server_name} = this->public_node_handle_.advertiseService(\"${topic_name}\", &${class_name}::${callback}, this);"
aux_line="this->${server_name} = this->private_node_handle_.advertiseService(\"${topic_name}\", &${class_name}::${callback}, this);"
line="\ \ ${aux_line}\n"
aux_line="pthread_mutex_init(&this->${mutex_name},NULL);\n"
line="${line}\ \ ${aux_line}"
......
......@@ -129,7 +129,7 @@ function check_subscriber_attributes_functions
kill_exit "A subscriber with the same name is already subscribed in file ${node_c} line ${line_number}"
fi
else
line="this->${subscriber_name} = this->public_node_handle_.subscribe(\"${topic_name}\", ${buffer}, &${class_name}::${callback}, this);"
line="this->${subscriber_name} = this->private_node_handle_.subscribe(\"${topic_name}\", ${buffer}, &${class_name}::${callback}, this);"
find_comment_in_file "${line}" "${node_c}"
if [[ "${comment_found}" = "true" ]]
then
......@@ -282,7 +282,7 @@ function create_subscriber
# modify Node.cpp #
if [[ "${msg_file}" = "Image" ]]
then
line="it(this->public_node_handle_)"
line="it(this->private_node_handle_)"
find_comment_in_file "${line}" "${node_c}"
if [[ "${comment_found}" = "false" ]]
then
......@@ -316,7 +316,7 @@ function create_subscriber
aux_line="this->${subscriber_name} = this->it.subscribeCamera(\"${topic_name}/image_raw\", ${buffer}, &${class_name}::${callback}, this);"
line="${aux_line}\n"
else
aux_line="this->${subscriber_name} = this->public_node_handle_.subscribe(\"${topic_name}\", ${buffer}, &${class_name}::${callback}, this);"
aux_line="this->${subscriber_name} = this->private_node_handle_.subscribe(\"${topic_name}\", ${buffer}, &${class_name}::${callback}, this);"
line="${aux_line}\n"
fi
aux_line="\ \ pthread_mutex_init(&this->${mutex_name},NULL);"
......
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