0
$\begingroup$

Rosanswers logo

Hi everyone,

i just bought a minoru 3d webcam to try using it as a low cost RGBD sensor, i'm working in ros indigo, i tried calibrationg the camera with the cameracalibrator.py util, the problem is that no matter how much frames i take the extrinsic calibration always fail because with the driver i was using there is too much lag between the frames of the two channels ( the camera is not synchronized ).

I tried several other drivers and the best so far ( the one that gives the best visual results in terms of lag ) seems the "usb_cam" driver. But if i use this driver the cameracalibrator.py node can't start i think this problem is related to the "set_camera_info" service as described in this link:

http://www.iheartrobotics.com/2010/05/testing-ros-usb-camera-drivers.html

The fix they suggest in the python code is already present in my version but still it doesn't work. I don't need that service, since i just need to get calibration matrices i can set manually the calibration files. What can i do? Thank you all in advance!

EDIT: Here is my launch file:

<launch>

<node name="left_camera" pkg="usb_cam" type="usb_cam_node" output="screen" >
    
    <param name="video_device" value="/dev/video1" />
    <param name="image_width" value="320" />
    <param name="image_height" value="240" />
    <param name="pixel_format" value="yuyv" />
    <param name="camera_frame_id" value="usb_cam" />
    <param name="io_method" value="mmap"/>
    
</node>

<node name="right_camera" pkg="usb_cam" type="usb_cam_node" output="screen" >
    
    <param name="video_device" value="/dev/video2" />
    <param name="image_width" value="320" />
    <param name="image_height" value="240" />
    <param name="pixel_format" value="yuyv" />
    <param name="camera_frame_id" value="usb_cam" />
    <param name="io_method" value="mmap"/>
    
</node>

</launch>

And this is the command i use to launch the camera calibrator:

    rosrun camera_calibration cameracalibrator.py --size 9x6 --square 0.011 right:=/right_camera/image_raw left:=/left_camera/image_raw right_camera:=/right_camera left_camera:=/left_camera --no-service-check

And when i do so, simply nothing happens, no errors, no crashes. Maybe it keeps waiting for something?

This is the output of the rostopic list command:

/left_camera/camera_info
/left_camera/image_raw
/left_camera/image_raw/compressed
/left_camera/image_raw/compressed/parameter_descriptions
/left_camera/image_raw/compressed/parameter_updates
/left_camera/image_raw/compressedDepth
/left_camera/image_raw/compressedDepth/parameter_descriptions
/left_camera/image_raw/compressedDepth/parameter_updates
/left_camera/image_raw/theora
/left_camera/image_raw/theora/parameter_descriptions
/left_camera/image_raw/theora/parameter_updates
/right_camera/camera_info
/right_camera/image_raw
/right_camera/image_raw/compressed
/right_camera/image_raw/compressed/parameter_descriptions
/right_camera/image_raw/compressed/parameter_updates
/right_camera/image_raw/compressedDepth
/right_camera/image_raw/compressedDepth/parameter_descriptions
/right_camera/image_raw/compressedDepth/parameter_updates
/right_camera/image_raw/theora
/right_camera/image_raw/theora/parameter_descriptions
/right_camera/image_raw/theora/parameter_updates
/rosout
/rosout_agg

EDIT2:

I've edited my launch file to use uvc_camera:

<launch>
<node pkg="uvc_camera" type="uvc_stereo_node" name="uvc_camera_stereo">
    
    <param name="width" type="int" value="640" />
    <param name="height" type="int" value="480" />
    <param name="fps" type="int" value="20" />
    <param name="frame" type="string" value="minoru" />

    <!-- other supported params: auto_exposure, exposure_absolute, brightness, power_line_frequency -->

    <param name="left/device" type="string" value="/dev/video1" />
    <param name="right/device" type="string" value="/dev/video2" />
    <param name="left/camera_info_url" type="string" value="file://$(find uvc_camera)/example-left.yaml" />
    <param name="right/camera_info_url" type="string" value="file://$(find uvc_camera)/example-right.yaml" />
    
</node>
</launch>

Now the cameracalibrator starts properly, but i can see on the calibration window that the frames are still visually unsynchronized (i.e. if i blink i don't see this happening simultaneously in the two visualization windows ) I've also tried different resolutions and framerates.

I also added the flag --approximate=0.01 up to 0.05 ( it crashes at 0.1 )`


Originally posted by radisc on ROS Answers with karma: 61 on 2014-10-16

Post score: 1


Original comments

Comment by ahendrix on 2014-10-16:
Please edit your question to include a copy and paste of the exact command and the exact error message you get when starting the camera calibration.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Two things to try:

  • Add the --approximate=0.01 flag to the cameracalibrator to compensate for the timestamp mismatch between cameras. You can try slowly increasing the value until it works, but if you increase the value to something above the inter-frame period for your camera, it probably isn't working.(documented here)
  • Try the stereo_node from the uvc_camera package. The docs indicate that it will publish synchronized image pairs from a pair of unsynchronized cameras.

EDIT:

You have cheap cameras that are not synchronized in hardware. These techniques will help match up the most closely captured images, but they won't fix the underlying synchronization problem.


Originally posted by ahendrix with karma: 47576 on 2014-10-19

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by andreasBihlmaier on 2014-10-21:
I can confirm that uvc_camera works well for stereo with independent usb webcams.

Comment by radisc on 2016-11-02:
Thank you very much, the "--approximate" flag worked! (Sorry for the ale answer)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.