Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 1 | #ifndef Y2024_AUTONOMOUS_AUTO_SPLINES_H_ |
| 2 | #define Y2024_AUTONOMOUS_AUTO_SPLINES_H_ |
| 3 | |
| 4 | #include "aos/events/event_loop.h" |
| 5 | #include "aos/flatbuffer_merge.h" |
| 6 | #include "frc971/control_loops/control_loops_generated.h" |
| 7 | #include "frc971/control_loops/drivetrain/drivetrain_goal_generated.h" |
| 8 | #include "frc971/input/joystick_state_generated.h" |
| 9 | /* |
| 10 | |
| 11 | The cooridinate system for the autonomous splines is the same as the spline |
| 12 | python generator and drivetrain spline systems. |
| 13 | |
| 14 | */ |
| 15 | |
Maxwell Henderson | 09a4b02 | 2024-01-19 21:39:51 -0800 | [diff] [blame] | 16 | namespace y2024::autonomous { |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 17 | |
| 18 | class AutonomousSplines { |
| 19 | public: |
| 20 | AutonomousSplines() |
| 21 | : test_spline_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
James Kuszmaul | b5f1183 | 2024-03-15 22:30:59 -0700 | [diff] [blame] | 22 | "splines/test_spline.json")), |
| 23 | mobility_and_shoot_spline_( |
| 24 | aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 25 | "splines/mobilityandshoot.0.json")), |
| 26 | four_piece_spline_1_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 27 | "splines/five_note.0.json")), |
| 28 | four_piece_spline_2_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 29 | "splines/five_note.1.json")), |
| 30 | four_piece_spline_3_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 31 | "splines/five_note.2.json")), |
| 32 | four_piece_spline_4_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 33 | "splines/five_note.3.json")), |
| 34 | four_piece_spline_5_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
Maxwell Henderson | a2dadd0 | 2024-03-24 13:57:09 -0700 | [diff] [blame] | 35 | "splines/five_note.4.json")), |
| 36 | two_piece_steal_spline_1_( |
| 37 | aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 38 | "splines/five_note.0.json")), |
| 39 | two_piece_steal_spline_2_( |
| 40 | aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 41 | "splines/five_note.1.json")), |
| 42 | two_piece_steal_spline_3_( |
| 43 | aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 44 | "splines/five_note.2.json")), |
| 45 | two_piece_steal_spline_4_( |
| 46 | aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 47 | "splines/five_note.3.json")) {} |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 48 | static flatbuffers::Offset<frc971::MultiSpline> BasicSSpline( |
| 49 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 50 | *builder, |
| 51 | aos::Alliance alliance); |
| 52 | static flatbuffers::Offset<frc971::MultiSpline> StraightLine( |
| 53 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 54 | *builder, |
| 55 | aos::Alliance alliance); |
| 56 | |
| 57 | flatbuffers::Offset<frc971::MultiSpline> TestSpline( |
| 58 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 59 | *builder, |
| 60 | aos::Alliance alliance); |
James Kuszmaul | b5f1183 | 2024-03-15 22:30:59 -0700 | [diff] [blame] | 61 | flatbuffers::Offset<frc971::MultiSpline> MobilityAndShootSpline( |
| 62 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 63 | *builder, |
| 64 | aos::Alliance alliance); |
| 65 | flatbuffers::Offset<frc971::MultiSpline> FourPieceSpline1( |
| 66 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 67 | *builder, |
| 68 | aos::Alliance alliance); |
| 69 | flatbuffers::Offset<frc971::MultiSpline> FourPieceSpline2( |
| 70 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 71 | *builder, |
| 72 | aos::Alliance alliance); |
| 73 | flatbuffers::Offset<frc971::MultiSpline> FourPieceSpline3( |
| 74 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 75 | *builder, |
| 76 | aos::Alliance alliance); |
| 77 | flatbuffers::Offset<frc971::MultiSpline> FourPieceSpline4( |
| 78 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 79 | *builder, |
| 80 | aos::Alliance alliance); |
| 81 | flatbuffers::Offset<frc971::MultiSpline> FourPieceSpline5( |
| 82 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 83 | *builder, |
| 84 | aos::Alliance alliance); |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 85 | |
Maxwell Henderson | a2dadd0 | 2024-03-24 13:57:09 -0700 | [diff] [blame] | 86 | flatbuffers::Offset<frc971::MultiSpline> TwoPieceStealSpline1( |
| 87 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 88 | *builder, |
| 89 | aos::Alliance alliance); |
| 90 | flatbuffers::Offset<frc971::MultiSpline> TwoPieceStealSpline2( |
| 91 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 92 | *builder, |
| 93 | aos::Alliance alliance); |
| 94 | flatbuffers::Offset<frc971::MultiSpline> TwoPieceStealSpline3( |
| 95 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 96 | *builder, |
| 97 | aos::Alliance alliance); |
| 98 | flatbuffers::Offset<frc971::MultiSpline> TwoPieceStealSpline4( |
| 99 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 100 | *builder, |
| 101 | aos::Alliance alliance); |
| 102 | |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 103 | private: |
| 104 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> test_spline_; |
James Kuszmaul | b5f1183 | 2024-03-15 22:30:59 -0700 | [diff] [blame] | 105 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> mobility_and_shoot_spline_; |
| 106 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> four_piece_spline_1_; |
| 107 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> four_piece_spline_2_; |
| 108 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> four_piece_spline_3_; |
| 109 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> four_piece_spline_4_; |
| 110 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> four_piece_spline_5_; |
Maxwell Henderson | a2dadd0 | 2024-03-24 13:57:09 -0700 | [diff] [blame] | 111 | |
| 112 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> two_piece_steal_spline_1_; |
| 113 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> two_piece_steal_spline_2_; |
| 114 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> two_piece_steal_spline_3_; |
| 115 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> two_piece_steal_spline_4_; |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 116 | }; |
| 117 | |
Maxwell Henderson | 09a4b02 | 2024-01-19 21:39:51 -0800 | [diff] [blame] | 118 | } // namespace y2024::autonomous |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 119 | |
| 120 | #endif // Y2024_AUTONOMOUS_AUTO_SPLINES_H_ |