Set parameter list using XmlRpc
Hi,
I need to set some ros parameters where one of them is a list of strings. I'm using C++ but cannot find an example of how to do it.
I currently have a list std::vector<std::string>
which I want to set in the ros parameter server.
From here http://www.ros.org/wiki/roscpp/Overview/Parameter%20Server I understand I need to use XmlRpc::XmlRpcValue
to set the array.
So far I have tried:
//agent_names is a populated std::vector of std::string
XmlRpc::XmlRpcValue vocabulary(agent_names);
n.setParam("vocabulary", vocabulary);
But it doesn't compile.
How do I construct an XmlRpcValue object from a std::vector?
Also, do I need to link to the XmlRpc library in my CMakeLists.txt and then import headers in my code? In that case, what do I put in my CMakeLists.txt?
Any help is greatly appreciated =)