Problem with message_filter inizialization
Hi,
I need to write a C++ class containing message_filters as members.
In the ROS Wiki they are declared in this way:
message_filters::Subscriber<std_msgs::UInt32> sub(nh, "my_topic", 1);
sub.registerCallback(myCallback);
while for using them in a class I found that this could be a way:
class DBCreator
{
ros::NodeHandle nh_;
message_filters::Subscriber<capygroovy::Ticks> ticks_sub_;
public:
DBCreator()
{
ticks_sub_ = nh_.subscribe("/ticks",1,&DBCreator::ticksCallback,this);
but I get this error:
/opt/ros/groovy/include/message_filters/subscriber.h:96: note: no known conversion for argument 1 from ‘ros::Subscriber’ to 'const message_filters::Subscriber< capygroovy::Ticks_< std::allocator < void > > >&'
that is, ticks_sub_ should be a ros::Subscriber
object.
I'm not very familiar with this topic so I'd be glad if someone could help me understand how to initialize this object inside the class!!!
Thanks!