Ask Your Question

Revision history [back]

In a nutshell, changing your print to ROS_INFO("%s", srv.response.version.c_str()) should fix your compile error.

A string type in a ROS message/service maps to a std::string in C++ (see the msg package for more details). std::string's are not printable with something like printf, unless you get access to the underlying const char* data which is what printf's "%s" format string is expecting. You can get access to the C-string via the c_str() member on std::string.