The automatic design of controllers for mobile robots usually requires two stages. In the first stage,sensorial data are preprocessed or transformed into high level and meaningful values of variables whichare usually defined from expert knowledge. In the second stage, a machine learning technique is applied toobtain a controller that maps these high level variables to the control commands that are actually sent tothe robot. This paper describes an algorithm that is able to embed the preprocessing stage into the learningstage in order to get controllers directly starting from sensorial raw data with no expert knowledgeinvolved. Due to the high dimensionality of the sensorial data, this approach uses Quantified Fuzzy Rules(QFRs), that are able to transform low-level input variables into high-level input variables, reducingthe dimensionality through summarization. The proposed learning algorithm, called Iterative QuantifiedFuzzy Rule Learning (IQFRL), is based on genetic programming. IQFRL is able to learn rules with differentstructures, and can manage linguistic variables with multiple granularities. The algorithm has been testedwith the implementation of the wall-following behavior both in several realistic simulated environmentswith different complexity and on a Pioneer 3-AT robot in two real environments. Results have beencompared with several well-known learning algorithms combined with different data preprocessingtechniques, showing that IQFRL exhibits a better and statistically significant performance. Moreover,three real world applications for which IQFRL plays a central role are also presented: path and objecttracking with static and moving obstacles avoidance.