[ros-users] Problems with viewing a USB camera feed in RVIZ

Bill Morris morris at ee.ccny.cuny.edu
Fri Jul 2 18:12:51 UTC 2010


I have it patched here with c-turtle support for camera_info_manager.
http://robotics.ccny.cuny.edu/git/usb_cam.git

This is a work in progress until I can finish adding dynamic
reconfigure. Code cleanup and documentation needs to be finished but if
you want to try it feel free.

On Fri, 2010-07-02 at 11:01 -0700, Rob Wheeler wrote:
> I recently located a memory leak in the usb_cam package and gave a
> patch to the authors.  It doesn't look like it has been released yet.
> You might try applying this patch to usb_cam and see if helps with
> problem #3
> 
> Index: src/libusb_cam/usb_cam.cpp
> ===================================================================
> --- src/libusb_cam/usb_cam.cpp    (revision 108)
> +++ src/libusb_cam/usb_cam.cpp    (working copy)
> @@ -334,6 +334,7 @@
>  
>    video_sws = sws_getContext( xsize, ysize, avcodec_context->pix_fmt,
> xsize, ysize, PIX_FMT_RGB24, SWS_BILINEAR, NULL, NULL, NULL);
>    sws_scale(video_sws, avframe_camera->data,
> avframe_camera->linesize, 0, ysize, avframe_rgb->data,
> avframe_rgb->linesize );
> +  sws_freeContext(video_sws);
>  //  img_convert((AVPicture *) avframe_rgb, PIX_FMT_RGB24, (AVPicture
> *) avframe_camera, avcodec_context->pix_fmt, xsize, ysize);
>  
>    int size = avpicture_layout((AVPicture *) avframe_rgb,
> PIX_FMT_RGB24, xsize, ysize, (uint8_t *)RGB, avframe_rgb_size);
> 
> On Fri, Jul 2, 2010 at 10:54 AM, Josh Faust <jfaust at willowgarage.com>
> wrote:
>         rviz's Camera display is meant for a camera running on a robot
>         that's set up properly (with TF, calibrated cameras, etc.).
>          It lets you see the 3D data with the camera image overlaid.
>          If you just want to view an image, image_view is the correct
>         option. 
>         
>         
>         As for #3, does rviz's memory usage start going up during that
>         time?  If it was killed, either it (or something else) was
>         consuming a lot of memory, or someone else killed it. 
>         
>         
>         Josh
>         
>         
>         On Fri, Jul 2, 2010 at 4:27 AM, Benoit Larochelle
>         <Benoit.Larochelle at dfki.de> wrote:
>         
>                 
>                 Hello, 
>                   
>                 I'm trying to set-up RVIZ so that I can view the feed
>                 from my USB camera. I am using the usb_cam package to
>                 produce the feed, but RVIZ seems to have a few
>                 problems reading it. I set-up the Fixed Frame
>                 to /head_camera, and Image Topic
>                 to /usb_cam/image_raw. 
>                   
>                 1) I get a global warning: No tf data. Actual error:
>                 Fixed Frame [/head_camera does not exist]. I don't
>                 know exactly what transforms and frames are, I just
>                 want to see my camera image (in RVIZ). 
>                   
>                 2) In the Camera section, I get a Status Error, under
>                 CameraInfo: CameraInfo/P resulted in an invalid
>                 position calculation (nans or infs) 
>                   
>                 3) After 15 minutes or so, RVIZ crashes with the error
>                 message: /opt/ros/boxturtle/ros/bin/rosrun: line 35:
>                 304 Killed $exepath "$@" (before lunch, I started RVIZ
>                 and image_view and when I came back RVIZ had crashed
>                 and image_view was still going) 
>                   
>                 4) The image is much darker than with the
>                 package image_view 
>                   
>                 Benoit 
>                 
>                 
>                 _______________________________________________
>                 ros-users mailing list
>                 ros-users at code.ros.org
>                 https://code.ros.org/mailman/listinfo/ros-users
>                 
>                 
>         
>         
>         
>         _______________________________________________
>         ros-users mailing list
>         ros-users at code.ros.org
>         https://code.ros.org/mailman/listinfo/ros-users
>         
> 
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users





More information about the ros-users mailing list