Reg: Subscribing to Depth and rgb image at the same time
Hi,
I am new in ROS. I wanted to get both the depth and rgb image of an object at the same time and use it in the callback function. if I use it as mentioned below. It works for me.
void imageCallback(const sensor_msgs::ImageConstPtr& kinect_image)
image_transport::Subscriber sub = it.subscribe("camera/rgb/image_color", 1, imageCallback); or image_transport::Subscriber sub = it.subscribe("camera/depth/image", 1, imageCallback);
I dont know how can I get both the rgb and depth image in the callback funtion. The below way doesn't work.
void imageCallback(const sensor_msgs::ImageConstPtr& kinect_image,const sensor_msgs::ImageConstPtr& depth_image)
image_transport::Subscriber sub = it.subscribe("camera/rgb/image_color","camera/depth/image", 1, imageCallback);
I know, may be the question sounds very naive. But, I would really be grateful if someone can guide me.