How to read a vector<strings> parameter from command line
Hi
I have a std::vector<std::string> parameter and I like to read the values getParam. How does the command line syntax look to read my names param from bash.
e.g. rosrun my_pgk my_node _names:=???????
I tried:
_names:="max susi"
_names:="max, susi"
_names:="[max, susi]"
_names:="(max, susi)"
nothing worked :-(
My code looks like this:
std::vector<std::string> names;
n_param_.getParam ( "names", names);
//For debugging
std::stringstream ss;
for ( size_t i = 0; i < names.size(); i++ ) ss << ( i!=0?", ":"" ) << names[i];
ROS_INFO ( "names: %s", ss.str().c_str() );
Greetings Markus