Ask Your Question
0

cameracalibrator.py error when trying to calibrate an approximate synchronized stereo pair

asked 2012-04-23 06:33:59 -0500

gabe gravatar image

updated 2012-04-23 13:06:49 -0500

joq gravatar image

I'm trying to calibrate a stereo-pair. Both cameras are working and I am using the approximate synchronization feature. I'm using the following launch file to start the stereo pair:

<launch>
<group ns="/stereo" >
<node pkg="camera1394" type="camera1394_node" name="left" args="_guid:=00b09d017643567 >
     <param name="video_mode" value="640x480_mono8" />
 <param name="use_ros_time" value="True" />
 <param name="frame_id" value="camera" />
<param name="camera_info_url" value="file:///home/gabe/.ros/camera_left_mono_test.yaml" />
<remap from="camera" to="left" />
 </node>
 <node pkg="camera1394" type="camera1394_node" name="right" args="_guid:=00b09d0100a74587e"  >
  <param name="video_mode" value="640x480_mono8" />
      <param name="use_ros_time" value="True" />
<param name="frame_id" value="camera" />
<param name="camera_info_url" value="file:///home/gabe/.ros/camera_right_mono_test.yaml" />
     <remap from="camera" to="right" />
  </node>
  </group>

</launch>

then I'm trying to run the camera calibrator and I get the following error

rosrun camera_calibration cameracalibrator.py --approximate=0.1 --size  7x6 --square 0.034 right:=/stereo/right/image_raw left:=/stereo/left/image_raw right_camera:=/stereo/right left_camera:=/stereo/left
Waiting for service /stereo/left/set_camera_info ...
OK
Waiting for service /stereo/right/set_camera_info ...
OK
[ERROR] [WallTime: 1335196035.835285] bad callback: <bound method    Subscriber.callback of <message_filters.Subscriber instance at 0x2c8ed88>>
 Traceback (most recent call last):
 File "/opt/ros/electric/stacks/ros_comm/clients/rospy/src/rospy/topics.py", line 581, in _invoke_callback
cb(msg)
 File "/opt/ros/electric/stacks/ros_comm/utilities/message_filters/src/message_filters/__init__.py", line 72, in callback
self.signalMessage(msg)
File "/opt/ros/electric/stacks/ros_comm/utilities/message_filters/src/message_filters/__init__.py", line 55, in signalMessage
cb(*(msg + args))
File "/opt/ros/electric/stacks/image_pipeline/camera_calibration/src/camera_calibration/approxsync.py", line 70, in add
  msgs = [q[t] for q,t in zip(self.queues, vv)]
  KeyError: rostime.Time[1335196035830033922]

Running the calibrator in mono version for each camera seem to work ok but I want to calibrate the pair. I feel that the error is somehow related to the approximate synchronization, but I don't know exactly where to start.

Could anyone share some insight on this issue? Many Thanks!

edit retag flag offensive close merge delete

Comments

Joq, thanks for the info. As you suspected, the camera ID issue is just a copying error. The launch file for the drivers works for both camera and I can use the calibrator for each individual camera as monocular.

gabe gravatar image gabe  ( 2012-04-25 03:22:23 -0500 )edit

However, running the calibrator as stereo gives me that same error. I need the projection and the rectification matrix for the stareopair.

gabe gravatar image gabe  ( 2012-04-25 03:23:36 -0500 )edit

Thanks Marti, as well. I've tried lowering the parameter value, I believe it deals with the time interval between left and right messages. Lowering the value gets to some point where the program waits because there are no messages with such close timestamps. But I still get that error.

gabe gravatar image gabe  ( 2012-04-25 03:27:23 -0500 )edit

I've had a similar error. Without changing anything it occasionally "just works." I have also tried fixing this with an external metronome to sync my cameras to within 2ms, though it is no more or less effective.

benjaminabruzzo gravatar image benjaminabruzzo  ( 2013-08-22 05:44:50 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2012-04-24 07:24:29 -0500

Hi Gabe,

can you try with a lower --approximate parameter?

It worked for me with

--approximate=0.01
edit flag offensive delete link more

Comments

This fixed it for me as well.

benjaminabruzzo gravatar image benjaminabruzzo  ( 2013-08-22 05:54:31 -0500 )edit
0

answered 2012-04-23 13:17:57 -0500

joq gravatar image

You probably do not want to set the frame_id of both cameras to "camera". That alone might cause your problem. I recommend fixing it, anyway.

Your first args="_guid:=00b09d017643567 is missing the closing " character. Maybe just a copying error. A cleaner way to define that parameter is:

<param name="guid" value="000b09d017643567" />

Each GUID should have exactly 16 hex digits. The newest (Fuerte) driver adds leading zeros as needed, but older versions did not.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-04-23 06:33:59 -0500

Seen: 1,196 times

Last updated: Apr 24 '12