| 14 | #include "../test_helpers/robot_data.hpp" |
| 15 | |
| 16 | bool checkIfFileExists(const std::string& file, double max_time_waiting = 10.0) { |
| 17 | struct stat buffer; |
| 18 | const clock_t begin_time = std::clock(); |
| 19 | double t {0.0}; |
| 20 | while (t < max_time_waiting) { |
| 21 | std::this_thread::sleep_for(std::chrono::milliseconds(50)); |
| 22 | t = double(std::clock() - begin_time) / CLOCKS_PER_SEC; |
| 23 | if (stat(file.c_str(), &buffer) == 0) { |
| 24 | return true; |
| 25 | } |
| 26 | } |
| 27 | return false; |
| 28 | } |
| 29 | |
| 30 | F2CCell create_polygon(void) { |
| 31 | F2CCell poly; |