Skip to content

Commit

Permalink
logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Ro0t-set committed Jan 25, 2024
1 parent 4ff1eae commit 01c764c
Show file tree
Hide file tree
Showing 8 changed files with 269 additions and 2 deletions.
144 changes: 144 additions & 0 deletions log.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
Budapest,Lap Done,1119.0340420000018,135.34
Budapest,Lap Done,1355.9112149999964,135.35
Sakhir,collisions,293.22077099999984,27.03
Monza,Lap Done,1536.9788930000047,146.81
Silverstone,Lap Done,1590.7086089999987,156.94
Melbourne,Lap Done,1348.5863180000003,157.47
Austin,collisions,24.809995000000008,2.68
Sochi,Lap Done,1609.6109830000028,156.23
YasMarina,collisions,393.5002970000001,37.04
Silverstone,Lap Done,1589.3158050000006,156.99
Nuerburgring,Lap Done,1243.0771860000082,153.91
Zandvoort,Lap Done,1320.3753559999939,133.61
Budapest,Lap Done,1356.1212550000046,135.41
MoscowRaceway,collisions,208.4142869999999,19.05
Silverstone,Lap Done,1591.8317190000032,156.97
Sepang,collisions,57.77027999999997,4.19
Nuerburgring,Lap Done,1532.0329290000045,151.61
Silverstone,Lap Done,1589.6193800000003,156.89000000000001
BrandsHatch,Lap Done,1191.6087239999968,116.60000000000001
MoscowRaceway,collisions,151.8067009999999,14.530000000000001
Monza,Lap Done,1533.978411999999,146.41
MexicoCity,collisions,-253.53990500000018,7.1000000000000005
Spielberg,collisions,9.370373999999998,0.77
Sochi,collisions,198.82580899999985,15.08
Melbourne,collisions,217.195128,16.41
MoscowRaceway,collisions,29.158565999999983,2.22
Oschersleben,collisions,0.9008170000000001,0.05
MexicoCity,collisions,-321.27741299999997,3.48
Sochi,Lap Done,1201.5888190000028,156.25
YasMarina,collisions,154.06195399999987,13.61
Budapest,Lap Done,1356.4534230000045,135.33
Nuerburgring,Lap Done,1539.4956069999967,153.81
Nuerburgring,Lap Done,1538.6830379999853,153.66
Monza,collisions,-5.614840999999999,0.06
Sepang,Lap Done,1687.4734459999959,165.81
Monza,Lap Done,1536.3372049999987,146.5
Zandvoort,Lap Done,1318.6443369999995,133.62
Sochi,Lap Done,1609.3523549999982,156.22
Oschersleben,Lap Done,521.9784709999992,92.39
MexicoCity,collisions,91.18013000000006,8.5
Hockenheim,collisions,604.1101950000051,58.27
MexicoCity,collisions,562.7361969999997,51.21
BrandsHatch,Lap Done,1190.0692619999995,116.63
Nuerburgring,Lap Done,1219.3429289999974,151.61
Catalunya,Lap Done,1407.5553649999954,139.86
Catalunya,Lap Done,1410.5743260000067,140.29
Sochi,Lap Done,1609.5749329999971,156.25
BrandsHatch,Lap Done,1189.3355509999974,116.58
Hockenheim,collisions,58.654760999999965,4.2700000000000005
MoscowRaceway,collisions,9.70535,2.59
Nuerburgring,Lap Done,1442.4535749999952,115.2
Spa,collisions,155.31343299999986,11.8
SaoPaulo,Lap Done,1096.1369300000013,89.60000000000001
SaoPaulo,Lap Done,1097.1404529999977,89.69
MoscowRaceway,collisions,-164.75199900000052,22.18
Sakhir,collisions,667.030277,51.11
Melbourne,Lap Done,1545.6370629999988,120.47
Spa,collisions,571.1648049999993,43.49
MexicoCity,collisions,132.86603799999992,10.33
SaoPaulo,collisions,54.39952100000001,3.79
Sepang,collisions,428.7918170000007,38.04
YasMarina,collisions,394.2968559999997,31.400000000000002
Silverstone,collisions,537.5302599999999,41.06
BrandsHatch,Lap Done,1142.1246840000001,89.49
Budapest,Lap Done,1290.0806910000013,103.21000000000001
Spielberg,collisions,49.369002999999964,3.35
Spa,collisions,100.43793700000002,13.27
BrandsHatch,Lap Done,1143.2661529999973,89.42
Austin,collisions,66.75350999999999,5.19
Sepang,collisions,795.293627,60.61
Catalunya,Lap Done,1338.7730769999998,107.27
Austin,collisions,31.722481000000005,2.19
Budapest,collisions,35.444201000000014,2.69
Zandvoort,Lap Done,1245.7073450000016,95.76
Spielberg,collisions,300.4100849999997,22.17
Nuerburgring,collisions,80.27427199999997,5.98
Nuerburgring,collisions,131.365482,9.46
Nuerburgring,collisions,232.44411199999993,17.13
Budapest,collisions,63.988542999999964,4.46
Sepang,Lap Done,1558.4692349999991,117.07000000000001
Sepang,Lap Done,1559.5947700000008,117.02
Budapest,Lap Done,1280.9077359999967,97.31
Sochi,collisions,302.56653100000005,22.3
MoscowRaceway,Lap Done,1025.8942210000048,84.33
MoscowRaceway,Lap Done,523.8762919999991,84.11
YasMarina,collisions,3.2489410000000003,0.34
Austin,collisions,192.793103,14.31
Budapest,Lap Done,1278.535843999999,97.36
Melbourne,Lap Done,1522.550593000003,112.03
Hockenheim,collisions,15.118211000000464,29.22
Silverstone,Lap Done,1476.7647630000054,111.99000000000001
Monza,collisions,1057.7889119999993,77.62
Silverstone,Lap Done,1476.7414799999924,112.08
Austin,collisions,235.3341380000002,18.22
Sochi,collisions,-98.83033300000024,11.39
Sochi,collisions,201.05379499999987,16.37
Nuerburgring,collisions,164.05992199999997,13.31
Spielberg,collisions,126.34669099999996,9.22
Zandvoort,collisions,504.4381910000003,40.660000000000004
Melbourne,collisions,37.310998999998716,33.07
MexicoCity,collisions,27.00339500000003,2.56
SaoPaulo,collisions,379.04588200000063,30.45
Budapest,collisions,678.7042570000028,53.94
Catalunya,collisions,363.2802249999994,29.22
Monza,collisions,32.989853000000004,2.17
MoscowRaceway,collisions,-144.487513,1.51
Sochi,collisions,108.25450000000005,8.91
Hockenheim,collisions,106.02874999999993,7.69
Spielberg,collisions,51.17584999999994,3.87
Spielberg,collisions,79.29953299999998,5.86
Budapest,collisions,63.403188,4.68
Spielberg,collisions,335.27790200000044,26.38
Budapest,collisions,405.1492030000003,32.32
MexicoCity,collisions,107.87068699999944,8.44
Austin,collisions,111.01907099999944,8.36
Melbourne,collisions,253.10393699999943,19.67
Austin,collisions,19.739583000000007,1.41
Zandvoort,collisions,363.30132399999957,44.980000000000004
Spielberg,collisions,379.7933659999998,26.88
YasMarina,collisions,89.75034899999991,6.3500000000000005
Budapest,collisions,443.95240200000035,32.61
Spielberg,collisions,90.52929099999993,6.3500000000000005
YasMarina,collisions,-320.927774,3.42
Sochi,collisions,413.9931290000003,30.61
Sakhir,collisions,139.1305599999996,9.42
Budapest,collisions,554.9551910000001,40.58
Monza,collisions,523.735378999999,36.26
Monza,collisions,-263.1314959999999,2.7800000000000002
Spielberg,collisions,428.51690099999934,30.75
Budapest,collisions,85.43135399999994,6.01
Spielberg,collisions,268.6757809999995,18.97
Budapest,collisions,68.48865500000002,4.95
Sochi,collisions,30.28158,2.14
MoscowRaceway,collisions,-130.49533200000005,6.04
Zandvoort,collisions,382.52510400000045,29.5
BrandsHatch,Lap Done,1132.4173250000015,82.28
Sepang,collisions,15.132308,1.72
Catalunya,collisions,454.8668540000004,33.55
Sepang,Lap Done,1477.6719150000033,165.83
Sochi,Lap Done,1609.5061790000045,156.21
Spielberg,Too long,-43273.17756902161,500.01
Silverstone,Lap Done,1587.9538560000003,156.45000000000002
Oschersleben,Lap Done,834.3727379999983,92.41
Spielberg,Too long,-45790.96370202984,500.01
103 changes: 103 additions & 0 deletions report/index.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
\documentclass[conference]{IEEEtran}
% \IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}

