AutoPylot project by Autonomobile !
https://www.renaultgroup.com/news-onair/top-stories/robocars-le-grand-prix-de-voitures-autonomes-qui-a-anime-vivatech-2022/ https://twitter.com/01net/status/1537750831700779010
follow this link : https://autonomobile.github.io/
AutoPylot was born as an end of the school year project. Our school asks from its student to take part in a project with a group of 4 students. We are free to create our own project, but it has to be accepted by the school's board, AutoPylot was !!! Being able to work on this project means we will be able to understand how tomorrow's car will work. Moreover, we will learn valuable skills in Python and in neural networks.
Our main objective is to make our car race against other cars and win the race ! This will require multiple intermediate milestones:
For more detailed information please read the project report
Enjoy,
The Autonomobile Team.
It is recommended to have python 3.7.X installed, as this is the python version installed on the car. But you can use any python version >= 3.7.
To avoid any packages conflicts with your existing python installation, we will use virtualenv install virtualenv using:
pip install virtualenv
Clone the repo, and install the package and it's dependencies:
git clone https://github.com/Autonomobile/AutoPylot.git
cd AutoPylot
Then, create a virtual env (you need to specify the path to your python3.6:
virtualenv --python C:\Path\To\Python\python.exe venv
Then, every time you will be working on the project, you will need to activate this environment, to do so:
.\venv\Scripts\activate
Now, to install autopylot and its requirements (including dev requirements):
pip install -e .[dev]
For the code formatting, we will use something called "pre-commit", that enables us to automate stuff as linting before committing. If the code is not well linted, it will throw an error before committing and will lint it, you will only have to commit again to apply the changes the linter did ! Here is how to setup pre-commit:
pre-commit install
You are now all setup to work on the project ! Don't forget to keep the setup.py and requirements.txt up to date.
To exit the virtualenv:
deactivate
useful tools:
Here is the three main steps in the making of a model
if you want to config your joystick mapping, run:
python -m "autopylot.controllers.joy_config"
it will run you through the mapping config of your controller, when finish, you will find your mapping file in the root of your project.
First you need to collect some data.
You will need to select in the "settings.json" the "CAMERA_TYPE", "ACTUATOR_TYPE" and "CONTROLLER_TYPE". By default they are set for the car configuration eg "webcam", "serial" and "xbox" respectively, if you are collecting data on a PC, I suggest you using "sim", "sim" and "keyboard". This will use data coming from the simulator, inputs from the keyboard and output them (actuate) in the simulator.
Start the script with the following command (don't need to cd if you are in the right directory):
cd main_programs/examples
python3 drive_with_controller.py
To drive depending on the controller type you use:
To record data depending on the controller type you use:
You should see the collected data your "~/collect" folder. If unsure about the location of the folder, check the "COLLECT_PATH" settings in the settings.json
Note: by default a model will be loaded, if you don't touch anything, you will enter "autonomous" mode using the predictions from this default model.
Then training !
there are plenty settings for the training script:
steering_model
and when training your model, it will be created using this function.you can now start this training script with:
cd main_programs/
python3 train.py
Once finished, your new model should be saved in the "models" folder at the root of your project.
You will need to change in the settings.json the "MODEL_NAME" field to the name of the model you just trained. then same as for the "collect" part, start the drive_with_controller.py script and enjoy !
cd main_programs/examples
python3 drive_with_controller.py