Full text
Innovating Urban Mobility With Digital Twins: Data-Driven Traffic Visualization and Testing Mariana Perna∗, Bernardo Pinto∗, Jos´ e Mendes∗, Rafaela Dias∗, Filipe Obrist∗ Pedro Rito∗†, Susana Sargento∗†, Duarte Raposo†, Filipe Pinto‡ ∗Departamento de Electr´ onica, Telecomunicac¸ ˜ oes e Inform´ atica, Universidade de Aveiro, 3810-193 Aveiro, Portugal †Instituto de Telecomunicac¸ ˜ oes, Universidade de Aveiro, 3810-193 Aveiro, Portugal ‡Altice Labs, 3810-106 Aveiro, Portugal Abstract—This paper proposes an urban and mobility-based Digital Twin that provides the representation of an urban scenario with both real and simulated mobility data of vehicles, 2-wheelers and people. The platform integrates real-time data from the Aveiro Tech City Living Lab (ATCLL) with 2D and 3D visualizations using SUMO and CARLA, respectively, enabling detailed traffic analysis and management. Key functionalities include the synchronization of real-world sensor data with simulated environments, providing accurate and dynamic traffic visualizations. The platform also supports the change and blocking of intersections, roundabouts and lanes, being able to test scenarios when the road conditions change, anticipating the impact of those changes in the urban mobility. The platform results show that they can help decision makers to optimize the traffic flow and anticipate changes in the roads, providing information on the travel times, CO2emissions and congestion in the roads. Index Terms—Digital Twin, Urban Simulation, Smart-City, SUMO, CARLA, Traffic Management, V2X, ITS-G5 I. INTRODUCTION The rapid growth of urbanization has brought many environmental and social challenges, making efficient city management more challenging. As cities expand, finding new ways to handle urban problems, particularly in traffic systems, becomes more urgent. Smart cities have emerged as a promising response that incorporates new technologies to improve urban living conditions. However, the dynamic and unpredictable nature of urban environments, especially in traffic management, continues to pose significant obstacles. Traditional methods often fail to predict and address issues such as sudden road closures or unexpected traffic jams, which cause major disruptions. Digital Twin technologies offer a promising solution by digitally representing the city and enabling transversal simulations to improve traffic management. Several studies have explored their potential in different contexts. [1] shows how SUMO can use real-time data to dynamically adjust traffic flows, ensuring accurate simulations. Another study in [2] integrates vehicles and pedestrians into a shared simulation, improving safety analysis for Intelligent Transportation Systems (ITS). [3] shows the use of CARLA to create detailed 3D models, highlighting the value of realistic visualizations. The work in [4] uses sensors and edge computing on roadside units (RSUs) and connected vehicles to create a real-time digital representation, aiding automated vehicles in avoiding traffic congestion through cooperative environment perception. The work in [5] describes a data-driven traffic simulation model which uses real-time data to simulate current traffic conditions. Lastly, [6] details the optimization of traffic light timings in Chattanooga’s MLK Smart Corridor, utilizing the capabilities of ITS, including sensors and V2X communications. These studies form the foundation of our work and demonstrate the versatility of Digital Twins in urban planning. Building on their contributions, our work proposes a Digital Twin platform that combines real-time data from radars and video cameras with advanced simulations in SUMO and CARLA. Our platform visualizes real-world traffic data from the Aveiro Tech City Living Lab (ATCLL) [7] (and can receive mobility data from a different platform), and generates realistic simulations, providing a deeper understanding of traffic patterns. This enables early detection of potential issues, ensuring practical and reliable solutions. Validating these simulations with real data ensures that the platform’s insights are grounded in reality, making them more relevant and applicable to real-world urban scenarios. Moreover, the platform enables the blocking of roads and roundabouts, enables resimulation, and provides a set of statistics for the vehicles, roads and environment. The results show the functionalities of the platform both in programmed and emergency events, and how they can help city planners to predict mobility when traffic is increased or decreased in the city, and to analyze scenarios such as road blockages and multi-modal transportation, enhancing their ability to predict and manage traffic dynamics. This paper is organized as follows. Section II describes the architecture of our Digital Twin platform, detailing its core components and data integration processes. Section III presents the experimental results, validating the platform’s effectiveness in different scenarios. Finally, Section IV concludes the paper and suggests directions for future research. II. ARCHITECTURE AND FUNCTIONALITIES Figure 1 presents the architecture of the Digital Twin platform. The left part of the figure illustrates the compo-
Fig. 1. Digital Twin Architecture and ATCLL nents of the ATCLL, showcasing the Smart City of Aveiro, Portugal, as an example of integration. This living lab includes mobility sensors, such as radars and video cameras, capable of detecting people, bicycles, and vehicles on the road, providing real-time data on the city’s dynamics. Apart from the physical sensors, ATCLL already includes a data processing pipeline to expose perception information to other services. For realtime data, an MQTT broker may be used, while access to historical data is provided through the FIWARE STH-Comet API, which queries data stored in MongoDB. Notice that ATCLL is included as a real example, but the Digital Twin platform can use data from a different sensing infrastructure. The Digital Twin platform, shown on the right side of the figure, includes consumers for real and simulated data, which collect the relevant data and feed it into the 2D (SUMO) and 3D (CARLA) visualization interfaces. Traffic Control Interface (TraCI)1allows to retrieve values of simulated objects and to manipulate their behavior “on-line”, and then providing the platform to integrate both simulated and real data. This platform also contains a User Interface where users can, for example, insert simulated vehicles, bicycles and pedestrians into the simulation during runtime. The request for creating simulated data is sent to the Digital Twin API, and the Simulated Data Producer is responsible for creating the simulated data. This data is then published to a local MQTT broker, and, as mentioned earlier, the real and simulated data consumer module consumes this data to insert it into the simulation via the TraCI API. TraCI uses a TCP-based client/server architecture to provide access to SUMO, allowing for various operations such as defining routes for vehicles, modifying simulation parameters, obtaining information about the current traffic state, and much more. The interface plays a crucial role by enabling communication to the simulation platforms. It ensures that all user-requested changes are implemented accurately and in real-time, preserving the integrity and responsiveness of the visualization. Additionally, there are two graphical interfaces: the SUMO interface, representing the 2D environment, and the CARLA interface, representing the 3D environment. In a 3D visualization, the 2D environment is also present, and both interfaces communicate via sockets. Therefore, the 3D environment works as an extension for a more realistic visualization. 1https://sumo.dlr.de/docs/TraCI.html Fig. 2. Map Generation Workflow Fig. 3. Map Cleanup Using JOSM A. Visualization Environment This section outlines the required steps to create an integrated visualization environment using SUMO and CARLA. This involves generating accurate 2D and 3D maps, developing adapters to facilitate seamless data exchange and cosimulation, and ensuring robust synchronization between these platforms. Additionally, a user-friendly application manages and interacts with these interfaces, supporting various data types for comprehensive traffic analysis and management. 1) Generation of 2D and 3D Maps: The workflow to integrate maps into the SUMO and CARLA simulators is illustrated in Figure 2. The process begins with the import of the OSM (OpenStreetMap) file, which contains the essential geographical data of the target city. This file is then cleaned using Java OpenStreetMap Editor (JOSM)2to remove any elements that are not compatible with SUMO and CARLA, ensuring a seamless conversion. As shown in Figure 3, this cleaning process is crucial to reduce the amount of geo-spatial data, ensuring that the simulators are not overloaded with excessive information, and improving their performance. Following this process, the OSM file is modified to generate an OpenDrive XODR header3for accurate georeferencing and to enhance compatibility with CARLA. The final stage involves converting the modified OSM file into both the OpenDrive XODR format for CARLA and a traffic network for SUMO, resulting in a map that is fully prepared for precise and integrated simulations in both environments. 2) Adapters: The adapters enable the seamless integration and co-simulation of SUMO and CARLA, combining the 2D traffic simulations of SUMO with the lifelike 3D visualizations of CARLA. This integration allows for comprehensive and dynamic traffic simulations that are both visually detailed and behaviorally accurate. The adapters work continuously, ensuring that the simulation remains active and responsive to real-time inputs. They manage user interactions by subscribing 2https://josm.openstreetmap.de/ 3https://gdal.org/en/release-3.10/drivers/vector/xodr.html
Fig. 4. System features and adapters to the local MQTT Broker, which allows them to receive and process real-time requests. For example, when users request changes such as inserting vehicles, blocking roads, or testing specific scenarios, the adapters update the simulation environments accordingly using the TraCI API. The system incorporates three adapters, depicted in Figure 4, each designed to address different simulation needs. The Live Data adapter connects directly to the MQTT broker of the ATCLL data, enabling real-time integration of sensor data into the Digital Twin, ensuring that simulations reflect current traffic conditions. The Historic Data adapter leverages stored data from the ATCLL to recreate traffic conditions from past dates and times, allowing for detailed analysis of realworld scenarios. Lastly, the Simulated Data adapter focuses on purely simulated data, managing traffic simulations that rely solely on virtual vehicles. This adapter is essential for scenarios that focus solely on simulated use cases without real data. 3) SUMO-CARLA Co-simulation: The adapters facilitate the execution of a co-simulation between SUMO and CARLA – especially those handling 3D simulations – enabling all changes sent by TraCI to SUMO to be reflected in the 3D environment executed by CARLA. The implementation of cosimulation involves several steps4, including: •Vehicle type configuration: Since the two platforms map vehicles differently (SUMO focuses more on vehicle classes, while CARLA focuses more on the specific type of car to map, which image should appear in the 3D environment), it is important to establish a correspondence between the vehicle types used by the platforms. For example, it is important to specify that the vehicle identified by CARLA as vehicle.audi.a2 is mapped to SUMO as passenger. •Communication interface: Instantiate the TraCI API responsible for manipulating traffic in the co-simulation. •Synchronization: This configuration involves synchronizing simulation times, ensuring that actions in one simulator are properly reflected in the other. 4) User Application: In order to facilitate user interaction with the Digital Twin platform, a user application is designed. This application provides a versatile interface that allows users to choose between running a 2D visualization or a 4https://carla.readthedocs.io/en/latest/adv sumo/ Fig. 5. Live Data from the real world represented in the CARLA Interface Fig. 6. Historical Data Dashboard and representation in SUMO combined 2D/3D visualization, depending on their needs. Additionally, the application supports three types of data: live data, historical data, and simulation data (summarized in Figure 4). B. Types of Simulation As a result of the proposed adapters, our system supports three distinct types of simulations, each serving a specific purpose in creating lifelike and diverse scenarios. Live Data involves real-time integration with actual sensors via the MQTT broker, allowing the simulation to mirror realworld conditions dynamically. Figure 5 illustrates live data from Rua da Pega in Aveiro, synchronized and represented on the CARLA interface, utilizing data from the ATCLL sensors. Simulated Data focuses on user-controlled scenarios, enabling the addition of vehicles, random traffic generation, or roadblocks within the simulation environment, all controlled through the TraCI API. Historical data is handled through the integration of the STH-Comet API from ATCLL with the Digital Twin API, enabling the retrieval of archived sensor data stored in the ATCLL database – MongoDB. These data are used to reconstruct specific traffic conditions from past dates, allowing for simulations that reflect historical traffic patterns, facilitating trend analysis and predictive modeling. Figure 6 shows the form in which the user selects the simulation specifications, in this case, representing data for all vehicles that passed between 11:50 PM and 12:00 PM, May 16, 2024. Regardless of the simulation type chosen, users can perform various actions through the Digital Twin interface: 1. Add Random Traffic: Users can generate a specific number of random vehicles to populate the simulation. The process begins with the user specifying the desired number
of vehicles. The system then identifies suitable streets where traffic can be added and retrieves available vehicle types. Based on the specified vehicles’ count, the system performs insertion cycles, during which it randomizes both vehicle types and routes. Finally, vehicles are inserted into the simulation, reflecting various traffic scenarios. 2. Add Vehicles with Defined Routes: Users can add vehicles that follow specific predefined routes. This process starts with the user selecting route points directly on the map. The system then identifies the corresponding roads using the traci.simulation.convertRoad function. Once the roads are identified, the optimal path is calculated using Dijkstra’s algorithm via traci.simulation.findRoute. After determining the route, the system generates a unique vehicle ID, which includes a timestamp to ensure differentiation. Finally, the vehicle is inserted into the simulation and assigned the specified route, enabling detailed control over its movement. 3. Block Roads and Roundabouts: Users can block specific streets or roundabouts within the simulation. This process begins by accessing the road.json file to retrieve data for the relevant road segments (edges). To block access, the system sets the maximum speed of these edges to zero, effectively disabling vehicle movement to those sections. This prevents vehicles from accessing closed areas, making it useful for simulating road maintenance or accidents. 4. History and Re-simulation: To support comprehensive data analysis and scenario replication, users can save and resimulate past simulations. The system records detailed information about each simulation, including the paths and speeds of all vehicles and pedestrians. This saved data allows users to precisely replicate previous scenarios, enabling them to analyze traffic patterns under identical conditions or compare different statistical outcomes across various simulations. 5. Statistics: The platform provides tools for comparing key traffic metrics, which include average CO2emissions, average fuel consumption, maximum vehicle counts, total vehicle counts, and queue waiting times. These waiting times can be evaluated both before and after specific interventions, such as street or roundabout closures, giving users critical insights into the efficiency and environmental impact of their traffic management strategies. C. Co-existence between Real and Simulated Vehicles A crucial aspect of the Digital Twin is to ensure smooth interaction between real and simulated data (see Figure 7). A key concern is to avoid the collision of real and simulated data in the virtual environment. To address this, our solution involves treating real vehicles, detected by sensors, as generated vehicles similar to simulated data. Based on the real information gathered from the city sensors, the speed of the object is adjusted in the virtual environment. This enables the co-existence of both simulated and real vehicles, providing virtual awareness of all surrounding vehicles. While the real vehicles aim to maintain their real-world speed, they are also programmed to predict and avoid potential collisions by using emergency braking. Fig. 7. Interaction between real and simulated vehicles III. RESULTS The proposed Digital Twin platform simulates and evaluates urban traffic scenarios by integrating simulated and real-world data. A key achievement was the creation of a co-simulation environment between SUMO and CARLA, enabling synchronized 2D and 3D traffic visualization, while overcoming challenges with custom map integration. To enhance usability, a user application with a user-friendly dashboard and real-time data feed from ATCLL traffic sensors was developed, providing actionable insights for urban planning. The platform also includes a statistics module that leverages the TraCI API to collect and store key metrics, such as CO2emissions, fuel consumption, vehicle counts, and waiting times. These metrics are stored in JSON files postsimulation, allowing users to generate comparative graphs that reveal the impact of different traffic conditions and interventions. These features demonstrate the platform’s capacity to support informed decision-making and optimize traffic management strategies. A closer look into the Digital Twin platform and its functionalities is available in an online video5. The following sections explore two key scenarios that illustrate its capabilities: Planned Event Scenarios and Emergency Situations. A. Planned Event Scenarios The Europe Marathon, held annually in Aveiro, attracts thousands of participants and spectators, making it a cornerstone event for the city. The marathon includes various race categories, from the full marathon (42 km) to shorter routes, requiring significant road closures across the city. These disruptions can heavily impact traffic flow, particularly in key areas. To anticipate and mitigate these effects, the Digital Twin platform is used to simulate the event’s impact on urban mobility. Historical traffic data from a typical Sunday is compared with a simulated marathon day, allowing us to evaluate how road closures influenced traffic redistribution and congestion. By blocking critical routes, the simulation provided insights into potential bottlenecks and alternative paths. Figure 8 combines the marathon route (in black) with the division of the city into distinct zones: University (UA), ISCAA, 5https://www.youtube.com/watch?v=ug8WInNdn-s
Fig. 8. Blocked streets and vehicle distribution across city zones during the Europe Marathon in Aveiro, Portugal Hospital, and Residential Zones 1 to 4. The simulation results revealed that traffic was redirected primarily into residential neighborhoods, with zones such as Residential 2 and Residential 3 experiencing notable increases in traffic volume. This analysis is instrumental for city planners to develop optimized rerouting strategies that minimize disruptions during largescale events while maintaining an efficient traffic flow. The pie charts in Figure 9 highlight the redistribution of traffic across city zones during the marathon. The University area sees a significant drop in vehicle presence, from 32.7% on a regular day to just 10.1% during the event, due to road closures. This reduction is compensated by increases in other zones, particularly in the Hospital zone (rising from 19.6% to 28.7%) and Residential Zone 1 (increasing from 15.3% to 16.0%), which absorb much of the diverted traffic. Smaller zones, such as Residential Zones 2, 3, and 4, also experience notable increases in traffic share, emphasizing a broader dispersion across the city. Residential Zone 2 sees the largest relative increase, doubling its share from 6.2% to 14.3%, indicating its critical role as an alternative route. These shifts underscore the need for targeted traffic management in residential zones to handle increased volumes effectively during large-scale events. The results also validate the use of simulations to preemptively identify congestion hotspots and optimize rerouting strategies. Lastly, figure 10 compares CO2emissions across city zones before and during the marathon, using SUMO’s emission model. Zones like the University, Residential 3, and ISCA exhibit a slight decrease in emissions, reflecting reduced traffic volumes due to road closures. Conversely, the Hospital and Residential 1 show increased emissions, highlighting their role as rerouting hubs for displaced traffic, leading to higher vehicle density. Interestingly, the overall reduction in emissions does not match real-world expectations. In reality, congestion often increases emissions because of vehicles stopped with engines on and stop-and-go traffic. This difference highlights a limiFig. 9. Vehicle distribution by zone before and during the marathon Fig. 10. CO2emissions comparison by zone before and after marathon road closures tation in SUMO’s emission model, which may underestimate emissions in these situations. To address this, the simulation parameters might need refinement to better reflect real-world conditions and support sustainable traffic management strategies. B. Emergency Situations Unexpected road incidents, such as accidents or maintenance closures can significantly disrupt daily commutes. The Digital Twin platform enables rapid analysis of these scenarios, predicting additional travel times and providing data-driven insights for efficient rerouting. To demonstrate this capability, we simulated a typical morning in Aveiro and compared it to a scenario where key two-lane roads were reduced to single lanes, mimicking an unplanned roadblock. Metrics such as CO2emissions, vehicle counts, and waiting times were evaluated using average traffic flow across road segments. This analysis highlights the immediate traffic impacts of lane closures, offering urban planners actionable insights for minimizing disruptions and optimizing real-time traffic management. 1) Scenario 1: To analyze the impact of lane closures, we examine two primary routes frequently used by commuters traveling from the outskirts of Aveiro to the University of Aveiro. These routes, depicted in Table I, include the preferred route, which is shorter and faster under normal conditions, and an alternative route, which offers a viable detour during
TABLE I WAITING TIME COMPARISON FOR SCENARIO 1AND SCENARIO 2 Scenario Route Before After Factor 1 preferred route 21 s 12 min 13 s 36.33 1 alternative route 1 4 s 3 min 20 s 60.00 2 preferred route 2 s 43 s 19.85 2 alternative route 1 1 min 41 s 2 min 41 s 1.60 2 alternative route 2 3 s 2 s 0.74 Fig. 11. Routes analyzed for Scenario 2, including lane closures. disruptions. The waiting time analysis highlights the drastic effects of lane closures on traffic flow. The preferred route shows a significant increase in waiting times, rising from 21 s under normal conditions to 12 min and 13 s post-closure, a 36-fold increase. This surge underscores the severe congestion caused by reduced lane availability, which disrupts the efficiency of this route. In comparison, the alternative route, while less efficient under normal conditions with a waiting time of 4 s, accommodates additional traffic more effectively during disruptions. Post-closure, the waiting time increases to 3 min and 20 s, a 60-fold rise—indicating a substantial load shift, but maintaining better flow relative to the preferred route. These results emphasize the importance of alternative routes in mitigating congestion during unexpected lane closures. By identifying and optimizing such detours, urban planners can minimize delays, ensuring smoother traffic flow and improved commuter resilience during disruptions. 2) Scenario 2: To further explore the effects of lane closures, we analyzed another set of routes frequently used by commuters traveling between the ISCAA campus and the Hospital zone. These routes, illustrated in Figure 11, highlight the preferred (Route 1) and alternative paths (Routes 2 and 3) typically taken under normal and constrained conditions. The waiting time analysis for the Scenario 2, presented in Table I, demonstrates the significant impact of lane closures on the traffic flow. The primary route, which is typically the most efficient option, shows a sharp increase in waiting time from 2 s under normal conditions to 43 s post-closure, representing a 19.85-fold surge. This highlights severe congestion and reduced efficiency caused by lane restrictions. In contrast, the first alternative route, while less direct, absorbs a significant portion of the rerouted traffic. Waiting times increase from 1 min 41 s to 2 min 41 s, a 1.6-fold rise, indicating that this route can handle additional traffic more effectively than the primary route under constrained conditions. The second alternative route presents an interesting behavior, with waiting times decreasing from 3 s to 2 s, reflecting a 26% reduction. This suggests that traffic redistribution across the network alleviates congestion on this route, making it a viable option during disruptions. These findings emphasize the importance of alternative routes in mitigating the effects of unexpected lane closures. While the primary route experiences severe delays, the alternative paths help redistribute traffic and maintain overall network efficiency. Urban planners can leverage these insights to optimize traffic management strategies and minimize disruptions during emergencies. IV. CONCLUSIONS AND FUTURE WORK This paper proposed a Digital Twin for urban mobility, integrating simulations with real vehicles and multimodal systems. By combining real-time sensor data with detailed simulations, the platform enables accurate analysis of traffic dynamics, supporting sustainable and efficient traffic management. Moreover, the platform enables the blocking of roads and roundabouts, enables re-simulation, and provides a set of statistics for the vehicles, roads and environment. The results show the functionalities of the platform both in programmed and emergency events, and how they can help decision makers to optimize the traffic flow and anticipate changes in the roads. Future work will address urban planning, such as assessing the impact of bicycle infrastructure, and compatibility with vehicles’ control, leveraging the platform for autonomous vehicle coordination. ACKNOWLEDGMENT This work was supported by the EU’s HE research and innovation programme HORIZON-JU-SNS-2023 under the 6G-PATH project (Grant No. 101139172). REFERENCES [1] K. Kuˇ si´ c et al., “Building a motorway digital twin in sumo: Real-time simulation of continuous data stream from traffic counters,” in 2022 International Symposium ELMAR, pp. 71–76, 2022. [2] Z. Wang et al., “Towards next generation of pedestrian and connected vehicle in-the-loop research: A digital twin co-simulation framework,” IEEE Transactions on Intelligent Vehicles, vol. 8, no. 4, pp. 2674–2683, 2023. [3] T. Azfar et al., “Efficient procedure of building university campus models for digital twin simulation,” IEEE Journal of Radio Frequency Identification, vol. 6, pp. 769–773, 2022. [4] K. Wang et al., “Smart mobility digital twin for automated driving: Design and proof-of-concept,” in 2023 IEEE 97th Vehicular Technology Conference (VTC2023-Spring), pp. 1–6, 2023. [5] A. Saroj et al., “Development of a connected corridor real-time datadriven traffic digital twin simulation model,” Journal of Transportation Engineering, Part A: Systems, vol. 147, no. 12, p. 04021096, 2021. [6] A. Saroj et al., “Optimizing traffic controllers along the mlk smart corridor using reinforcement learning and digital twin,” in 2022 IEEE 2nd International Conference on Digital Twins and Parallel Intelligence (DTPI), pp. 1–2, 2022. [7] P. Rito et al., “Aveiro tech city living lab: A communication, sensing, and computing platform for city environments,” IEEE Internet of Things Journal, vol. 10, no. 15, pp. 13489–13510, 2023.