Simple Animation for N vehicles

This simulates and animates multiple 2D kinematic vehicle models in Simulink
504 Descargas
Actualizado 25 abr 2018

Ver licencia

-------------------------------------------------------------------------------
This is the Readme file for a simple 2D kinematic vehicle animation for N separate vehicles implemented in Matlab's Simulink. There are no special libraries or additional toolboxes required.
The simulink model simulates and displays N vehicles at each timestep. This version was based on the single vehicle version located here:
https://www.mathworks.com/matlabcentral/fileexchange/54852-simple-2d-kinematic-vehicle-steering-model-and-animation

Software Versions Tested:
-------------------------
This model was developed and tested using Matlab R2014, R2015, R2016b and should work with most other versions. The animation s-function is a modified version of the level 1 m-file s-function from the Mathworks example provided in sanim.m.

Writing .jpeg animation frames to disk at each animation interval slows the simulation considerably. Set animation frames per second, anim_fps, in setup.m and re-run setup.m. Don't forget to turn off your file synchronization services to avoid syncing all the new image files.

Getting started:
-------------------------
Get started by unzipping the .zip file, changing directories to the folder, then running setup.m
at the Matlb command prompt. This will clear the workspace then populate it with the necessary variables to run the Simulink model and associated animation. It will also open the Simulink model file. Press Play or Simulation | Run to execute the Simulink model. The light blue s-function block will bring up the 2D animation figure window and display the steering vehicle at anim_fps frames per second.

-------------------------------------------------------------------------------
Distribution file list:
-------------------------------------------------------------------------------
[00_Readme.mdc.txt] - this file

[setup.m] - run this first, it will bring up the Simulink, then press play to simulate the vehicle

[createAviMovieFromAnimationSequence.m] - auxiliary m-file script for converting a sequence of .jpg images into an Avi using Matlab's VideoWriter() function.

[sanim_XY_vehicle_viz_multi.m] - Simulink m-file s-function that displays N vehicle's of Matlab graphics objects each animation interval, set by anim_fps in setup.m.

[veh_object2.m] - supporting m-file function to create vertices and faces for vehicle and tire graphics objects

[vehicle_animation_sim_multi.jpg] - desktop screenshot showing the Simulink model and animation window

[vehicle_animation_sim_multi.pdf] - printout of the Simulink block diagram in case you cannot open the Simulink

[vehicle_animation_sim_multi.slx] - Matlab/Simulink R2016b model that expressed non-holonomically constrained (rolling) CG velocities and solves for vehicle position as a function of time.

[.\anim_sequences] - folder where animation frame sequence .jpg files are stored; change this in sanim_XY_vehicle_viz_multi.m

[.\Documentation\ folder containing excerpts from lectre notes for ME620 Advanced Vehicle Dynamics

-----------------------------------
Marc Compere, comperem@gmail.com
created : 11 Jan 2016
modified: 24 Apr 2018
-----------------------------------

Citar como

Marc Compere (2024). Simple Animation for N vehicles (https://www.mathworks.com/matlabcentral/fileexchange/67034-simple-animation-for-n-vehicles), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2016b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Animation en Help Center y MATLAB Answers.

Community Treasure Hunt

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

Start Hunting!

simple_2D_steering_animation_v3/

Versión Publicado Notas de la versión
1.0.0.0

Minor zip file adjustment
Title change to highlight the N-vehicle animation block
simplifying the readme