Simple Terrain Database Creation and Simulink Terrain Query for Vehicle Simulation

Allows Simulink vehicle models to drive on terrain databases, in particular a closed-loop race track
396 Downloads
Updated 14 May 2018

View License

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
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Animation in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

terrain_triangle_preparation.2018.05.14/

Version Published Release Notes
1.1.0.0

- Updated lecture notes from ME620, Advanced Vehicle Dynamics course in .\Documentation folder.
- removed .mex64 in zipfile. Mex file's C source is provided and must be compiled locally.

1.0.0.0

Updated documentation