ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Image subscriber - window popup does not appear

asked 2015-03-10 06:28:32 -0500

Kapil Yadav gravatar image

I am following image subscribe tutorial on official ROS page. when I run my_subscriber no window popup appears. I type -

rosrun image_transport_tutorial my_subscriber

output is -

init done
opengl support available

I am following this tutorial - [ROS tutorial] ( )

I have roscore and rosrun image_transport_tutorial my_publisher pathtofile already running in dofferent terminals.

my_subscriber file has the following contents -

#include <ros/ros.h>
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <opencv2/highgui/highgui.hpp>
#include <cv_bridge/cv_bridge.h>
#include <stdio.h>
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
    cv::imshow("view", cv_bridge::toCvShare(msg, "bgr8")->image);
  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::init(argc, argv, "image_listener");
  ros::NodeHandle nh;
  image_transport::ImageTransport it(nh);
  image_transport::Subscriber sub = it.subscribe("camera/image", 1, imageCallback);
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-11 17:14:16 -0500

sudhanshu_mittal gravatar image

The code given in the tutorial seems to be working perfectly fine.

This is some configuration problem. I hope you tried this.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-03-10 06:28:32 -0500

Seen: 480 times

Last updated: Mar 11 '15