Home  »  Research   »   Digital Twin of a road with the help of OpenCRG

The usage of sophisticated testing methods such as Vehicle-in-the-Loop, Scenario-in-the-Loop, and other mixed-reality systems is becoming inevitable in autonomous vehicle development. These methods rely on using digital twins, realistic representations of real vehicles and their environment (e.g. road, traffic) in a carefully built virtual world. If the testing task is such (e.g., vehicle dynamics simulation), a Digital Twin can be created not only for the vehicle but also for the road itself. The vehicle suspension’s excitation depends on the road surface. It must be carefully recreated in the virtual world to obtain the highest accuracy since the excitation has a high impact on simulation results.

This goal can be achieved with the help of OpenCRG (Open Curved Regular Grid). OpenCRG is an open-source project for the creation, modification, and evaluation of road surfaces. It has its own file format specification, developed for driving simulations related to vehicle dynamics where the road’s smallest excitations matter. The data in an OpenCRG file can be easily processed with Matlab, and several other industrial software support this format by default. OpenCRG places data in a grid along the reference line of the road. Line segments are containing their start positions and their heading angle. The grid consists of longitudinal and lateral cuts along with the line segments.  Each cell of the grid has a value, which is typically the elevation. Some software can visualize the road surface in high definition based on OpenCRG too. An OpenCRG file can be created with high-precision road surface scans (e.g., with a Terrestrial Laser Scanner) as a Digital Twin of the road or by creating artificial road segments defining these surfaces in Matlab.

OpenCRG elevation diagrams.

Most of industrial simulation software tools support OpenCRG road surfaces by default, and IPG CarMaker is not an exception. In this software, the user can easily load an OpenCRG road surface at the desired position, and the simulation is immediately ready to go. The imported surface can even be scaled. A processed OpenCRG file from a part of the campus of the Budapest University of Technology and Economics has been created formerly. This file was used for the simulation both in IPG CarMaker and Unity 3D. A real measurement was done with a Ford Mondeo Mk IV on the scanned road.

Laser scanned road of the campus.

Unity 3D is a game engine that provides many opportunities to create our own system for simulations. An outstanding graphical visualization can be achieved with this software’s help, but by default, it does not support OpenCRG file format. They must be processed before importing them into the game engine. OpenCRG has a C-Application Programming Interface (C-API) for Matlab, which can load the OpenCRG file 3D data and create the surface contained in it. With the help of an addon called surf2stl, we can create a stereolithography (STL) file from the chosen surface. The last step to import the road surface to Unity is to convert the STL file into another 3D format called OBJ. It can be done with any CAD software, which supports OBJ files or directly using an online converter.

The digital twin of the road (OpenCRG) and the vehicle (with calibrated suspension model) were simulated in IPG CarMaker and Unity 3D and compared to measurements with the real car on the real road surface.

Real car (left), IPG CarMaker (center) and Unity3D (right.)

Although calibrating digital twins with sufficient accuracy and obtaining good quality OpenCRG files is tedious work, it can significantly speed up the long process of vehicle testing and validation.

Written by: BME Traffic Lab | Date: 08/02/2023 10:26 AM