Map building from range data using mathematical morphology