This component aims to emulate real-world driving conditions, terrains, battery consumption, weather conditions, & other parameters affecting vehicle performance.
1> Basics of vehicle dynamics
- Forces acting on a car while moving, turning, stopping
- Basic kinematics & dynamics relating to vehicles
2> Programming environment
Python - numpy, matplotlib, pygame -help in simulation & visualization
3> setting up virtual env, libraries
python -m venv vehicle_sim_env
source vehicle_sim_env/bin/activate # On Windows use: vehicle_sim_env\Scripts\activate
pip install numpy matplotlib pygame
4> simple 2D model
-representing vehicle as
5> incorporate basic dynamics:
- Motion: basic equatios of motion: used newton's law & kinematic equations to simulate acceleration, braking, coasting
- Terrain: added different terrain types( e.g., flat, uphill, downhill). Each teraain had different friction coefficients affecting the vehicles acceleration or deceleration.
6> Incorporate environment factors:
- Weather conditions: rain,ice can decrease friction affecting braking distance.
- Real time challenges: pothols, roadblocks which need sudden braking
7> Visualization: using pygame, matplotlib: visualize vehicles motion in real time. Display speedometer, acceleration, terrain type, weather conditions
8> Feedback loop with battery consumption.
Faster accelerations drain the battery faster.
Uphill terrain requires more power.