Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 1 | #ifndef y2020_ACTORS_AUTO_SPLINES_H_ |
| 2 | #define y2020_ACTORS_AUTO_SPLINES_H_ |
| 3 | |
| 4 | #include "aos/events/event_loop.h" |
Ravago Jones | c2a0802 | 2021-02-06 17:40:54 -0800 | [diff] [blame] | 5 | #include "aos/flatbuffer_merge.h" |
James Kuszmaul | ddd2ba6 | 2020-03-08 22:17:13 -0700 | [diff] [blame] | 6 | #include "aos/robot_state/joystick_state_generated.h" |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 7 | #include "frc971/control_loops/control_loops_generated.h" |
| 8 | #include "frc971/control_loops/drivetrain/drivetrain_goal_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 | |
| 16 | namespace y2020 { |
| 17 | namespace actors { |
| 18 | |
| 19 | class AutonomousSplines { |
| 20 | public: |
Ravago Jones | c2a0802 | 2021-02-06 17:40:54 -0800 | [diff] [blame] | 21 | AutonomousSplines() |
| 22 | : test_spline_(aos::JsonFileToFlatbuffer<frc971::MultiSpline>( |
| 23 | "splines/test_spline.json")) {} |
| 24 | |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 25 | static flatbuffers::Offset<frc971::MultiSpline> BasicSSpline( |
James Kuszmaul | ddd2ba6 | 2020-03-08 22:17:13 -0700 | [diff] [blame] | 26 | aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder, |
| 27 | aos::Alliance alliance); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 28 | static flatbuffers::Offset<frc971::MultiSpline> StraightLine( |
| 29 | aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder); |
Ravago Jones | c2a0802 | 2021-02-06 17:40:54 -0800 | [diff] [blame] | 30 | |
| 31 | flatbuffers::Offset<frc971::MultiSpline> TestSpline( |
| 32 | aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder) { |
| 33 | return aos::CopyFlatBuffer<frc971::MultiSpline>(test_spline_, |
| 34 | builder->fbb()); |
| 35 | } |
| 36 | |
| 37 | private: |
| 38 | aos::FlatbufferDetachedBuffer<frc971::MultiSpline> test_spline_; |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | } // namespace actors |
| 42 | } // namespace y2020 |
| 43 | |
| 44 | #endif // y2020_ACTORS_AUTO_SPLINES_H_ |