cameracalibrator.py error when trying to calibrate an approximate synchronized stereo pair
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!
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.
However, running the calibrator as stereo gives me that same error. I need the projection and the rectification matrix for the stareopair.
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.
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.