Maxwell Henderson | 64f3745 | 2023-03-11 13:39:21 -0800 | [diff] [blame] | 1 | #ifndef Y2023_AUTONOMOUS_AUTO_SPLINES_H_ |
| 2 | #define Y2023_AUTONOMOUS_AUTO_SPLINES_H_ |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 3 | |
| 4 | #include "aos/events/event_loop.h" |
Maxwell Henderson | 64f3745 | 2023-03-11 13:39:21 -0800 | [diff] [blame] | 5 | #include "aos/flatbuffer_merge.h" |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 6 | #include "frc971/control_loops/control_loops_generated.h" |
James Kuszmaul | 713c5ce | 2023-03-04 18:23:24 -0800 | [diff] [blame] | 7 | #include "frc971/input/joystick_state_generated.h" |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 8 | #include "frc971/control_loops/drivetrain/drivetrain_goal_generated.h" |
Maxwell Henderson | 64f3745 | 2023-03-11 13:39:21 -0800 | [diff] [blame] | 9 | #include "frc971/input/joystick_state_generated.h" |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 10 | /* |
| 11 | |
| 12 | The cooridinate system for the autonomous splines is the same as the spline |
| 13 | python generator and drivetrain spline systems. |
| 14 | |
| 15 | */ |
| 16 | |
| 17 | namespace y2023 { |
Maxwell Henderson | 64f3745 | 2023-03-11 13:39:21 -0800 | [diff] [blame] | 18 | namespace autonomous { |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 19 | |
| 20 | class AutonomousSplines { |
| 21 | public: |
James Kuszmaul | 713c5ce | 2023-03-04 18:23:24 -0800 | [diff] [blame] | 22 | AutonomousSplines() |
Maxwell Henderson | 64f3745 | 2023-03-11 13:39:21 -0800 | [diff] [blame] | 23 | : test_spline_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 24 | "splines/test_spline.json")), |
| 25 | spline_1_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 26 | "splines/spline_1.json")), |
| 27 | spline_2_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 28 | "splines/spline_2.json")), |
| 29 | spline_3_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 30 | "splines/spline_3.json")), |
| 31 | spline_4_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 32 | "splines/spline_4.json")), |
| 33 | spline_5_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 34 | "splines/spline_5.json")) {} |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 35 | static flatbuffers::Offset<frc971::MultiSpline> BasicSSpline( |
James Kuszmaul | 713c5ce | 2023-03-04 18:23:24 -0800 | [diff] [blame] | 36 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 37 | *builder, |
| 38 | aos::Alliance alliance); |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 39 | static flatbuffers::Offset<frc971::MultiSpline> StraightLine( |
James Kuszmaul | 713c5ce | 2023-03-04 18:23:24 -0800 | [diff] [blame] | 40 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 41 | *builder, |
| 42 | aos::Alliance alliance); |
| 43 | |
| 44 | flatbuffers::Offset<frc971::MultiSpline> TestSpline( |
| 45 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 46 | *builder, |
| 47 | aos::Alliance alliance); |
Maxwell Henderson | 64f3745 | 2023-03-11 13:39:21 -0800 | [diff] [blame] | 48 | flatbuffers::Offset<frc971::MultiSpline> Spline1( |
| 49 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 50 | *builder, |
| 51 | aos::Alliance alliance); |
| 52 | flatbuffers::Offset<frc971::MultiSpline> Spline2( |
| 53 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 54 | *builder, |
| 55 | aos::Alliance alliance); |
| 56 | flatbuffers::Offset<frc971::MultiSpline> Spline3( |
| 57 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 58 | *builder, |
| 59 | aos::Alliance alliance); |
| 60 | flatbuffers::Offset<frc971::MultiSpline> Spline4( |
| 61 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 62 | *builder, |
| 63 | aos::Alliance alliance); |
| 64 | flatbuffers::Offset<frc971::MultiSpline> Spline5( |
| 65 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 66 | *builder, |
| 67 | aos::Alliance alliance); |
| 68 | |
James Kuszmaul | 713c5ce | 2023-03-04 18:23:24 -0800 | [diff] [blame] | 69 | private: |
| 70 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> test_spline_; |
Maxwell Henderson | 64f3745 | 2023-03-11 13:39:21 -0800 | [diff] [blame] | 71 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> spline_1_; |
| 72 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> spline_2_; |
| 73 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> spline_3_; |
| 74 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> spline_4_; |
| 75 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> spline_5_; |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 76 | }; |
| 77 | |
Maxwell Henderson | 64f3745 | 2023-03-11 13:39:21 -0800 | [diff] [blame] | 78 | } // namespace autonomous |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 79 | } // namespace y2023 |
| 80 | |
Maxwell Henderson | 64f3745 | 2023-03-11 13:39:21 -0800 | [diff] [blame] | 81 | #endif // Y2023_AUTONOMOUS_AUTO_SPLINES_H_ |