Transportation systems are highly complex and affect the life of every person. Mathematics played a central role in studying these systems with many different approaches. We focus the attention on vehicular traffic and two main technological disruptions of last 20 years: the first occurred with flood of data from mobile sensors and the second the ongoing ones with increasing autonomy in driving. Also in this case mathematics is playing a fundamental role.