Ask Your Question

pedro_abreu's profile - activity

2017-04-27 20:04:16 -0600 received badge  Famous Question (source)
2017-03-22 03:25:21 -0600 received badge  Popular Question (source)
2017-03-22 03:25:21 -0600 received badge  Notable Question (source)
2016-11-21 19:30:48 -0600 received badge  Notable Question (source)
2016-11-21 19:30:48 -0600 received badge  Popular Question (source)
2016-11-21 19:30:48 -0600 received badge  Famous Question (source)
2016-09-07 06:23:58 -0600 asked a question V4L2_CID_FOCUS_AUTO is not supported.

Whenever I run the default test file from the usb_cam package and use a recent bought camera I get the two following statements: V4L2_CID_FOCUS_AUTO is not supported. [WARNING] unknown control focus_auto

I have already found that the driver source has a block of code regarding the autofocus, but I do not getwhat the unknown control message means. I've tried setting the parameter autofocus to false as explained in the usb_cam documentation, but it didn't seem to work. It seems like I should edit the driver source code but I'm not sure how... (the part I'm talking about):

void UsbCam::set_auto_focus(int value){
struct v4l2_queryctrl queryctrl;
struct v4l2_ext_control control;

memset(&queryctrl, 0, sizeof(queryctrl));
queryctrl.id = V4L2_CID_FOCUS_AUTO;

if (-1 == xioctl(fd_, VIDIOC_QUERYCTRL, &queryctrl))
{
  if (errno != EINVAL)
  {
     perror("VIDIOC_QUERYCTRL");
     return;
  }
  else
  {
  //ROS_INFO("V4L2_CID_FOCUS_AUTO is not supported");
  return;
   }
 }
 else if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
 {
    //ROS_INFO("V4L2_CID_FOCUS_AUTO is not supported");
  return;
 }
 else
 {
   memset(&control, 0, sizeof(control));
   control.id = V4L2_CID_FOCUS_AUTO;
   control.value = value;

   if (-1 == xioctl(fd_, VIDIOC_S_CTRL, &control))
   {
     perror("VIDIOC_S_CTRL");
  return;
}

} }

2016-07-27 18:00:13 -0600 received badge  Enthusiast
2016-07-17 00:41:22 -0600 asked a question Issue with usb_cam: select timeout yuyv usb_cam package

Hello, so my issue has to do with the yuyv pixel format in the usb_cam package. My launch file and everything works well with mjpeg and I can't understand why. I have installed and reinstalled OpenCV twice now (I'm running Ubuntu 14.04.4), from compiling the source code AND from script(repositories) and two different versions. Whenever I launch my launch file (with yuyv pixel format), the image halts, gets chopped up like this and I get:

[ERROR]: select timeout

And then the process dies. I've also installed the perception ROS package for image processing. Here is my launch file

<launch>
  <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" >
    <param name="/dev/video0" value="/dev/video0" />
    <param name="image_width" value="640" />
    <param name="image_height" value="480" />
    <param name="pixel_format" value="yuyv" />
    <param name="camera_frame_id" value="usb_cam" />
    <param name="io_method" value="mmap"/>
    <param name="framerate" value="60"/>
    <param name="sharpness" value="255"/>
    <param name="contrast" value="30"/>
    <param name="brightness" value="0"/>
    <param name="saturation" value="50"/>
  </node>
  <node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">
    <remap from="image" to="/usb_cam/image_raw"/>
    <param name="autosize" value="true" />
  </node>
</launch>

Is this some sort of problem with the buffer size since the resolution is too high? Maybe the framerate is too high? I've changed both to half and saw no results so I don't think that's it. I've been looking around but most people seem to have issues with select timeout all around, not just on one pixel format.

Thank you