fixed some bugs related to generation of the scan, visualization of detected position