Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auton #12

Open
wants to merge 149 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
d4de5bf
juicy
FlyN-Nick Jan 20, 2020
a7530f7
Driving should now work other than changing a few presets.
FlyN-Nick Jan 20, 2020
c16f84b
add branch plans summary in Shoot.java
Exr0n Jan 20, 2020
81d7450
indexer notes and plan for this class.
Exr0n Jan 20, 2020
64d77ea
add summary for intake class.
Exr0n Jan 20, 2020
8ba0ee3
preliminary Indexer class complete.
Exr0n Jan 20, 2020
92f22cb
preliminary Intake.java
Exr0n Jan 20, 2020
d0a3fa7
rename methods; move default numbers to variables
Exr0n Jan 20, 2020
564d95e
Remove funnel and lift motors from the Intake class
Exr0n Jan 20, 2020
dee813c
responding to pr comments
Exr0n Jan 20, 2020
4466882
delete redundant start() method
Exr0n Jan 20, 2020
106a003
Merge pull request #3 from RoboticsTeam4904/intake
NikhilSuresh24 Jan 20, 2020
54c8acb
change static var naming convention to all caps
Exr0n Jan 20, 2020
6b5a38a
delete indexrenotes
Exr0n Jan 20, 2020
b3ff845
responding to pr comments
Exr0n Jan 20, 2020
d7c2cda
Merge pull request #4 from RoboticsTeam4904/indexer
NikhilSuresh24 Jan 20, 2020
8185448
remove limit switch from Indexer; WIP indexONe
Exr0n Jan 21, 2020
3a82edb
wip extendFlippers; deprecate indexer.java
Exr0n Jan 21, 2020
318cd2e
Added onto Albert's original code with some more piston stuff.
Darrow8 Jan 23, 2020
1b61489
Partial Flywheel implementation
BenCantCode Jan 23, 2020
f2f24ba
Albert's shooter code copied and pasted
Darrow8 Jan 24, 2020
fd35775
update `standard` submodule ref; replace flywheel
Exr0n Jan 24, 2020
b098fdf
remove uneeded docstrings; remove indexer deprecation
Exr0n Jan 24, 2020
2e68936
revert intake to original merged code
Exr0n Jan 24, 2020
9727dca
convert indexer.java to new OOP system
Exr0n Jan 24, 2020
f750125
update Intake.java for new OOP model
Exr0n Jan 24, 2020
6ca06fc
submodule change
Daniel-E-B Jan 24, 2020
5fbf836
Update Shooter.java
Pixlskull Jan 24, 2020
36f80d8
Nick and Darrow worked on retract and extend intake commands
Darrow8 Jan 24, 2020
5d4a445
Merge branch 'shooter-commands' of https://github.com/RoboticsTeam490…
Darrow8 Jan 24, 2020
ff2600f
fix drive code
Daniel-E-B Jan 24, 2020
45fcf39
submodule update
Daniel-E-B Jan 24, 2020
65f1d1f
remove unecessary semicolon in Shooter.java
Exr0n Jan 24, 2020
b2c3342
update Flywheel.java for standard integration
Exr0n Jan 25, 2020
8a306f5
add ExtendIntake.java boilerplate
Exr0n Jan 25, 2020
895f2c3
add boilerplate for intake solenoid commands
Exr0n Jan 25, 2020
b7ac2bc
create FlywheelSpinUp; update method names
Exr0n Jan 25, 2020
eafdff7
update Flywheel.java; create FlywheelSpinDown command
Exr0n Jan 25, 2020
04a80f1
Add AimHigh, AimLow, Shooter change to public
Jan 25, 2020
f39b159
Add intake commands
BenCantCode Jan 25, 2020
0d5bedd
Merge branch 'shooter-commands' of https://github.com/RoboticsTeam490…
BenCantCode Jan 25, 2020
b956594
update subsystems
Exr0n Jan 25, 2020
767e994
Merge outtake speed constants; make constants public
Exr0n Jan 25, 2020
034fabb
Aim High and Aim Low and changed shooter visibility
Jan 25, 2020
ee2665d
Juicy
zbuster05 Jan 25, 2020
0a9461b
Merge pull request #5 from RoboticsTeam4904/driving
zbuster05 Jan 25, 2020
5dc651d
Fix requirements for runintake and outtake
BenCantCode Jan 25, 2020
8e223de
Merge branch 'shooter-commands' of https://github.com/RoboticsTeam490…
BenCantCode Jan 25, 2020
63d5b08
Revert "Driving"
zbuster05 Jan 25, 2020
85e69d0
add flipper commands, IndexOne is incomplete
Pixlskull Jan 25, 2020
66c8cc9
notworking
Numdoc Jan 25, 2020
6dadfb2
Merge branch 'shooter-commands' of https://github.com/RoboticsTeam490…
Numdoc Jan 25, 2020
d4458bc
Check flywheel speeds to start indexer
Jan 25, 2020
17df07d
fixed merge conflicts
Jan 25, 2020
e610193
chassis ≠ shifter
Daniel-E-B Jan 26, 2020
6fbbdb4
Merge branch 'driving' of https://github.com/RoboticsTeam4904/2020-Co…
Daniel-E-B Jan 26, 2020
d4a2bf9
renaming and fixing errors
NikhilSuresh24 Jan 28, 2020
d26112e
minor commands overhaul
Exr0n Jan 30, 2020
ec6fa20
remove uneeded addRequirements from IndexOne
Exr0n Jan 30, 2020
b09f3dd
add logic for shoot command, still in progress
isaanca Jan 30, 2020
76515c2
merge something?
isaanca Jan 30, 2020
a591654
Merge pull request #7 from RoboticsTeam4904/revert-5-driving
Daniel-E-B Jan 31, 2020
f0f2fea
dont schedule in robotmap
Daniel-E-B Jan 31, 2020
04d632a
revert to no merges yet
Daniel-E-B Jan 31, 2020
0add219
remove extraneous code
Daniel-E-B Jan 31, 2020
85ea206
dont double schedule
Daniel-E-B Jan 31, 2020
9ca9c14
write Shoot.java
Exr0n Jan 31, 2020
0f9774c
made files and merged in shooter
CaseyManning Jan 31, 2020
a2ef756
Merge remote-tracking branch 'origin/driving' into auton
CaseyManning Jan 31, 2020
f1399b4
final checks before pr
Exr0n Jan 31, 2020
57a0820
write BoxShot.java
Exr0n Jan 31, 2020
b149f32
test code for pickupandshoot
CaseyManning Jan 31, 2020
293135e
latest 2020-update
Daniel-E-B Jan 31, 2020
dd60f57
create nice constructors for Flywheel.java
Exr0n Jan 31, 2020
e5293ea
fixed spline initialization
CaseyManning Jan 31, 2020
36be9a9
write PickupAndShootSide command
isaanca Jan 31, 2020
a3a9b4b
bad code, ignore that red line overthere (robotmap)
Exr0n Jan 31, 2020
71f93ee
respond to pr comments
Exr0n Jan 31, 2020
8d55876
Merge branch 'testing' into shooter-commands
NikhilSuresh24 Jan 31, 2020
5031ff9
added current pose
CaseyManning Jan 31, 2020
2e7b1ef
merge
CaseyManning Jan 31, 2020
b7662ef
merge new shooter code
CaseyManning Jan 31, 2020
3641b6d
fix shooter bug
CaseyManning Jan 31, 2020
0c8b623
changed to sequentialCommandGroup
CaseyManning Jan 31, 2020
c64525f
finished pickup and shoot command
Jan 31, 2020
7a8aa78
fixed some bugs in pickup and shootcenter
Jan 31, 2020
34a6c84
code for shooting first and then picking up
Jan 31, 2020
e7e80fb
poses work:
CaseyManning Jan 31, 2020
ac2b12e
Merge branch 'auton' of https://github.com/RoboticsTeam4904/2020-Code…
CaseyManning Jan 31, 2020
020561a
Rewrite commands to use standard properly
Exr0n Jan 31, 2020
5140151
added comments to Poses.java
Jan 31, 2020
d65e063
update standard
Daniel-E-B Jan 31, 2020
718d895
basic driving
Daniel-E-B Feb 2, 2020
54db0c6
organized poses file
CaseyManning Feb 2, 2020
786b8ba
comments
CaseyManning Feb 2, 2020
562fcfa
position of ball added
KarenKGuo Feb 2, 2020
42d1161
changed a port value from 0 to -1 in robotmap
Krakavius Feb 2, 2020
71d14c9
added positions for side ball collection
CaseyManning Feb 4, 2020
5d00d49
Merge branch 'auton' of https://github.com/RoboticsTeam4904/2020-Code…
CaseyManning Feb 4, 2020
9199fac
fixed positions of ball
KarenKGuo Feb 4, 2020
a4400e9
fixed position of the ball
KarenKGuo Feb 4, 2020
7dd93c7
Move limit switch to indexer
BenCantCode Feb 4, 2020
8c26308
made ports use constant syntax
NikhilSuresh24 Feb 4, 2020
82a00dd
Remove shooter references from IndexOne
BenCantCode Feb 4, 2020
765431d
Almost fix RobotMap
BenCantCode Feb 4, 2020
8334927
Temp fix RobotMap
BenCantCode Feb 4, 2020
93b6615
Remove old imports
BenCantCode Feb 4, 2020
e8ea71e
merge conflicts
NikhilSuresh24 Feb 4, 2020
eef31be
respond to pr comments
Exr0n Feb 6, 2020
7afe928
fix IndexerOne constructor call
Exr0n Feb 6, 2020
d51fca0
started working on hood code
Pixlskull Feb 7, 2020
bcc5734
wrote visionangle align
NikhilSuresh24 Feb 7, 2020
80fb3d9
added vision distance align, the math might need to be changed at som…
NikhilSuresh24 Feb 8, 2020
c18d4df
better variables
NikhilSuresh24 Feb 8, 2020
0f89bc4
more hood improvements
Pixlskull Feb 8, 2020
2aab342
constructed networks tables in robotmap
NikhilSuresh24 Feb 8, 2020
db3ad4a
javadocs
NikhilSuresh24 Feb 8, 2020
95cdc0d
merge conflicts
NikhilSuresh24 Feb 8, 2020
194acc4
updated vision alignment commands with better math
NikhilSuresh24 Feb 9, 2020
224b613
made PR changes
NikhilSuresh24 Feb 9, 2020
9f97d4f
undid robotmap changes
NikhilSuresh24 Feb 9, 2020
e73a009
more PR changes
NikhilSuresh24 Feb 9, 2020
1e2d750
change hood to use motor, add hood to robotmap
Pixlskull Feb 11, 2020
cee2607
add AutonRoutine class to keep track of commands in a command group f…
isaanca Feb 11, 2020
f272320
Update standard to newer 2020
BenCantCode Feb 13, 2020
f451114
Added Hood to Shooter
BenCantCode Feb 13, 2020
bca1faf
small PR fixes
NikhilSuresh24 Feb 14, 2020
8855352
removed excess commands, updated hood for proper zeroing and CANEncod…
Feb 17, 2020
85e7705
added set hood angle command
Feb 17, 2020
636a8e5
fixed constructor error
Feb 17, 2020
7b083bf
addressed most of the PR comments
Feb 17, 2020
d306139
Constructors must be public so that we can instantiate commands
CaseyManning Feb 17, 2020
a231d2d
tried to fix robotmap
CaseyManning Feb 17, 2020
9e3ad13
merge
CaseyManning Feb 17, 2020
bc66eba
updated splines
CaseyManning Feb 17, 2020
65f8a40
remove bad errors
CaseyManning Feb 17, 2020
abab9ab
runintake fix
CaseyManning Feb 17, 2020
94a6806
Delete SendMotors.java
CaseyManning Feb 17, 2020
fde0fc1
adding central vision data hub, which is used for different turning a…
NikhilSuresh24 Feb 18, 2020
8e74e4f
some docstrings
NikhilSuresh24 Feb 18, 2020
c6746fb
made vision align more reusable for next year
NikhilSuresh24 Feb 19, 2020
0a9e16b
use conversion method for inches instead of multiplying
CaseyManning Feb 25, 2020
1fde7ab
removed relatives
CaseyManning Feb 25, 2020
c3f92ac
changed shoot speed
CaseyManning Feb 25, 2020
0483f61
add some networktables functionality for localization
isaanca Feb 25, 2020
e387fc6
Merge branch 'auton' of https://github.com/RoboticsTeam4904/2020-Code…
isaanca Feb 25, 2020
a379fb1
merge vision-align into auton and implement vision in autonomous rout…
isaanca Mar 1, 2020
c271289
Fix chassis encoders and splines drive constants in RobotMap
isaanca Mar 1, 2020
b3e2c25
Replace AndThen with AddCommands and fix field measurements
isaanca Mar 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/main/java/org/usfirst/frc4904/auton/AutonRoutine.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.usfirst.frc4904.auton;

