blob: 5d79ba951d5962d7e11d479bc5ef797bad11809b [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(
23 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder,
24 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070025
26 // Path from the far side of the rocket to the loading station to pickup
Alex Perrycb7da4b2019-08-28 19:35:56 -070027 static flatbuffers::Offset<frc971::MultiSpline> FarRocketToHP(
28 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder,
29 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070030
31 // Path from the far side of the rocket to the loading station to pickup
Alex Perrycb7da4b2019-08-28 19:35:56 -070032 static flatbuffers::Offset<frc971::MultiSpline> HPToFarRocket(
33 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder,
34 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070035
36 // Path from the far side of the rocket to close to the loading station
Alex Perrycb7da4b2019-08-28 19:35:56 -070037 static flatbuffers::Offset<frc971::MultiSpline> FarRocketToNearHP(
38 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder,
39 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070040
41 // Splines for 2 Panels on the far reaches of the cargo ship
42
43 // Path from level 2 to 2nd cargo ship bay with a hatch panel
Alex Perrycb7da4b2019-08-28 19:35:56 -070044 static flatbuffers::Offset<frc971::MultiSpline> HABToSecondCargoShipBay(
45 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder,
46 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070047
48 // Path from 2nd cargo ship bay to loading station
Alex Perrycb7da4b2019-08-28 19:35:56 -070049 static flatbuffers::Offset<frc971::MultiSpline> SecondCargoShipBayToHP(
50 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder,
51 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070052
53 // Path from loading station to 3rd cargo ship bay with a hatch panel
Alex Perrycb7da4b2019-08-28 19:35:56 -070054 static flatbuffers::Offset<frc971::MultiSpline> HPToThirdCargoShipBay(
55 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder,
56 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070057
58 // Path from 3rd cargo ship bay to near the loading station
Alex Perrycb7da4b2019-08-28 19:35:56 -070059 static flatbuffers::Offset<frc971::MultiSpline> ThirdCargoShipBayToNearHP(
60 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder,
61 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070062
63 // Testing Splines
Alex Perrycb7da4b2019-08-28 19:35:56 -070064 static flatbuffers::Offset<frc971::MultiSpline> HPToNearRocketTest(
65 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder);
66 static flatbuffers::Offset<frc971::MultiSpline> HabToFarRocketTest(
67 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder,
68 bool is_left);
69 static flatbuffers::Offset<frc971::MultiSpline> FarRocketToHPTest(
70 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder);
Austin Schuhb5b79a52019-05-08 20:32:07 -070071
Alex Perrycb7da4b2019-08-28 19:35:56 -070072 static flatbuffers::Offset<frc971::MultiSpline> BasicSSpline(
73 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder);
74 static flatbuffers::Offset<frc971::MultiSpline> StraightLine(
75 aos::Sender<frc971::control_loops::drivetrain::Goal>::Builder *builder);
Austin Schuh6bcc2302019-03-23 22:28:06 -070076};
77
78} // namespace actors
79} // namespace y2019
80
Austin Schuhb5b79a52019-05-08 20:32:07 -070081#endif // Y2019_ACTORS_AUTO_SPLINES_H_