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

Instead of using the default subscriber created from a ros NodeHandle, you should be creating message_filters::Subscriber instances as described in the C++ example on the wiki.

In your case, this could look like:

DBCreator() {
    ticks_sub_ = message_filters::Subscriber<capygroovy::Ticks>(nh_, "/ticks", 1);
    ticks_sub_.registerCallback(&DBCreator::ticksCallback,this);
}

Or you can use the C++ member initializer syntax:

DBCreator() : ticks_sub_(nh_, "/ticks", 1) {
        ticks_sub_.registerCallback(&DBCreator::ticksCallback,this);
}