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

StFS's profile - activity

2019-11-04 01:30:15 -0500 received badge  Nice Question (source)
2016-12-03 17:02:30 -0500 received badge  Good Question (source)
2014-04-24 13:11:50 -0500 received badge  Nice Question (source)
2014-01-28 17:26:29 -0500 marked best answer Converting ROS image to QImage

Hello.

I'm making a Qt based GUI for our ROS application and part of it is to display images from a ROS topic.

I've managed to create a descendant class of QLabel that displays an RGB image from our cameras (/camera/image_raw topic) but when I try to display a grayscale image /camera/image_mono) I get weird results.

Here is the code I'm using:

img_format_table = {'rgb8': QtGui.QImage.Format_RGB888, 'mono8': QtGui.QImage.Format_Mono}

...

    def up_camera_callback(self, data):
        try:
            format = img_format_table[data.encoding]

            image = QtGui.QImage(data.data, data.width, data.height, format)
            self.up_camera_signal.emit(image)

        except Exception, e:
            rospy.logerr(e)

The up_camera_signal is connected to my "video display" widget and just displays the image on it. As I said, this works fine for RGB images (when the data.encoding is 'rgb8') but if I do this for 'mono8' images I see strange results:

image description

I have also tried mapping 'mono8' to QtGui.QImage.Format_MonoLSB but that doesn't change anything (documentation for the QImage formatting is at http://www.pyside.org/docs/pyside/PySide/QtGui/QImage.html).

Can anyone comment on this? Is there anything specific about the mono8 format in ROS that might be causing these problems?

Kind regards, Stefan Freyr

2014-01-28 17:26:08 -0500 marked best answer How do I test the ROS version in Python code?

This has been asked for C++ (http://answers.ros.org/question/9562/how-do-i-test-the-ros-version-in-c-code/) but it would be good to know what the correct way to do this is in Python.

There is a python script called rosversion which does this in a bit of an awkward way IMO. It does it by checking whether the "ROS_DISTRO" environment variable exists and, if not, it parses an XML file (roscore.xml). This seems quite complicated and it only gives you the release name (cturtle, electric, fuerte, etc.).

Is there a way to get access to those nice looking DEFINES like in the C++ code? Even having just the functionality of the rosversion script somewhere in an official ROS Python API function would be better than nothing (just getting the release name).

2014-01-28 17:25:56 -0500 marked best answer Maintaining backwards compatibility (opencv2 problem)

Hi.

I have a bunch of packages that were developed on ROS CTurtle but now I'm trying to upgrade them to compile on Fuerte.

Most of it just works, but I am having problems with one of my packages that link against OpenCV.

Very briefly, I found out that in Fuerte I need to put the following in my CMakeLists.txt:

find_package(OpenCV REQUIRED)

rosbuild_add_executable(foo src/foo.cpp)
target_link_libraries(foo ${OpenCV_LIBRARIES})

This works fine for Fuerte, but unfortunately, when I try to build now on CTurtle I get an error stating that the FindOpenCV.cmake file could not be found.

To fix that, I added the following above the find_package line:

set(OpenCV_DIR /opt/ros/cturtle/stacks/vision_opencv/opencv2/opencv/share/opencv/)

Now, my stuff compiles on CTurtle, but since the cturtle path is now hard-coded into the CMakeLists.txt file, it fails on Fuerte!

So my question (finally) is, is there a way to maintain "backwards compatibility" so I can build my packages on top of both CTurtle and Fuerte? Am I maybe doing something wrong (having to specify the OpenCV_DIR variable doesn't look like it should have to be done)? Is there a way to selectively define the variable only if I'm doing it on CTurtle?

Kind regards, Stefan Freyr

2014-01-28 17:25:44 -0500 marked best answer Install of ros-fuerte-camera1394 fails on Ubuntu 12.04

Hi.

I'm trying to install the camera1394 package on my fuerte intallation on Ubuntu 12.04 but I'm running into dependency problems.

The problem is that the ros-fuerte-camera1394 package (in the ROS Ubuntu repository) depends on a package called libdc1394-22-dev. This package comes from the ROS package repository but unfortunately it conflicts with the libdc1394-22 package from the official Ubuntu repository. That package then is a dependency for a huge number (200+) of other packages so removing it is not really an option.

So my question is basically whether this is something that is being solved or is there some workaround for this?

Best regards, Stefán Freyr.

2013-04-03 15:20:32 -0500 received badge  Famous Question (source)
2013-02-20 04:38:28 -0500 commented answer Multiple Point Grey Chameleon USB cameras unstable

@Eruditass so my advice would be to: 1) upgrade to the latest PointGray driver, 2) use external power to the cameras through GPIO and 3) try to switch the order in which you have your cameras defined in your launch script.

2013-02-20 04:37:03 -0500 commented answer Multiple Point Grey Chameleon USB cameras unstable

