image_transport usage
Hi there I'm using this callback function to subscribe to a topic
void imageCallback(const sensor_msgs::ImageConstPtr& msg2)
{
cv_bridge::CvImagePtr cv_ptr2;
try
{
cv_ptr2 = cv_bridge::toCvCopy(msg2, sensor_msgs::image_encodings::MONO8);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
cv::imshow("OpenCV viewer ", cv_ptr2->image);
cv::waitKey(3);
}
My question is how can I do that using image_transport ?
Image transport is only within ROS. After this import step you can use it.