Austin Schuh | 6bcc230 | 2019-03-23 22:28:06 -0700 | [diff] [blame] | 1 | #ifndef Y2019_ACTORS_AUTO_SPLINES_H_ |
| 2 | #define Y2019_ACTORS_AUTO_SPLINES_H_ |
| 3 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 4 | #include "aos/events/event_loop.h" |
| 5 | #include "frc971/control_loops/control_loops_generated.h" |
| 6 | #include "frc971/control_loops/drivetrain/drivetrain_goal_generated.h" |
Austin Schuh | 6bcc230 | 2019-03-23 22:28:06 -0700 | [diff] [blame] | 7 | /* |
| 8 | |
| 9 | The cooridinate system for the autonomous splines is the same as the spline |
| 10 | python generator and drivetrain spline systems. |
| 11 | |
| 12 | */ |
| 13 | |
| 14 | namespace y2019 { |
| 15 | namespace actors { |
| 16 | |
| 17 | class AutonomousSplines { |
| 18 | public: |
Austin Schuh | b5b79a5 | 2019-05-08 20:32:07 -0700 | [diff] [blame] | 19 | // Splines for 2 Panels on the far side of the Rocket |
| 20 | |
| 21 | // Path off of level 2 to the far side of the rocket with a panel |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 22 | static flatbuffers::Offset<frc971::MultiSpline> HABToFarRocket( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 23 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 24 | *builder, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 25 | bool is_left); |
Austin Schuh | b5b79a5 | 2019-05-08 20:32:07 -0700 | [diff] [blame] | 26 | |
| 27 | // Path from the far side of the rocket to the loading station to pickup |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 28 | static flatbuffers::Offset<frc971::MultiSpline> FarRocketToHP( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 29 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 30 | *builder, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 31 | bool is_left); |
Austin Schuh | b5b79a5 | 2019-05-08 20:32:07 -0700 | [diff] [blame] | 32 | |
| 33 | // Path from the far side of the rocket to the loading station to pickup |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 34 | static flatbuffers::Offset<frc971::MultiSpline> HPToFarRocket( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 35 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 36 | *builder, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 37 | bool is_left); |
Austin Schuh | b5b79a5 | 2019-05-08 20:32:07 -0700 | [diff] [blame] | 38 | |
| 39 | // Path from the far side of the rocket to close to the loading station |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 40 | static flatbuffers::Offset<frc971::MultiSpline> FarRocketToNearHP( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 41 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 42 | *builder, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 43 | bool is_left); |
Austin Schuh | b5b79a5 | 2019-05-08 20:32:07 -0700 | [diff] [blame] | 44 | |
| 45 | // Splines for 2 Panels on the far reaches of the cargo ship |
| 46 | |
| 47 | // Path from level 2 to 2nd cargo ship bay with a hatch panel |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 48 | static flatbuffers::Offset<frc971::MultiSpline> HABToSecondCargoShipBay( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 49 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 50 | *builder, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 51 | bool is_left); |
Austin Schuh | b5b79a5 | 2019-05-08 20:32:07 -0700 | [diff] [blame] | 52 | |
| 53 | // Path from 2nd cargo ship bay to loading station |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 54 | static flatbuffers::Offset<frc971::MultiSpline> SecondCargoShipBayToHP( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 55 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 56 | *builder, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 57 | bool is_left); |
Austin Schuh | b5b79a5 | 2019-05-08 20:32:07 -0700 | [diff] [blame] | 58 | |
| 59 | // Path from loading station to 3rd cargo ship bay with a hatch panel |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 60 | static flatbuffers::Offset<frc971::MultiSpline> HPToThirdCargoShipBay( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 61 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 62 | *builder, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 63 | bool is_left); |
Austin Schuh | b5b79a5 | 2019-05-08 20:32:07 -0700 | [diff] [blame] | 64 | |
| 65 | // Path from 3rd cargo ship bay to near the loading station |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 66 | static flatbuffers::Offset<frc971::MultiSpline> ThirdCargoShipBayToNearHP( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 67 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 68 | *builder, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 69 | bool is_left); |
Austin Schuh | b5b79a5 | 2019-05-08 20:32:07 -0700 | [diff] [blame] | 70 | |
| 71 | // Testing Splines |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 72 | static flatbuffers::Offset<frc971::MultiSpline> HPToNearRocketTest( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 73 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 74 | *builder); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 75 | static flatbuffers::Offset<frc971::MultiSpline> HabToFarRocketTest( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 76 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 77 | *builder, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 78 | bool is_left); |
| 79 | static flatbuffers::Offset<frc971::MultiSpline> FarRocketToHPTest( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 80 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 81 | *builder); |
Austin Schuh | b5b79a5 | 2019-05-08 20:32:07 -0700 | [diff] [blame] | 82 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 83 | static flatbuffers::Offset<frc971::MultiSpline> BasicSSpline( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 84 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 85 | *builder); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 86 | static flatbuffers::Offset<frc971::MultiSpline> StraightLine( |
James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 87 | aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder |
| 88 | *builder); |
Austin Schuh | 6bcc230 | 2019-03-23 22:28:06 -0700 | [diff] [blame] | 89 | }; |
| 90 | |
| 91 | } // namespace actors |
| 92 | } // namespace y2019 |
| 93 | |
Austin Schuh | b5b79a5 | 2019-05-08 20:32:07 -0700 | [diff] [blame] | 94 | #endif // Y2019_ACTORS_AUTO_SPLINES_H_ |