A vision based algorithm for active robot localization