Hey everyone,
Recently, I was involved in a research project involving autonomous driving at my uni. My task was to develop a vehicle control algorithm. I decided to use LFS as the basis for my testing, and now that the project is done, I thought the people in this forum might be interested.
My idea for the project was to use a neural network and train it on my driving data to get it to drive around Formula Student tracks. In case you aren’t aware, Formula Student has had a driverless category since 2017. One of the reasons I picked LFS as my sim was that it already had a Formula Student vehicle, as well as flat areas and cones, so the work to adapt it for my use case was smaller than for other sims.
In order to gather data, I created a tool that can convert hand-drawn tracks to lyt files, which I could then use in LFS. In the beginning, the tracks were simple, and over time I created tracks that contained corner complexes, which proved to be problematic during the evaluation phase. Overall, I created around 20 tracks on which I gathered data. I did 2-3 laps on each track. You can find a short demo of the creation process in this link:
I gathered the data using a mouse for steering, throttle, and brake, as I don’t have a sim setup. I also limited the performance of the vehicle by applying a 50% air restrictor to the engine and only using first gear. My project was a proof of concept, so I didn’t want to overcomplicate things by using multiple gears.
During driving, my program gets data from LFS using OutSim and InSim and sends the driving commands using vJoy. The computation takes around 5ms, so the driving can happen at the fastest rate LFS currently allows—100Hz (until the 1000Hz physics engine arrives).
As for driving performance, I’m very satisfied with the current state of the project. Of course, the main limitation of the method I used is that the AI will only ever be as fast as I am. If I ever come back to this project, I’d like to explore other methods, such as reinforcement learning, to further improve performance.
Here is a video of the final result:
Recently, I was involved in a research project involving autonomous driving at my uni. My task was to develop a vehicle control algorithm. I decided to use LFS as the basis for my testing, and now that the project is done, I thought the people in this forum might be interested.
My idea for the project was to use a neural network and train it on my driving data to get it to drive around Formula Student tracks. In case you aren’t aware, Formula Student has had a driverless category since 2017. One of the reasons I picked LFS as my sim was that it already had a Formula Student vehicle, as well as flat areas and cones, so the work to adapt it for my use case was smaller than for other sims.
In order to gather data, I created a tool that can convert hand-drawn tracks to lyt files, which I could then use in LFS. In the beginning, the tracks were simple, and over time I created tracks that contained corner complexes, which proved to be problematic during the evaluation phase. Overall, I created around 20 tracks on which I gathered data. I did 2-3 laps on each track. You can find a short demo of the creation process in this link:
I gathered the data using a mouse for steering, throttle, and brake, as I don’t have a sim setup. I also limited the performance of the vehicle by applying a 50% air restrictor to the engine and only using first gear. My project was a proof of concept, so I didn’t want to overcomplicate things by using multiple gears.
During driving, my program gets data from LFS using OutSim and InSim and sends the driving commands using vJoy. The computation takes around 5ms, so the driving can happen at the fastest rate LFS currently allows—100Hz (until the 1000Hz physics engine arrives).
As for driving performance, I’m very satisfied with the current state of the project. Of course, the main limitation of the method I used is that the AI will only ever be as fast as I am. If I ever come back to this project, I’d like to explore other methods, such as reinforcement learning, to further improve performance.
Here is a video of the final result: