Vehicle Simulation

Worked with a partner to implement a vehicle simulation system for my year long senior design project. The system was coded in C++. The goal of the project was to design a simulation that could be incorporated into the already existing crowd simulation at UPenn’s computer graphics center. For this reason, the simulation codebase needed to be created independently from a display, and also needed to run in the same coordinate space as the crowd simulator.

The crowd simulator uses a world based off of cities designed in the program City Engine. Each city has a road network specified by connecting edges. As the first step of the project, I created a program to export the road network from City Engine, parse the resulting data file, and build a data structure for the roads. The street coordinates in the vehicle simulation system are identical to those in the original city, and are therefore also the same as the coordinate system in the crowd simulator. Consequently, once any road network data structure is provided to the simulation system it will run properly.

After the original road network is set up, vehicle objects are created and randomly placed on the roads. Once the vehicles begin movement, many additional features ensure that the simulation is realistic. Vehicles stop at traffic lights, smoothly turn around corners, and automatically accelerate and decelerate based on traffic ahead of them. Overall, the system works to ensure that collisions between vehicles are minimal.

The project was originally displayed using a simple OpenGL window coupled with an FLTK GUI for testing purposes. After the simulation code was completed, the display was switched to the Unity game engine so the simulation would run in 3D. The simulation system was exported as a DLL for easy access and use.

My role in the project focused heavily on the user interface, graphical display, and animations. I wrote an original FLTK GUI to work with the 2D simulation for testing purposes, and also organized running the 3D version of the simulation in Unity. I ensured that all elements in the simulation were displayed properly, and wrote the algorithm that smoothly animates all vehicle turns.

Final Paper
Final Presentation Poster
Project Blog