Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any function to get the race scores? #126

Open
ghost opened this issue Nov 14, 2019 · 4 comments
Open

Is there any function to get the race scores? #126

ghost opened this issue Nov 14, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 14, 2019

I need to extract the scores to train my reinforcement learning model. Is there any function to get number of passed gates, time and penalties at each step time?
I know I can read them from the log file, but reading a file is time consuming. I need to do it through the API.

@madratman
Copy link
Contributor

Are you sure it's time consuming? Have you tried reading from the log fie? Reading the file is less overhead than reading via api (over a port and cost of serializing / deserializing). If you need help in how to read the log file, we have sample code in the repo. In the api scenario, you'll essentially call a score api every few ms, which you can do for leading the last line of the log file as well.

@ghost
Copy link
Author

ghost commented Nov 14, 2019

Ok, Thank you. I will try the log file.

@surfii3z
Copy link

@madratman I am also trying to do the same thing. Should I run two separate scripts i.e. baseline_racer.py and log_monitor.py? or Do I make a another thread in the baseline_racer.py for reading the log file? Thanks

@madratman
Copy link
Contributor

madratman commented Nov 15, 2019

@surfii3z it's up to you. Yes, you can make a thread in baseline_racer, if you want to have read and use the log in the same script when you're moving the drone.. You can modify the path in the log_monitor script (in this line) to be AirSimExe/Saved/Logs/RaceLogs/*.log - and start the thread after you call simstartrace - so that the log monitor opens the latest file opened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants