blob: 4d6fbc1f100dc7b32d5055e4e620bad84fb5fa9e [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
Stephan Pleinesd99b1ee2024-02-02 20:56:44 -080014namespace y2019::actors {
Austin Schuh6bcc2302019-03-23 22:28:06 -070015
16class AutonomousSplines {
17 public:
Austin Schuhb5b79a52019-05-08 20:32:07 -070018 // Splines for 2 Panels on the far side of the Rocket
19
20 // Path off of level 2 to the far side of the rocket with a panel
Alex Perrycb7da4b2019-08-28 19:35:56 -070021 static flatbuffers::Offset<frc971::MultiSpline> HABToFarRocket(
James Kuszmaul75a18c52021-03-10 22:02:07 -080022 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
23 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070024 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(
James Kuszmaul75a18c52021-03-10 22:02:07 -080028 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
29 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070030 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070031
32 // Path from the far side of the rocket to the loading station to pickup
Alex Perrycb7da4b2019-08-28 19:35:56 -070033 static flatbuffers::Offset<frc971::MultiSpline> HPToFarRocket(
James Kuszmaul75a18c52021-03-10 22:02:07 -080034 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
35 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070036 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070037
38 // Path from the far side of the rocket to close to the loading station
Alex Perrycb7da4b2019-08-28 19:35:56 -070039 static flatbuffers::Offset<frc971::MultiSpline> FarRocketToNearHP(
James Kuszmaul75a18c52021-03-10 22:02:07 -080040 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
41 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070042 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070043
44 // Splines for 2 Panels on the far reaches of the cargo ship
45
46 // Path from level 2 to 2nd cargo ship bay with a hatch panel
Alex Perrycb7da4b2019-08-28 19:35:56 -070047 static flatbuffers::Offset<frc971::MultiSpline> HABToSecondCargoShipBay(
James Kuszmaul75a18c52021-03-10 22:02:07 -080048 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
49 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070050 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070051
52 // Path from 2nd cargo ship bay to loading station
Alex Perrycb7da4b2019-08-28 19:35:56 -070053 static flatbuffers::Offset<frc971::MultiSpline> SecondCargoShipBayToHP(
James Kuszmaul75a18c52021-03-10 22:02:07 -080054 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
55 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070056 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070057
58 // Path from loading station to 3rd cargo ship bay with a hatch panel
Alex Perrycb7da4b2019-08-28 19:35:56 -070059 static flatbuffers::Offset<frc971::MultiSpline> HPToThirdCargoShipBay(
James Kuszmaul75a18c52021-03-10 22:02:07 -080060 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
61 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070062 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070063
64 // Path from 3rd cargo ship bay to near the loading station
Alex Perrycb7da4b2019-08-28 19:35:56 -070065 static flatbuffers::Offset<frc971::MultiSpline> ThirdCargoShipBayToNearHP(
James Kuszmaul75a18c52021-03-10 22:02:07 -080066 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
67 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070068 bool is_left);
Austin Schuhb5b79a52019-05-08 20:32:07 -070069
70 // Testing Splines
Alex Perrycb7da4b2019-08-28 19:35:56 -070071 static flatbuffers::Offset<frc971::MultiSpline> HPToNearRocketTest(
James Kuszmaul75a18c52021-03-10 22:02:07 -080072 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
73 *builder);
Alex Perrycb7da4b2019-08-28 19:35:56 -070074 static flatbuffers::Offset<frc971::MultiSpline> HabToFarRocketTest(
James Kuszmaul75a18c52021-03-10 22:02:07 -080075 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
76 *builder,
Alex Perrycb7da4b2019-08-28 19:35:56 -070077 bool is_left);
78 static flatbuffers::Offset<frc971::MultiSpline> FarRocketToHPTest(
James Kuszmaul75a18c52021-03-10 22:02:07 -080079 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
80 *builder);
Austin Schuhb5b79a52019-05-08 20:32:07 -070081
Alex Perrycb7da4b2019-08-28 19:35:56 -070082 static flatbuffers::Offset<frc971::MultiSpline> BasicSSpline(
James Kuszmaul75a18c52021-03-10 22:02:07 -080083 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
84 *builder);
Alex Perrycb7da4b2019-08-28 19:35:56 -070085 static flatbuffers::Offset<frc971::MultiSpline> StraightLine(
James Kuszmaul75a18c52021-03-10 22:02:07 -080086 aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
87 *builder);
Austin Schuh6bcc2302019-03-23 22:28:06 -070088};
89
Stephan Pleinesd99b1ee2024-02-02 20:56:44 -080090} // namespace y2019::actors
Austin Schuh6bcc2302019-03-23 22:28:06 -070091
Austin Schuhb5b79a52019-05-08 20:32:07 -070092#endif // Y2019_ACTORS_AUTO_SPLINES_H_