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

answered 2012-11-02 12:35:55 -0600

joq gravatar image

You need to pass the class pointer along with the callback:

ros::Subscriber sub = n.subscribe("chatter", 1000, &listener::chatterCallback, this);

You need to pass the class pointer along with the callback:

ros::Subscriber sub = n.subscribe("chatter", 1000, &listener::chatterCallback, this);

EDIT: I missed the fact that you are compiling on Windows. I have no idea if that interface is officially supported on VS2010.

Your work-around is not really a solution. If you actually want to use ROS on Windows, please open a defect ticket so the maintainers know their code does not work with your compiler.