blob: 9a0b6ddd2a51719b00d806e74447f9182fa5a746 [file] [log] [blame]
Niko Sohmersb21dbdc2024-01-20 20:06:59 -08001#include "aos/util/file.h"
2#include "y2024/constants.h"
3
4using namespace y2024::constants;
5
6// This file generates some JSON constants information for the intake that are
7// currently dependent on values that are located in C++ headers and would be
8// obnoxious/inappropriate to pull out. In the future the file may be used to
9// generate constants information for other subsystems as well
10int main(int argc, char *argv[]) {
11 CHECK_EQ(argc, 2) << "Must supply file name to output to.";
12 std::string output_file = argv[1];
13
14 std::stringstream output;
15
16 output << "\"average_filter_size\": " << Values::kZeroingSampleSize << ",\n";
17 output << "\"one_revolution_distance\": "
18 << M_PI * 2.0 * Values::kIntakePivotEncoderRatio() << ",\n";
19 output << "\"zeroing_threshold\": 0.0005,\n";
20 output << "\"moving_buffer_size\": 20,\n";
21 output << "\"allowable_encoder_error\": 0.9\n";
22 aos::util::WriteStringToFileOrDie(output_file, output.str());
23 return 0;
24}