ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I use the following code to use message filters inside a class class SubscribeAndPublish { public: SubscribeAndPublish():sync2(image_sub,image_sub2,500){ image_sub.subscribe(n, "/camera/color/image_raw", 1); image_sub2.subscribe(n, "/camera/aligned_depth_to_color/image_raw", 1); sync2.registerCallback(boost::bind(&SubscribeAndPublish::callback,this, _1, _2)); odom_pub = n.advertise<nav_msgs::odometry>("RGBDodom", 50); } private: ros::NodeHandle n; ros::Publisher odom_pub; message_filters::Subscriber<image> image_sub; message_filters::Subscriber<image> image_sub2; TimeSynchronizer<image, image=""> sync2; };
2 | No.2 Revision |
I use the following code to use message filters inside a class class
`
public:
SubscribeAndPublish():sync2(image_sub,image_sub2,500){
}
private: ros::NodeHandle
ros::Publisher odom_pub;
};`
3 | No.3 Revision |
I use the following code to use message filters inside a class
`class
class SubscribeAndPublish
public:
}
};`