ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I guess your code example should be:

if (msg->data.c_str() == "Listen") ...

In C++ you can not just compare two char*. You neither have to use strcmp() or use the comparison operator of std::string:

if (msg->data == "Listen") ...