* Runs initialization code. This occurs as soon as the program is started. * * All other competition modes are blocked by initialize; it is recommended * to keep execution time for this mode under a few seconds. */
| 85 | * to keep execution time for this mode under a few seconds. |
| 86 | */ |
| 87 | void initialize() { |
| 88 | pros::lcd::initialize(); // initialize brain screen |
| 89 | chassis.calibrate(); // calibrate sensors |
| 90 | |
| 91 | // the default rate is 50. however, if you need to change the rate, you |
| 92 | // can do the following. |
| 93 | // lemlib::bufferedStdout().setRate(...); |
| 94 | // If you use bluetooth or a wired connection, you will want to have a rate of 10ms |
| 95 | |
| 96 | // for more information on how the formatting for the loggers |
| 97 | // works, refer to the fmtlib docs |
| 98 | |
| 99 | // thread to for brain screen and position logging |
| 100 | pros::Task screenTask([&]() { |
| 101 | while (true) { |
| 102 | // print robot location to the brain screen |
| 103 | pros::lcd::print(0, "X: %f", chassis.getPose().x); // x |
| 104 | pros::lcd::print(1, "Y: %f", chassis.getPose().y); // y |
| 105 | pros::lcd::print(2, "Theta: %f", chassis.getPose().theta); // heading |
| 106 | // log position telemetry |
| 107 | lemlib::telemetrySink()->info("Chassis pose: {}", chassis.getPose()); |
| 108 | // delay to save resources |
| 109 | pros::delay(50); |
| 110 | } |
| 111 | }); |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Runs while the robot is disabled |
nothing calls this directly
no test coverage detected