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

JFReuter's profile - activity

2012-11-16 07:39:54 -0500 received badge  Famous Question (source)
2012-10-26 14:40:42 -0500 received badge  Famous Question (source)
2012-10-26 14:40:42 -0500 received badge  Notable Question (source)
2012-07-16 13:02:34 -0500 received badge  Popular Question (source)
2012-06-14 04:53:04 -0500 received badge  Notable Question (source)
2012-01-25 04:01:03 -0500 received badge  Popular Question (source)
2011-10-21 03:37:54 -0500 received badge  Editor (source)
2011-10-21 02:35:40 -0500 commented question first image message does not get published
I have added a small example.
2011-10-21 02:26:52 -0500 asked a question first image message does not get published

I have a node that among many other things, publishes images for debugging purposes. However, this does not work all the time, and some messages never get seen by other nodes.

The messages get published from a subscription callback, if that makes a difference.

Symptoms:

  • The first message never gets published
  • Other messages (PointCloud2) work fine
  • Messages don't get published, even when callback is idle
  • cv_bridge or manual message creation makes no difference
  • No error messages at all

I have verified that the publish method does get called, and even stepped into it. There does not seem to be a problem there.

I am at a loss. What could be the problem?

Edit :

#include <ros/publisher.h>
#include <ros/subscriber.h>
#include <ros/node_handle.h>
#include <sensor_msgs/Image.h>
#include <cv_bridge/cv_bridge.h>
#include <opencv2/core/core.hpp>

std::map<std::string, ros::Publisher> mPublishers;
ros::Subscriber imgSub;

template <class msg_type>
ros::Publisher getPublisher(const std::string& topic)
{

  if (mPublishers.find(topic) == mPublishers.end())
  {
    std::ostringstream ostr;
    ostr << "/" << "dump" << "/" << topic;
    ros::NodeHandle mNh;
    mPublishers[topic] = mNh.advertise<msg_type> (ostr.str(), 0, true);
  }

  return mPublishers[topic];
}

void cb(const sensor_msgs::ImageConstPtr& image_msg)
{
  ros::Time time = image_msg->header.stamp;


  cv_bridge::CvImageConstPtr cvImage = cv_bridge::toCvShare(image_msg, "");
  const cv::Mat& image = cvImage->image;

  sensor_msgs::ImagePtr msg(new sensor_msgs::Image());

  int numBytes = image.step * image.rows;
  msg->data.resize(numBytes);
  for (int i = 0; i < numBytes; ++i)
  {
    msg->data[i] = image.data[i];
  }
  msg->encoding = "rgb8";
  msg->header.stamp = time;
  msg->header.frame_id = image_msg->header.frame_id;
  msg->height = image.rows;
  msg->width = image.cols;
  msg->step = image.step;

  ros::Publisher pub = getPublisher<sensor_msgs::Image>("cascade_faces");
  pub.publish(msg);
}


int main (int argc, char** argv)
{
    // Initialize ROS
  ros::init (argc, argv, "my_template_alignment");

  ros::NodeHandle nh;

  imgSub = nh.subscribe("/camera/rgb/image_rect_color", 1, cb);


  std::cout << "ready!" << std::endl;

    // Spin
  ros::spin ();

  return (0);
}
2011-08-31 01:14:55 -0500 commented answer What topics is my nodelet listening to? (For RGBD6D playback)
If you have the bag file playing, run this to get the point cloud: ROS_NAMESPACE=camera rosrun nodelet nodelet standalone openni_camera/point_cloud_xyzrgb
2011-07-17 22:44:13 -0500 marked best answer rviz does not start, prints "GLXUnsupportedPrivateRequest"

Hi mate,

Xlib: extension "GLX" missing on display ":0.0" is more linux related. Try:

sudo apt-get purge nvidia*
sudo apt-get install --reinstall xserver-xorg-video-intel  libgl1-mesa-glx libgl1-mesa-dri    server-xorg-core
sudo dpkg-reconfigure xserver-xorg
sudo update-alternatives --remove gl_conf /usr/lib/nvidia-current/ld.so.conf

(see https://theiszm.wordpress.com/2010/06/27/glx-missing-on-display/). Do not worry about removing ros packages. You can reinstall them afterwards.

Regards, Tobias

2011-07-17 22:44:13 -0500 received badge  Scholar (source)
2011-07-17 22:44:12 -0500 received badge  Supporter (source)
2011-07-17 22:44:04 -0500 commented answer rviz does not start, prints "GLXUnsupportedPrivateRequest"
That worked! Turns out the nvidia packages _were_ interferring with the 3d acceleration. Now I do not have the error anymore and rviz works like a charm. You have some serious psychic debugging skills :-)
2011-07-14 02:39:30 -0500 received badge  Student (source)
2011-07-14 01:36:09 -0500 commented question rviz does not start, prints "GLXUnsupportedPrivateRequest"
@Asomerville No, this is on a dedicated Kubuntu machine.
2011-07-13 03:55:45 -0500 asked a question rviz does not start, prints "GLXUnsupportedPrivateRequest"

When I try to run rviz, I get the following output:

[reuter@fahrsim04:~]$ rosrun rviz rviz                                                                                                                                                                             (07-13 17:48)
Xlib:  extension "NV-GLX" missing on display ":0.0".
[ INFO] [1310572108.380121383]: Loading general config from [/fzi/ids/reuter/.rviz/config]
[ INFO] [1310572108.380396700]: Loading display config from [/fzi/ids/reuter/.rviz/display_config]
The program 'rviz' received an X Window System error.
This probably reflects a bug in the program.
The error was 'GLXUnsupportedPrivateRequest'.
  (Details: serial 21 error_code 177 request_code 155 minor_code 16)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
[reuter@fahrsim04:~]$

...and the program doesn't run.

Notes:

I get the message Xlib: extension "NV-GLX" missing on display ":0.0". for every glx program I run. I have not been able to determine what is causing this, as this system is using an intel card with an intel driver. All the programs work fine, though, and glxinfo reports that direct rendering is enabled.

A google search about the error has not yielded a solution.

What can I do to get rviz to work?