import java.util.ArrayList;

import org.usfirst.frc4904.standard.commands.chassis.SimpleSplines;

import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;

public class AutonRoutine extends SequentialCommandGroup {
public ArrayList<Command> commandsList;

@Override
public SequentialCommandGroup andThen(Command... commands) {
SequentialCommandGroup group = super.andThen(commands);
for (Command command : commands) {
commandsList.add(command);
}
return group;
}

public ArrayList<Command> getCommandsList() {
return commandsList;
}

/**
* Used for the spline visualizer.
CaseyManning marked this conversation as resolved.
Show resolved Hide resolved
*
* @return List of all commands with trajectories
*/
public ArrayList<Command> getSplinesList() {
ArrayList<Command> splinesCommands = new ArrayList<Command>();
for (Command command : commandsList) {
if (command instanceof SimpleSplines) {
splinesCommands.add(command);
}
}
return splinesCommands;
}
}
11 changes: 11 additions & 0 deletions src/main/java/org/usfirst/frc4904/auton/JustMove.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.usfirst.frc4904.auton;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.standard.commands.chassis.ChassisMoveDistance;

class JustMove extends AutonRoutine {

public JustMove() {
this.andThen(new ChassisMoveDistance(RobotMap.Component.chassis, 10, null)); // TODO: what motioncontroller?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be mistaken, but doesn't andThen require you to already have some commands in the group?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you do instead to add the first command?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just use SimpleSplines?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to if the robot is just moving forwards?

}
}
12 changes: 12 additions & 0 deletions src/main/java/org/usfirst/frc4904/auton/JustShoot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.usfirst.frc4904.auton;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.robot.commands.Shoot;

