Skip to content

roessg/driving-simulation

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
GUIDE TO THE DRIVING SIMULATION

Run the simulation ---------------------------------------------------------------------
Step 1: Go to main.py
Step 2: Use default values (that match Salvucci & Gray's parameter values), or modify them...

	Agent features
	  > start_position
	  > size, color, velocity 

	Parameter values
	  > gain values
	  > delta-time, number of frames
	  > initial values of phi, alpha, and delta-alpha

	Animation window
	  > select size of window:
		- window that zooms up to the agent to observe its movements (since the agent is not moving, the window limits don't need to change :( )
		- window that shows the entirety of the road

Step 2: Run the model!
	Window will pop up with the agent, along with near-point and far points and corresponding vectors.

----------------------------------------------------------------------------------------------

Look at each step to calculate control adjustment over each time step -------------------------

Step 1: Go to main.py

Step 2: Scroll down to initialize_simulation.init_nearPoint_farPoint_values()
	Initializes nearPoint and farPoint values, and corresponding visual angles before simulation begins
	
Step 3: Scroll down to the animate()
	A function that loops and updates the agent's x and y position per frame.

Step 4: Observe files used for each function
	   > two_point_steering_model.py : calculates x,y displacement using agent's current location and visual angles
	   > calculate_nearpoint_farpoint.py: calculates x,y location of nearPoint and farPoints based on agent's x,y position in the next frame [x(f+1),y(f+1)]
	   > calculate_visual_angles.py : calculates angle between heading vector and the nearPoint and farPoint
-------------------------------------------------------------------------------------------------

Validate each step ------------------------------------------------------------------------------

Step 1: Go to validate_results.py

Step 2: Observe structure of the file
	A file where you can get a freeze frame from the simulation and observe if the nearPoint and farPoints are correctly placed, and if the visual angles
	are correctly calculated. 

	Simulation agent and objects
	   > current_pos : position of agent 
	   > the rest of the variable values don't matter as much, since you're only simulating a single frame and not using the control law





-------------------------------------------------------------------------------------------------

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages