How to make an RC car and control it from Unity
Tvtig
#AI #GameDev #Arduino I built an RC car that can be controlled via my Unity game. The Car operates using Arduino in combination with ESP8266. I used a load of hot glue, pegboard, paperclips and other goodies to put it together. I programmed the ESP8266 to connect to my WIFI network and then to subscribe to an MQTT topic. When it receives a message via MQTT, it writes it to the Arduino via its serial pins. The Arduino then deserializes the messages it receives and determines whether to write control values to the motors or to the servo.
In Unity, I used machine learning to teach a car AI to drive around a track. This was achieved using Unities ML Agents toolkit. I then took the commands it uses after its learning process and published them to the MQTT broker via C#. These commands are then picked up by the ESP8266 and sent to the Arduino for control.
Thanks to https://unsplash.com/@jhonkasalo for the image background I used in the Thumbnail. Thanks to https://www.movieclips.com/ for the Frankenstein cameo.
Git Repo ESP and Arduino: https://github.com/Tvtig/Car_Arduino_ESP Git Repo Machine Learning Car: https://github.com/Tvtig/CitySimulation
0:00 - Waffling 1:00 - Construction 1:29 - How it works 2:13 - It working 3:04 - Final test
Subscribe: https://www.youtube.com/channel/UCtf-juYuLmAxX6ogSmLIC6Q?sub_confirmation=1
76443387 Bytes