class JustShoot extends AutonRoutine {

public JustShoot() {
andThen(new Shoot(RobotMap.Component.indexer, RobotMap.Component.shooter, 0.5));
}

}
31 changes: 31 additions & 0 deletions src/main/java/org/usfirst/frc4904/auton/PickupAndShootCenter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.usfirst.frc4904.auton;

import java.util.Arrays;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.robot.commands.BoxShot;
import org.usfirst.frc4904.robot.commands.FlywheelSpinDown;
import org.usfirst.frc4904.robot.commands.RunIntake;
import org.usfirst.frc4904.robot.commands.vision.VisionMoveHighPort;
import org.usfirst.frc4904.standard.commands.chassis.SimpleSplines;

import edu.wpi.first.wpilibj.trajectory.Trajectory;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;

class PickupAndShootCenter extends AutonRoutine {

public PickupAndShootCenter() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe clarify that this is PickupAndShootCenter, where we don't reevaluate our position.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean that it doesn't use localization?

Trajectory goingToPowerCells = RobotMap.Component.sensorChassis
.generateQuinticTrajectory(Arrays.asList(Poses.currentPos, Poses.centerCollectStart));
SimpleSplines approachSpline = new SimpleSplines(RobotMap.Component.sensorChassis, goingToPowerCells);
Trajectory collect = RobotMap.Component.sensorChassis.generateQuinticTrajectory(
Arrays.asList(Poses.centerCollectStart, Poses.centerCollectEnd));
SimpleSplines collectSpline = new SimpleSplines(RobotMap.Component.sensorChassis, collect);
addCommands(approachSpline,
new ParallelCommandGroup(new RunIntake(RobotMap.Component.intake), collectSpline),
new VisionMoveHighPort(),
new ParallelCommandGroup(
new BoxShot(RobotMap.Component.indexer, RobotMap.Component.shooter),
new FlywheelSpinDown(RobotMap.Component.flywheel)));
}
}
31 changes: 31 additions & 0 deletions src/main/java/org/usfirst/frc4904/auton/PickupAndShootSide.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.usfirst.frc4904.auton;

