Skip to content

Commit c22dfdf

Browse files
committed
Update README.md
1 parent d77fd81 commit c22dfdf

File tree

4 files changed

+80
-3
lines changed

4 files changed

+80
-3
lines changed

README.md

+80-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,91 @@
1-
# Car-Simulator
1+
# [Car Simulator](https://jasonnor.github.io/Car-Simulator/)
22

3-
Car simulator (based on JavaScript & WebGL) implemented by fuzzy control system, genetic algorithm and particle swarm optimization.
3+
Car Simulator use the fuzzy control system, genetic algorithm and particle swarm optimization to simulate the movement of the car on the map.
4+
5+
Input contains the three distance sensors of the car (front, 45 degrees left and right), which can be obtained from the defined motion equation, the position of car and the angle between the car and the horizontal axis. Output is the steering wheel rotation angle.
6+
7+
The target is to reach the end without encountering the wall and output the movement trajectory (including the position of each point in time, the sensor value and the steering wheel rotation angle) as a text file, then display on the graphical interface.
8+
9+
The motion equation of the simulated car is as follows:
10+
11+
![motion-equation](assets/motion-equation.png)
12+
13+
## Fuzzy Control System
14+
15+
Fuzzy control system use the custom seven fuzzy rules and discrete center of gravity defuzzifier. See [here](Fuzzy-Control-System/js/fuzzy.js) for the details.
16+
17+
## Genetic Algorithm
18+
19+
Car Simulator use the real-valued genetic algorithm (GA) to train the radial base function network (RBFN) and the car will control by RBFN. The gene is defined as the three parameters of RBFN (w, m, σ) of mixed dimension vector. The fitness function is the mean variance of the expected output of the data set and the RBFN output in the specific input case. The lowest fitness value is the best RBFN parameter.
20+
21+
The structure of the radial base function network is as follows:
22+
23+
![rbfn](assets/rbfn.png)
24+
25+
## Particle Swarm Optimization
26+
27+
Car Simulator can also use the particle swarm optimization (PSO) to train RBFN. The PSO coordinate is defined as the three parameters of RBFN (w, m, σ) of mixed dimension vector. The fitness function is the mean variance of the expected output of the data set and the RBFN output in the specific input case. The lowest fitness value is the best RBFN parameter.
28+
29+
## Getting Started
30+
31+
[https://jasonnor.github.io/Car-Simulator/](https://jasonnor.github.io/Car-Simulator/)
32+
33+
Car Simulator also support the VR device, please open this [page](https://jasonnor.github.io/Car-Simulator/WebVR).
434

535
![preview](assets/preview.png)
636

7-
## Working...
37+
1. Status
38+
2. Control button
39+
3. Camera first person / third person switch
40+
4. Steering wheel rotation angle and moving speed
41+
5. Start the fuzzy control system
42+
6. RBFN parameters setting
43+
7. GA parameters setting
44+
8. PSO parameters setting
45+
9. Save the trajectory and data
46+
10. Operating instructions
47+
11. Graphic interface
48+
49+
## Instructions
50+
51+
![instructions](assets/instructions.png)
52+
53+
## 4-Dimensional Output Data Format
54+
55+
InputA1 InputB1 InputC1 Output1
56+
InputA2 InputB2 InputC2 Output2
57+
...
58+
59+
Where InputA is value of center distance sensor, InputB is value of right distance sensor, InputC is value of left distance sensor and output is steering wheel rotation angle. The default [datasets](Genetic-Algorithm/dataset-4D) can be found here.
60+
61+
## 6-Dimensional Output Data Format
62+
63+
InputA1 InputB1 InputC1 InputD1 InputE1 Output1
64+
InputA2 InputB2 InputC2 InputD1 InputE1 Output2
65+
...
66+
67+
Where InputA is X coordinate of the car, InputB is Y coordinate of the car, InputC is value of center distance sensor, InputD is value of right distance sensor, InputE is value of left distance sensor and output is steering wheel rotation angle. The default [datasets](Genetic-Algorithm/dataset-6D) can be found here.
68+
69+
## Preview
70+
71+
![fuzzy](assets/fuzzy.gif)
872

973
![camera](assets/camera.png)
74+
1075
![trajectory](assets/trajectory.png)
76+
1177
![first-person](assets/first-person.png)
78+
1279
![success](assets/success.png)
80+
1381
![failure](assets/failure.png)
82+
1483
![poor-driving](assets/poor-driving.png)
84+
85+
## Contributing
86+
87+
Please feel free to use it if you are interested in fixing issues and contributing directly to the code base.
88+
89+
## License
90+
91+
Car Simulator is released under the MIT license. See the [LICENSE](/LICENSE) file for details.

assets/instructions.png

616 KB
Loading

assets/motion-equation.png

35.1 KB
Loading

assets/rbfn.png

66.2 KB
Loading

0 commit comments

Comments
 (0)