Skip to content
Snippets Groups Projects
Commit 406d41be authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Add ROS Interfaces sections to Readme as they are added with scripts. Add also...

Add ROS Interfaces sections to Readme as they are added with scripts. Add also tf interfaces. Allow adding absolute namespace interfaces, for tf (/tf vs ~topic)
parent 036390c6
No related branches found
No related tags found
No related merge requests found
......@@ -123,4 +123,4 @@ else
fi
type="action"
fill_readme_ros_interface ${type} ${server_client} ${ros_pkg} ${action_name} ${file_pkg} ${action_file}.action
\ No newline at end of file
fill_readme_ros_interface ${type} ${server_client} ${ros_pkg} ${action_name} ${file_pkg} ${action_file}.action "false"
\ No newline at end of file
......@@ -122,4 +122,4 @@ else
fi
type="service"
fill_readme_ros_interface ${type} ${server_client} ${ros_pkg} ${service_name} ${file_pkg} ${srv_file}
\ No newline at end of file
fill_readme_ros_interface ${type} ${server_client} ${ros_pkg} ${service_name} ${file_pkg} ${srv_file} "false"
\ No newline at end of file
......@@ -96,4 +96,7 @@ then
create_tf_broadcaster ${ros_pkg} ${node_h} ${node_c} ${driver_alg}
else
create_tf_listener ${ros_pkg} ${node_h} ${node_c} ${driver_alg}
fi
\ No newline at end of file
fi
type="topic"
fill_readme_ros_interface ${type} ${pub_subs} ${ros_pkg} "tf" "tf" "tfMessage" "true"
\ No newline at end of file
......@@ -145,4 +145,4 @@ else
fi
type="topic"
fill_readme_ros_interface ${type} ${pub_subs} ${ros_pkg} ${topic_name} ${file_pkg} ${msg_file}
\ No newline at end of file
fill_readme_ros_interface ${type} ${pub_subs} ${ros_pkg} ${topic_name} ${file_pkg} ${msg_file} "false"
\ No newline at end of file
......@@ -8,18 +8,6 @@ Developed at Institut de Robòtica i Informàtica Industrial (IRI, CSIC-UPC) (ww
Contact: labrobotica@iri.upc.edu
# ROS Interface
### Topic subscribers
### Topic publishers
### Service servers
### Service clients
### Action servers
### Action clients
### Parameters
- ~rate (Double; default: 10.0; min: 0.1; max: 1000) The main node thread loop rate in Hz.
......
......@@ -279,13 +279,13 @@ function add_pkg_dependency_to_readme
# - $4: interface name
# - $5: interface package
# - $6: interface message
function fill_readme_ros_interface # ${type} ${pub_subs} ${ros_pkg} ${topic_name} ${file_pkg} ${msg_file}
function fill_readme_ros_interface # ${type} ${pub_subs} ${ros_pkg} ${topic_name} ${file_pkg} ${msg_file} ${absolute_ns}
{
if [[ -z $1 ]] || [[ -z $2 ]] || [[ -z $3 ]] || [[ -z $4 ]] || [[ -z $5 ]] || [[ -z $6 ]]
then
kill_exit "ERROR: fill_readme_ros_interface missing input parameters"
fi
#echo "fill_readme_ros_interface $1 $2 $3 $4 $5 $6"
local if_type=$1
local if_subtype=$2
......@@ -293,12 +293,22 @@ function fill_readme_ros_interface # ${type} ${pub_subs} ${ros_pkg} ${topic_name
local if_name=$4
local if_pkg=$5
local if_msg=$6
local absolute_ns=$7
roscd "${ros_pkg}"
file=README.md
line=" - ~$if_name ($if_pkg/$if_msg)"
comment=""
local file=README.md
local line=""
local comment=""
echo "Filling $file with ROS Interfaces information..."
if [ "$absolute_ns" = true ]
then
line=" - /$if_name ($if_pkg/$if_msg)"
else
line=" - ~$if_name ($if_pkg/$if_msg)"
fi
case "$if_type" in
"topic")
......@@ -310,6 +320,12 @@ function fill_readme_ros_interface # ${type} ${pub_subs} ${ros_pkg} ${topic_name
"subscriber")
comment="### Topic subscribers"
;;
"broadcaster")
comment="### Topic publishers"
;;
"listener")
comment="### Topic subscribers"
;;
esac
;;
"service")
......@@ -333,6 +349,8 @@ function fill_readme_ros_interface # ${type} ${pub_subs} ${ros_pkg} ${topic_name
esac
;;
esac
add_line_to_file "${comment}" "# ROS Interface" "${file}"
add_line_to_file "${line}" "${comment}" "${file}"
}
......@@ -417,7 +435,8 @@ function add_line_to_file
if [[ -z "${line_found}" ]]
then
sed -i -e "/${comment}/a\\${line_to_add}" "${file}"
#echo "Adding line after comment: ${line_to_add} after ${comment_to_find}"
sed -i -e "/${comment_to_find}/a\\${line_to_add}" "${file}"
else
#skip line
echo "File ${file} already included the line, skipping..."
......
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