2
4

1 回答 1

7

The proper signature for creating a subscriber with a class method as callback is as follows:

ros::Subscriber sub = nh.subscribe("my_topic", 1, &Foo::callback, &foo_object);

So in your case you should use:

current_maintained_temp_sub = n.subscribe("current_maintained_temp", 1000, &BangBangControlUnit::current_maintained_temp_callback, &control);

You can read more about publishers and subscribers in C++ here.

于 2012-03-06T16:09:51.743 回答