\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}

\title{
Autonomous driving model trained in a simulated environment using Reinforcement Learning and operating in a ROS environment
}

\author{Manuel Andruccioli,
Tommaso Patriti,
Giacomo Totaro,\\
\textit{University of Bologna (Italy)} \\
e-mail: $\{$manuel.andruccioli, tommaso.patriti, giacomo.totato2$\}$@studio.unibo.it }

\maketitle

\begin{abstract}
Our abstract
\end{abstract}

\begin{IEEEkeywords}
Reinforcement Learning, Deep Learning, Autonomous Racing, ROS
\end{IEEEkeywords}

\section{Introduction}

Section \cite{test}

\begin{itemize}
\item Descrizione del contesto e dell'importanza della guida autonoma nelle macchine.

\item Presentazione del vostro obiettivo di ricerca e della vostra ipotesi.

\end{itemize}


\section{Stato dell'arte}

\begin{itemize}
\item Una revisione della letteratura su progetti simili e sull'uso di Reinforcement Learning nelle applicazioni di guida autonoma.

\item Discussione delle sfide e delle soluzioni proposte da altri ricercatori nel campo.

\end{itemize}


\section{Metodologia}

\begin{itemize}
\item Descrizione dell'architettura del modello utilizzato, inclusi i dettagli su come avete implementato l'algoritmo PPO.

\item Spiegazione del processo di raccolta dei dati e la selezione dei circuiti utilizzati per l'addestramento.

\item Dettagli sui waypoints e su come sono stati integrati nel processo di addestramento.

\end{itemize}

\section{Esperimenti}

\begin{itemize}
\item Descrizione delle condizioni sperimentali, tra cui la configurazione dell'addestramento, la scelta dei parametri, ecc.

\item Presentazione dei risultati ottenuti durante i vostri esperimenti.

\item Analisi dei risultati, comprese le prestazioni del modello su diversi circuiti.

\end{itemize}

\section{Discussione}

\begin{itemize}
\item Interpretazione dei risultati e confronto con la letteratura esistente.

\item Discussione sulle sfide incontrate e le eventuali limitazioni del vostro approccio.

\item Possibili sviluppi futuri e miglioramenti proposti.

\end{itemize}

\section{Conclusioni}

\begin{itemize}
\item Riassunto dei risultati principali.

\item Sottolineare l'importanza del vostro contributo e le potenziali implicazioni nella guida autonoma.

\end{itemize}


\bibliographystyle{IEEEtran}
\bibliography{bibliography}

\end{document}
2 changes: 1 addition & 1 deletion src/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

eval_env = gym.make('f110_gym:f110-v0', map=map_path, map_ext=map_ext, num_agents=1, timestep=timestep, integrator=Integrator.RK4)

eval_env = F110_Wrapped(eval_env, random_map=False)
eval_env = F110_Wrapped(eval_env, random_map=True)

eval_env.set_map_path(path)

Expand Down
20 changes: 20 additions & 0 deletions src/wrapper/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@
from pyglet.gl import GL_POINTS
import utility.map_utility as map_utility
from typing import Any, Dict, List, Optional, SupportsFloat, Tuple, Union
import csv


def logger(map, event, reword, lap_time):
#logger in a csv file
map = map.split("/")[-1]
with open('log.csv', 'a', newline='') as file:
writer = csv.writer(file)
writer.writerow([map, event, reword, lap_time])






def convert_range(value, input_range, output_range):
# converts value(s) from range to another range
Expand Down Expand Up @@ -202,6 +216,7 @@ def episode_end(reason = None, rew = 0):

self.count = 0
if self.one_lap_done:
logger(self.map_path, "Lap Done", sum(self.episode_returns), len(self.episode_returns) * 0.01)
self.episode_returns = []
self.one_lap_done = False
else:
Expand All @@ -218,11 +233,16 @@ def episode_end(reason = None, rew = 0):


if observation['collisions'][0]:
logger(self.map_path, "collisions", sum(self.episode_returns), len(self.episode_returns) * 0.01)
done, reward = episode_end(rew = -30)




if len(self.episode_returns) > 50_000:
logger(self.map_path, "Too long", sum(self.episode_returns), len(self.episode_returns) * 0.01)
done, reward = episode_end("Too long", -10)




Expand Down
Binary file modified train_test/best_global_model.zip
Binary file not shown.
Binary file modified train_test/best_model.zip
Binary file not shown.
Binary file modified train_test/evaluations.npz
Binary file not shown.
2 changes: 1 addition & 1 deletion train_test/mean_reward.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1107.9332437999997
944.3080034500001

0 comments on commit 01c764c

Please sign in to comment.