RoboJackets / robocup-software

Georgia Tech RoboJackets Software for the RoboCup Small Size League
Apache License 2.0
179 stars 186 forks source link

Add --timeout flag to simulator #320

Closed justbuchanan closed 7 years ago

justbuchanan commented 9 years ago

This way we can optionally have the simulator exit after a few seconds of not receiving any messages from soccer. See PR #319.

jgkamat commented 7 years ago

This is really bugging me, and I would love it to be fixed by someone new! I don't think it would be too hard, and it would definetly give you a nice overview of protobuf (possibly) and C++, although it would deal with our simulator code, which may eventually get deprecated.

jgkamat commented 7 years ago

Example of using rj::time https://github.com/RoboJackets/robocup-software/blob/d18e9b7fd56f42e1888e494064e0c264a9cceae8/soccer/Timeout.hpp

Place to potentially add reset timer: https://github.com/RoboJackets/robocup-software/blob/d18e9b7fd56f42e1888e494064e0c264a9cceae8/simulator/physics/Environment.cpp#L351

this is the main method: https://github.com/RoboJackets/robocup-software/blob/d18e9b7fd56f42e1888e494064e0c264a9cceae8/simulator/simulator.cpp

kevinatorchen commented 7 years ago

How to exit out of the simulator correctly?

jgkamat commented 7 years ago

This stackoverflow post has a little bit of info on it :http://stackoverflow.com/questions/8026101/correct-way-to-quit-a-qt-program

From what I can tell, there should be a quit() method that should do what we want.

In the main method, there is a 'QApplication' object, which you could call exit() on as well.

I'm not sure if these work though, so test them out and let me know what happens!