-
Notifications
You must be signed in to change notification settings - Fork 0
Simulator Instructions
This simulation was built in a 3D Unity Engine and is capable of driving just like a normal car can. One exception being that the car does not have a driver! We will be using Unity's Physics Engine to provide simulated turning and gravitational forces that a normal car would be dealing with.
Download the simulator at here. Once you download it, unzip it and run the executable named "LTG_PROJECT_3D_SIMULATION" inside the unzipped folder.
Then click Racetrack One and you will be taken to the simulator of racetrack 1.
In order to tell where the car is, we need to give the car something to interact with. If this were the real world, we would be able to bounce light easily off a surface and receive that light back to us. However, in the virtual world, light physics is very expensive! No it doesn't cost money, it cost computational resources! So instead of using light, we use what Unity is very good at, physical detection. Along the middle of our track runs a thin tall wall that physical contact indicators will be able to tell they are within this wall. Now, the car is able to pass through this barrier and does not affect the cars movement in any way, as in bouncing off the wall, but this barrier lets the car pass right through it as if it wasn't even there. This type of collider is called a Trigger Collider the collision is called a Trigger Collision within Unity. So all we need to do is add 5 Box Colliders which can tell if it has collided with the middle of our track, and we are good to go for data collection! If you are interested more in finding out about these trigger colliders or colliders in Unity in general, you can more at here
The track design we went with for Racetrack One is a European Formula 1 style with sharp turns and varying turn severity. We see many turn types and many severities along with some straight-aways to give us a good judge on our cars performance.
The car below has 5 trackers that line the front of the car. It may look like one line but that is because to get the best error we need to have overlapping trackers in order to tell if the car is between two trackers. This is done for error accuracy as we will discuss below.
Sometimes minor adjustments can make a huge difference but only really show themselves after multiple laps. You can see these changes by adjusting the Timescale value. This will speed up the game clock within the simulation and everything will run either faster or slower depending on how you change that value. The default is 1 and if you change it to 2 it will double the in-sim time; if you change it to .5, it will half the in-sim time.
You can adjust the top speed at which the car moves by changing the Max Speed value. The car will slow down automatically if it finds itself swerving off the track. This is to reset the cars position relative to the track.
There is a mini-map in the top right that gives the user the ability to change to different camera views within the window given. There are three views: the overhead of the entire track, overhead of the car, and a hood view of the car.