chicagoedt / revo_robot

Code for EDT's IGVC entry, Revo.
http://www.igvc.org/
20 stars 23 forks source link

line_detection crashes when node is launched before rosbag #61

Closed bsubei closed 9 years ago

bsubei commented 9 years ago

something about j < nimages in function histPrepareImages. Has to do with the histogram backprojection filter.

This was recently introduced around 9718900ca444a49e9dc95f32435a3ac2b8a976d6

bsubei commented 9 years ago

turns out the roi parameters from dynamic_reconfigure sometimes don't have enough time to be sent to line_detection and it tries to use the default ones but fails. I fixed it by checking whether they're valid. If not, just use the entire image.

bsubei commented 9 years ago

I need to pursue why the configs are not being sent if line_detection node is started before the bag. (maybe this has something to do with whether the dynamic_reconfig node is launched before the line_detection node?)

bsubei commented 9 years ago

it turns out the actual problem was that the image dimensions are set to 0 by default on initialization, and are only set when an image is first received. This results in invalid roi values set in validate_parameters().