import java.util.Arrays;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.robot.commands.BoxShot;
import org.usfirst.frc4904.robot.commands.FlywheelSpinDown;
import org.usfirst.frc4904.robot.commands.RunIntake;
import org.usfirst.frc4904.robot.commands.vision.VisionMoveHighPort;
import org.usfirst.frc4904.standard.commands.chassis.SimpleSplines;

import edu.wpi.first.wpilibj.trajectory.Trajectory;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;

class PickupAndShootSide extends AutonRoutine {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar comments to PickupAndShootCenter...


public PickupAndShootSide() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using andThen, you can use the addCommands method and pass in all your commands in order

Trajectory goingToPowerCells = RobotMap.Component.sensorChassis
.generateQuinticTrajectory(Arrays.asList(Poses.currentPos, Poses.sideCollectStart));
SimpleSplines approachSpline = new SimpleSplines(RobotMap.Component.sensorChassis, goingToPowerCells);
Trajectory collect = RobotMap.Component.sensorChassis
.generateQuinticTrajectory(Arrays.asList(Poses.sideCollectStart, Poses.sideCollectEnd));
SimpleSplines collectSpline = new SimpleSplines(RobotMap.Component.sensorChassis, collect);
addCommands(approachSpline,
new ParallelCommandGroup(new RunIntake(RobotMap.Component.intake), collectSpline),
new VisionMoveHighPort(),
new ParallelCommandGroup(
new BoxShot(RobotMap.Component.indexer, RobotMap.Component.shooter),
new FlywheelSpinDown(RobotMap.Component.flywheel)));
}
}
45 changes: 45 additions & 0 deletions src/main/java/org/usfirst/frc4904/auton/Poses.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package org.usfirst.frc4904.auton;

