text: #include <ros/ros.h>
  #include <image_transport/image_transport.h>
  #include <opencv2/highgui/highgui.hpp>
  #include <cv_bridge/cv_bridge.h>
  
  void imageCallback(const sensor_msgs::ImageConstPtr& msg)
  {
    try
    {
      cv::imshow("view", cv_bridge::toCvShare(msg, "bgr8")->image);
      cv::waitKey(30);
    }
    catch (cv_bridge::Exception& e)
    {
      ROS_ERROR("Could not convert from '%s' to 'bgr8'.", msg->encoding.c_str());
    }
  }
  
  int main(int argc, char **argv)
  {
    ROS_INFO("Initializing pic_sim_sub ...");
    ros::init(argc, argv, "pic_sim_sub");
    ros::NodeHandle nh;
    cv::namedWindow("view");
    cv::startWindowThread();
    image_transport::ImageTransport it(nh);
    image_transport::Subscriber sub = it.subscribe("pic_sim/image_raw", 1, imageCallback);
    ros::spin();
    cv::destroyWindow("view");
  }
  