ethz-asl / ethzasl_ptam

Modified version of Parallel Tracking and Mapping (PTAM)
http://wiki.ros.org/ethzasl_ptam
235 stars 184 forks source link

CameraCalibrator crashes #74

Closed ssampang closed 9 years ago

ssampang commented 9 years ago

Hi guys,

CameraCalibrator has started to randomly crash on me and I'm not sure why. I can't stream directly from a webcam, so I use a gopro, take a video of the checkerboard from multiple (close) angles, convert the video to png files, and read in the images with OpenCV, convert with cv_bridge, and publish them to an image topic at a rate of 10 Hz. This has worked well for me when I tested it with rosrun image_view image_view image:=/camera/image and even ptam itself in the past, but currently, the calibrator crashes with output

Gui is on
bad copy: [0 0] [0 0] [0 0] [0 0] [0 0]
[cameracalibrator-1] process has died [pid 9573, exit code -11, cmd /home/sampangi/catkin_ws/devel/lib/ptam/cameracalibrator image:=camera/image pose:=pose __name:=cameracalibrator __log:=/home/sampangi/.ros/log/5479982a-3652-11e5-ba1d-f81a670e1ef3/cameracalibrator-1.log].
log file: /home/sampangi/.ros/log/5479982a-3652-11e5-ba1d-f81a670e1ef3/cameracalibrator-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

These crashes are sporadic. Sometimes they occur immediately after starting the calibrator, and sometimes they take >30 seconds. Also, the /home/sampangi/.ros/log/5479982a-3652-11e5-ba1d-f81a670e1ef3/cameracalibrator-1*.log logfile it mentions doesn't exist. Other log files are created, but none with that name, which I find peculiar.

Finally, rosrun image_view image_view image:=/camera/image only works sometimes now - otherwise hanging indefinitely after outputting

[ INFO] [1438229254.292871265]: Using transport "raw"

I'm completely new to ROS and ptam, so I could very well be making some basic mistakes. I'd really appreciate any help on this.

ssampang commented 9 years ago

I've narrowed the issue down to the line that causes the crash. Line 65 (CVD::copy(img_tmp, mCurrentImage);) in function CameraCalibrator::imageCallback of CameraCalibrator.cc results in the output bad copy: [0 0] [0 0] [0 0] [0 0] [0 0] and an eventual crash. I'm now wondering if this means that somehow the the callback function is being passed an empty image..?

ssampang commented 9 years ago

Ok, it seems that the crashes were simply due to feeding the calibrator extreme viewpoints with quite a few squares of the checkerboard being out of frame. Using a video that always contained corners at more direct angles fixed all issues.

inga890 commented 5 years ago

Hey, can you please share the code adjustments you did in order to be able to use video as input without the camera?

Thanks!