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

Can't find camera calibration file

asked 2017-09-28 17:40:44 -0500

cesarPR gravatar image

updated 2017-09-28 17:58:11 -0500


I'm trying to use a USB Camera, HP HD 4310, with ROS. The thing is, i'm reallu new at ROS, so i must be missing something really basic.

First, I installed uvc_camera.

I confirmed that my camera is in /dev/video1.

Then i have in parallel a roscore running in one terminal, and in another i'm doing:

rosrun uvc_camera uvc_camera_node device:=/dev/video1

This gives me this output:

[ INFO] [1506637439.537106354]: using default calibration URL
[ INFO] [1506637439.537174997]: camera calibration URL: file:///home/cesar/.ros/camera_info/camera.yaml
[ INFO] [1506637439.537215489]: Unable to open camera calibration file [/home/cesar/.ros/camera_info/camera.yaml]
[ WARN] [1506637439.537231103]: Camera calibration file /home/cesar/.ros/camera_info/camera.yaml not found.
opening /dev/video0
pixfmt 0 = 'YUYV' desc = 'YUYV 4:2:2'
  discrete: 640x480:   1/30 1/25 1/20 
  discrete: 160x120:   1/30 1/25 1/20 
  discrete: 176x144:   1/30 1/25 1/20 
  discrete: 320x240:   1/30 1/25 1/20 
  discrete: 352x288:   1/30 1/25 1/20 
  int (Brightness, 0, id = 980900): -64 to 64 (1)
  int (Contrast, 0, id = 980901): 0 to 64 (1)
  int (Saturation, 0, id = 980902): 0 to 128 (1)
  int (Hue, 0, id = 980903): -180 to 180 (1)
  bool (White Balance Temperature, Auto, 0, id = 98090c): 0 to 1 (1)
  int (Gamma, 0, id = 980910): 100 to 500 (1)
  int (Gain, 0, id = 980913): 0 to 128 (1)
  menu (Power Line Frequency, 0, id = 980918): 0 to 2 (1)
    0: Disabled
    1: 50 Hz
    2: 60 Hz
  int (White Balance Temperature, 16, id = 98091a): 2800 to 6500 (10)
  int (Sharpness, 0, id = 98091b): 0 to 8 (1)
  int (Backlight Compensation, 0, id = 98091c): 0 to 1 (1)
  menu (Exposure, Auto, 0, id = 9a0901): 0 to 3 (1)
  int (Exposure (Absolute), 16, id = 9a0902): 50 to 10000 (1)

And stays here infinitly.

As you can see, it wasn't able to find the calibration file and so it changed to /dev/video0. The thing is, i don't even know why is he trying to look in "/home/cesar/.ros/camera_info/camera.yaml". I never specified that path, or any path. The file ".ros" in "/home/cesar" doesn't exist.

So, can someone tell me what I'm doing wrong please?

edit retag flag offensive close merge delete


re: really new to ROS: you might want to see whether you'd like to pick up a book or two. See wiki/Books for a listing of some ROS books. I can recommend A Gentle Introduction to ROS for the basics.

gvdhoorn gravatar image gvdhoorn  ( 2017-09-29 02:47:35 -0500 )edit

Thank you for your recommendation, the thing is that i will not need to develop code for ROS, I will be running SLAM algorithms, that are already done, so, I only need to manage and put the algorithm working

cesarPR gravatar image cesarPR  ( 2017-09-29 10:23:25 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-09-29 02:45:56 -0500

gvdhoorn gravatar image

As you can see, it wasn't able to find the calibration file and so it changed to /dev/video0.

it might look like that, but that is not what is happening.

Camera calibration files are just configuration files that contain information on certain characteristics of your camera (the intrinsics). Those then allow other components to process images produced by that camera. See the camera_calibration page for some more background information.

Even without that file uvc_camera will publish images (if everything else is ok), but other nodes just will not know anything about your camera's intrinsics (and so will not be able to compensate for things like lens distortions). See #q256300 for a related question.

rosrun uvc_camera uvc_camera_node device:=/dev/video1

The node opened video0 because - just as in #q271685 - you forgot to prefix device with an underscore (_). Without that underscore, rosrun will interpret device as a topic name (used when remapping), not a parameter. See wiki/rosbash - rosrun where this is explained.

As @ahendrix in #q271685 explained, you'll need to start the node as follows:

rosrun uvc_camera uvc_camera_node _device:=/dev/video1

That will make the node attempt to open /dev/video1.

The thing is, i don't even know why is he trying to look in "/home/cesar/.ros/camera_info/camera.yaml". I never specified that path, or any path.

$HOME/.ros/camera_info/camera.yaml is just the default path and file that ROS camera drivers will look for camera calibration files, if you haven't provided it with a specific URL to override that location.

The file ".ros" in "/home/cesar" doesn't exist.

and that is 'normal', as you probably haven't calibrated your USB camera yet. You will want to do that though - once you get the node to start up. See the How to Calibrate a Monocular Camera tutorial for one way to do that.

edit flag offensive delete link more


When i add the ( _ ) to device the result is exactly the same. But the problem must be as you said from having not yet calibrated the camera.

cesarPR gravatar image cesarPR  ( 2017-09-29 10:48:02 -0500 )edit

Already managed to get this working, in fact i only needed to calibrate the camera. Thank you so much @gvdhoorn

cesarPR gravatar image cesarPR  ( 2017-09-29 16:36:56 -0500 )edit

Question Tools



Asked: 2017-09-28 17:40:44 -0500

Seen: 15,951 times

Last updated: Sep 29 '17