@Eruditass sorry no we didn't. We never had a USB3 bus though so that may be a different problem. I seem to recall some mention of a fix in PointGray release notes recently concerning USB2 cameras on a USB3 bus.

2013-02-20 04:29:13 -0500 marked best answer Multiple Point Grey Chameleon USB cameras unstable

Hello.

This will be a rather fuzzy question and I apologize for that in advance.

We have two Point Grey Chameleon (http://ptgrey.com/products/chameleon/chameleon_usb_camera.asp) cameras connected to our computer and we're using the camera1394 driver to publish them in ROS.

We've been having instability problems with our setup which seem to be very difficult to debug and analyze.

We know (now) that the USB 2.0 cameras aren't exactly the best option for robot vision and running two like the Chameleon (with a resolution of 1296x964) might be stretching the limit a little.

However, the annoying thing is that we've been able to run the cameras without problems. It works often, but not nearly always. Sometimes we have "rough patches" where things behave unusually bad (tonight was one such night). But as I said, once the cameras are up, they seem to stay up as long as we don't kill the image_proc process. If, however, the image_proc process reports an error (segfaults), we seem to need to hard reboot the computer and cut off power to the cameras (they are powered through both USB and GPIO since USB power alone didn't seem to cope with two of these).

So my question is basically whether anybody has experience or tips with running multiple (higher end) USB cameras through the camera1394 driver? Maybe even the Point Grey Chameleon cameras? What can we do to make this less error prone?

I just found some code that seems to offer a driver for image_proc directly on top of the PGR SDK (http://www.roschina.net/ros/www.ros.org/wiki/pgr_camera_driver.html), I'll try that out tomorrow but I'd like to hear if anybody has experience with that.

Kind regards, Stefan Freyr

UPDATE: A bit more information about this.

I just updated the firmware on both cameras. After that I did a little more structured testing, shutting down and cutting all power to both the computer and cameras. After booting up I tried launching both cameras and that worked. I killed that launch and tried again and got the segfault. Then I tried running each camera individually and that works fine. Then I tried running flycap (the Point Grey image viewer and configuration tool) and that works for each camera individually and (and here's the kicker) it also works to fire up two flycap instances and view both cameras simultaneously! After that I tried running both cameras from a ROS launch script but I get the segfault.

I'm trying to get more information about the segfault but I can't find anything in the log files. Is there a way to make the log files more verbose for camera1394? Do I need to compile the camera1394 driver again and if so, how do I do that cleanly on a setup using the Ubuntu packages?

This seems to be some sort of a pickle with the camera1394 since both cameras are ... (more)

2013-01-04 09:33:38 -0500 received badge  Famous Question (source)
2013-01-04 09:33:38 -0500 received badge  Popular Question (source)
2013-01-04 09:33:38 -0500 received badge  Notable Question (source)
2012-10-27 09:13:42 -0500 marked best answer Undefined reference in cvBridge.h

I just updated to Fuerte and Ubuntu 12.04 and I'm trying to build my ROS pacakges on it.

I'm getting errors in my OpenCV code which may be because the OpenCV code I'm building is a little old.

Here's the full build log for the package that's giving me errors: http://paste.ubuntu.com/991395/

And here's the code for ImageRecording.cpp (which seems to be the source of all these 'undefined reference' errors): http://paste.ubuntu.com/991411/

What I'm confused about is that I'm not getting a compiler error, but a linker error. I would have understood getting a compiler error since the code is outdated and maybe the API we were using back then is not supported anymore, but a linker error indicates that the same API is still there but somehow the setup of the whole thing is broken in some way.

Any insight into this would be greatly appreciated.

Kind regards, Stefan Freyr.

2012-09-06 20:08:28 -0500 received badge  Famous Question (source)
2012-09-06 20:08:28 -0500 received badge  Notable Question (source)
2012-09-06 20:08:28 -0500 received badge  Popular Question (source)
2012-09-05 04:07:54 -0500 received badge  Notable Question (source)
2012-09-05 04:07:54 -0500 received badge  Famous Question (source)
2012-09-05 04:07:54 -0500 received badge  Popular Question (source)
2012-08-28 19:46:21 -0500 received badge  Notable Question (source)
2012-08-28 19:46:21 -0500 received badge  Famous Question (source)
2012-08-28 19:46:21 -0500 received badge  Popular Question (source)
2012-08-26 09:47:08 -0500 received badge  Famous Question (source)
2012-08-26 09:47:08 -0500 received badge  Notable Question (source)
2012-08-26 09:47:08 -0500 received badge  Popular Question (source)
2012-08-17 04:59:56 -0500 received badge  Notable Question (source)
2012-08-17 04:59:56 -0500 received badge  Popular Question (source)
2012-08-17 04:59:56 -0500 received badge  Famous Question (source)
2012-08-15 10:48:00 -0500 received badge  Notable Question (source)