Simple Terrain Database Creation and Simulink Terrain Query for Vehicle Simulation
The Simple Terrain Database Creation and Simulink Terrain Query for vehicle simulation group of files provides examples of processing a race track image of the racing course into a triangle database for a Simulink vehicle model to drive on. The terrain database and terrain query for a vehicle model is one component to lap time simulation.
The two m-file scripts to begin with are:
(1) process_track_into_terrain_database.m - this has a documented process for reading a raster image, extracting inner and outer track edges and generating a triangle-based terrain database for use with the Simulink model described below.
(2) setup.m - this loads a triangle-based terrain database from a .mat file (created by process_track_into_terrain_database.m) and prepares the workspace for a Simulink model to query the database with N test points at each Simulink timestep. The intent is that a 4-tire vehicle model can query the terrain database to discern which triangle the tire is on to use the corresponding terrain property for that triangle. Or, simply knowing which triangle the tire is on helps determine if the tire is still on or off the track.
A terrain database is one part of a vehicle's laptime simulation, along with the vehicle mobility model, powertrain, visualization, and path navigator or driver inputs subsystem.
See .\Documentation folder for lecture note excerpts from ME620 Advanced Vehicle Dynamics in the mechanical engineering department at Embry-Riddle Aeronautical University. These lecture notes explain track image processing and terrain triangle generation, terrain query runtime in Simulink, and laptime simulation.
---------------------------------
Marc Compere, comperem@erau.edu
created : 21 Apr 2018
modified: 14 May 2018
Cite As
Marc Compere (2024). Simple Terrain Database Creation and Simulink Terrain Query for Vehicle Simulation (https://www.mathworks.com/matlabcentral/fileexchange/67028-simple-terrain-database-creation-and-simulink-terrain-query-for-vehicle-simulation), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > 2-D and 3-D Plots > Animation >
Tags
Acknowledgements
Inspired by: Simple 2D kinematic vehicle steering model and animation
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.