blob: 7b56c11ba2ceba35efc3976f7eb3d20730894e3b [file] [log] [blame]
Austin Schuh6bcc2302019-03-23 22:28:06 -07001#ifndef Y2019_ACTORS_AUTO_SPLINES_H_
2#define Y2019_ACTORS_AUTO_SPLINES_H_
3
Alex Perrycb7da4b2019-08-28 19:35:56 -07004#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 Schuh6bcc2302019-03-23 22:28:06 -07007/*
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
14namespace y2019 {
15namespace actors {
16
17class AutonomousSplines {
18 public:
Austin Schuhb5b79a52019-05-08 20:32:07 -070019 // 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 Perrycb7da4b2019-08-28 19:35:56 -070022 static flatbuffers::Offset<frc971::MultiSpline> HABToFarRocket(
James Kuszmaul75a18c52021-03-10 22:02:07 -080023 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
24 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070025 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070026
27 // Path from the far side of the rocket to the loading station to pickup
Alex Perrycb7da4b2019-08-28 19:35:56 -070028 static flatbuffers::Offset<frc971::MultiSpline> FarRocketToHP(
James Kuszmaul75a18c52021-03-10 22:02:07 -080029 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
30 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070031 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070032
33 // Path from the far side of the rocket to the loading station to pickup
Alex Perrycb7da4b2019-08-28 19:35:56 -070034 static flatbuffers::Offset<frc971::MultiSpline> HPToFarRocket(
James Kuszmaul75a18c52021-03-10 22:02:07 -080035 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
36 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070037 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070038
39 // Path from the far side of the rocket to close to the loading station
Alex Perrycb7da4b2019-08-28 19:35:56 -070040 static flatbuffers::Offset<frc971::MultiSpline> FarRocketToNearHP(
James Kuszmaul75a18c52021-03-10 22:02:07 -080041 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
42 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070043 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070044
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 Perrycb7da4b2019-08-28 19:35:56 -070048 static flatbuffers::Offset<frc971::MultiSpline> HABToSecondCargoShipBay(
James Kuszmaul75a18c52021-03-10 22:02:07 -080049 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
50 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070051 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070052
53 // Path from 2nd cargo ship bay to loading station
Alex Perrycb7da4b2019-08-28 19:35:56 -070054 static flatbuffers::Offset<frc971::MultiSpline> SecondCargoShipBayToHP(
James Kuszmaul75a18c52021-03-10 22:02:07 -080055 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
56 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070057 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070058
59 // Path from loading station to 3rd cargo ship bay with a hatch panel
Alex Perrycb7da4b2019-08-28 19:35:56 -070060 static flatbuffers::Offset<frc971::MultiSpline> HPToThirdCargoShipBay(
James Kuszmaul75a18c52021-03-10 22:02:07 -080061 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
62 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070063 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070064
65 // Path from 3rd cargo ship bay to near the loading station
Alex Perrycb7da4b2019-08-28 19:35:56 -070066 static flatbuffers::Offset<frc971::MultiSpline> ThirdCargoShipBayToNearHP(
James Kuszmaul75a18c52021-03-10 22:02:07 -080067 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
68 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070069 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070070
71 // Testing Splines
Alex Perrycb7da4b2019-08-28 19:35:56 -070072 static flatbuffers::Offset<frc971::MultiSpline> HPToNearRocketTest(
James Kuszmaul75a18c52021-03-10 22:02:07 -080073 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
74 *builder);
Alex Perrycb7da4b2019-08-28 19:35:56 -070075 static flatbuffers::Offset<frc971::MultiSpline> HabToFarRocketTest(
James Kuszmaul75a18c52021-03-10 22:02:07 -080076 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
77 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070078 bool is_left);
79 static flatbuffers::Offset<frc971::MultiSpline> FarRocketToHPTest(
James Kuszmaul75a18c52021-03-10 22:02:07 -080080 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
81 *builder);
Austin Schuhb5b79a52019-05-08 20:32:07 -070082
Alex Perrycb7da4b2019-08-28 19:35:56 -070083 static flatbuffers::Offset<frc971::MultiSpline> BasicSSpline(
James Kuszmaul75a18c52021-03-10 22:02:07 -080084 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
85 *builder);
Alex Perrycb7da4b2019-08-28 19:35:56 -070086 static flatbuffers::Offset<frc971::MultiSpline> StraightLine(
James Kuszmaul75a18c52021-03-10 22:02:07 -080087 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
88 *builder);
Austin Schuh6bcc2302019-03-23 22:28:06 -070089};
90
91} // namespace actors
92} // namespace y2019
93
Austin Schuhb5b79a52019-05-08 20:32:07 -070094#endif // Y2019_ACTORS_AUTO_SPLINES_H_