import edu.wpi.first.wpilibj.geometry.Pose2d;
import edu.wpi.first.wpilibj.geometry.Rotation2d;
import edu.wpi.first.wpilibj.util.Units;

class Poses {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not gonna bother with checking all of these constants right now, but just remember that - is right and clockwise, + is left and ccw.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah most of these are probably wrong, especially the rotations


// All measurements are taken in inches and converted into meters, starting at
// the bottom left corner of the field (I hope)

// Useful constants
static final double TOP_OF_FIELD = Units.inchesToMeters(319);
static final double START_OF_FIELD = Units.inchesToMeters(28);
static final double WIDTH_OF_FIELD = Units.inchesToMeters(649);
static final double FIRST_CENTER_BALL = Units.inchesToMeters(122.63);

// y position of center ball is 94.66 + 43.65 inches
// see layout and marking diagram pages 4 and 5

static final double CENTER_BALL_POS_Y = Units.inchesToMeters(138.41);

static final double OFFSET = Units.inchesToMeters(5);
static final double STARTING_LINE = Units.inchesToMeters(120);

// x position of center ball
// from right side of field:
// 374.59+130.36 - 122.63
static final double centerBallposX = -1;

static final Pose2d centerCollectStart = new Pose2d(Units.inchesToMeters(227),
Units.inchesToMeters((TOP_OF_FIELD - 94.66) - 50), new Rotation2d(0));
static final Pose2d centerCollectEnd = new Pose2d(Units.inchesToMeters(240),
Units.inchesToMeters((TOP_OF_FIELD - 94.66) - 81), new Rotation2d(0));

static final Pose2d sideCollectStart = new Pose2d(Units.inchesToMeters(STARTING_LINE + 122.63 - OFFSET),
Units.inchesToMeters(TOP_OF_FIELD - 94.66 + 66.91), new Rotation2d(0));
static final Pose2d sideCollectEnd = new Pose2d(Units.inchesToMeters(STARTING_LINE + 194.63 + OFFSET),
Units.inchesToMeters(TOP_OF_FIELD - 94.66 + 66.91), new Rotation2d(0));
static Pose2d shootingPose = new Pose2d(Units.inchesToMeters(START_OF_FIELD),
Units.inchesToMeters(TOP_OF_FIELD - 94.66), new Rotation2d(0));

static Pose2d currentPos = new Pose2d(Units.inchesToMeters(120 + START_OF_FIELD),
Units.inchesToMeters(TOP_OF_FIELD / 2), new Rotation2d(0)); // TODO: Get from localization
}
32 changes: 32 additions & 0 deletions src/main/java/org/usfirst/frc4904/auton/ShootAndPickupSide.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.usfirst.frc4904.auton;

