ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
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") ...