Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 1 | #ifndef Y2023_ACTORS_AUTO_SPLINES_H_ |
| 2 | #define Y2023_ACTORS_AUTO_SPLINES_H_ |
| 3 | |
| 4 | #include "aos/events/event_loop.h" |
| 5 | #include "frc971/control_loops/control_loops_generated.h" |
James Kuszmaul | 713c5ce | 2023-03-04 18:23:24 -0800 | [diff] [blame^] | 6 | #include "frc971/input/joystick_state_generated.h" |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 7 | #include "frc971/control_loops/drivetrain/drivetrain_goal_generated.h" |
| 8 | /* |
| 9 | |
| 10 | The cooridinate system for the autonomous splines is the same as the spline |
| 11 | python generator and drivetrain spline systems. |
| 12 | |
| 13 | */ |
| 14 | |
| 15 | namespace y2023 { |
| 16 | namespace actors { |
| 17 | |
| 18 | class AutonomousSplines { |
| 19 | public: |
James Kuszmaul | 713c5ce | 2023-03-04 18:23:24 -0800 | [diff] [blame^] | 20 | AutonomousSplines() |
| 21 | : test_spline_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 22 | "splines/test_spline.json")) {} |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 23 | static flatbuffers::Offset<frc971::MultiSpline> BasicSSpline( |
James Kuszmaul | 713c5ce | 2023-03-04 18:23:24 -0800 | [diff] [blame^] | 24 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 25 | *builder, |
| 26 | aos::Alliance alliance); |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 27 | static flatbuffers::Offset<frc971::MultiSpline> StraightLine( |
James Kuszmaul | 713c5ce | 2023-03-04 18:23:24 -0800 | [diff] [blame^] | 28 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 29 | *builder, |
| 30 | aos::Alliance alliance); |
| 31 | |
| 32 | flatbuffers::Offset<frc971::MultiSpline> TestSpline( |
| 33 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 34 | *builder, |
| 35 | aos::Alliance alliance); |
| 36 | private: |
| 37 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> test_spline_; |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | } // namespace actors |
| 41 | } // namespace y2023 |
| 42 | |
| 43 | #endif // Y2023_ACTORS_AUTO_SPLINES_H_ |