import java.util.Arrays;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.robot.commands.BoxShot;
import org.usfirst.frc4904.robot.commands.FlywheelSpinDown;
import org.usfirst.frc4904.robot.commands.RunIntake;
import org.usfirst.frc4904.robot.commands.vision.VisionMoveHighPort;
import org.usfirst.frc4904.standard.commands.chassis.SimpleSplines;

import edu.wpi.first.wpilibj.trajectory.Trajectory;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;

class ShootAndPickupSide extends AutonRoutine {

public ShootAndPickupSide() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing with addCommands

Trajectory goingToPowerCells = RobotMap.Component.sensorChassis
.generateQuinticTrajectory(Arrays.asList(Poses.shootingPose, Poses.sideCollectStart));
SimpleSplines approachSpline = new SimpleSplines(RobotMap.Component.sensorChassis, goingToPowerCells);
Trajectory collect = RobotMap.Component.sensorChassis
.generateQuinticTrajectory(Arrays.asList(Poses.sideCollectStart, Poses.sideCollectEnd));
SimpleSplines collectSpline = new SimpleSplines(RobotMap.Component.sensorChassis, collect);
addCommands(new VisionMoveHighPort(),
new ParallelCommandGroup(
new BoxShot(RobotMap.Component.indexer, RobotMap.Component.shooter),
new FlywheelSpinDown(RobotMap.Component.flywheel)),
approachSpline,
new ParallelCommandGroup(new RunIntake(RobotMap.Component.intake), collectSpline));
}

}
33 changes: 33 additions & 0 deletions src/main/java/org/usfirst/frc4904/auton/ShootandPickupCenter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.usfirst.frc4904.auton;

import java.util.Arrays;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.robot.commands.BoxShot;
import org.usfirst.frc4904.robot.commands.FlywheelSpinDown;
import org.usfirst.frc4904.robot.commands.RunIntake;
import org.usfirst.frc4904.robot.commands.vision.VisionMoveHighPort;
import org.usfirst.frc4904.standard.commands.chassis.SimpleSplines;

import edu.wpi.first.wpilibj.trajectory.Trajectory;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;

class ShootandPickupCenter extends AutonRoutine {

public ShootandPickupCenter() { // TODO: Splining from the shooting pose to the balls will probably just make it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use addCommands

// ram into the wall
Trajectory goingToPowerCells = RobotMap.Component.sensorChassis
.generateQuinticTrajectory(Arrays.asList(Poses.shootingPose, Poses.centerCollectStart));
SimpleSplines approachSpline = new SimpleSplines(RobotMap.Component.sensorChassis, goingToPowerCells);
Trajectory collect = RobotMap.Component.sensorChassis.generateQuinticTrajectory(
Arrays.asList(Poses.centerCollectStart, Poses.centerCollectEnd));
SimpleSplines collectSpline = new SimpleSplines(RobotMap.Component.sensorChassis, collect);

addCommands(new VisionMoveHighPort(),
new ParallelCommandGroup(
new BoxShot(RobotMap.Component.indexer, RobotMap.Component.shooter),
new FlywheelSpinDown(RobotMap.Component.flywheel)),
approachSpline,
new ParallelCommandGroup(new RunIntake(RobotMap.Component.intake), collectSpline));
}
}
Loading