Added BarrelStart boilerplate (NOT WORKING)

Co-Authored-By: Nirvan Bhalala <78400306+nbhalala27@users.noreply.github.com>
This commit is contained in:
Aarav Shah
2021-03-01 17:51:57 -07:00
parent a2c590e7fe
commit cbe1d095bc
21 changed files with 71 additions and 20 deletions
+14
View File
@@ -0,0 +1,14 @@
X,Y,Tangent X,Tangent Y,Fixed Theta,Name
1.1943219738452617,-2.286,1.0,0.0,true,
3.396233460027056,-2.2025005475745667,1.6761741931327716,0.12370289248212352,true,
4.466263479997423,-3.0436802164530046,0.15462861560265395,-1.1071408877150035,true,
3.618898666494878,-3.6374541003671967,-1.2555843586935511,0.21029491721960936,true,
3.4951957740127546,-2.530313212652193,1.2184734909489143,0.8226242350061197,true,
6.105326805385555,-2.208685692198673,1.5215455775301168,0.4824412806802809,true,
6.847544160278296,-1.5035792050505696,0.08040688011338037,0.6679956194034656,true,
6.1362525285060885,-0.8788795980158475,-1.261769503317658,0.012370289248212263,true,
5.4868123429749405,-1.7757255685112412,0.42058983443921694,-0.9030311151194992,true,
6.760952135540809,-3.3405671584101007,1.7689513624943638,-0.7174767763963148,true,
8.096943374347742,-3.3900483154029506,0.6061441731624058,0.4824412806802809,true,
8.053647361978998,-2.4375360432906006,-0.7360322102686343,0.5690333054177668,true,
5.598144946208851,-2.190130258326354,-5.115114604135798,0.06803659086516767,true,
-3
View File
@@ -1,3 +0,0 @@
X,Y,Tangent X,Tangent Y,Fixed Theta,Name
1.3489505894479157,-2.3385737293049025,3.048,0.0,true,
3.934341042324292,-2.456091477162919,1.0100439348064159,0.07854151903626949,false,
+2 -2
View File
@@ -1,8 +1,8 @@
{ {
"lengthUnit": "Meter", "lengthUnit": "Meter",
"exportUnit": "Always Meters", "exportUnit": "Always Meters",
"maxVelocity": 2.3, "maxVelocity": 2.4,
"maxAcceleration": 2.7, "maxAcceleration": 2.6,
"wheelBase": 0.648, "wheelBase": 0.648,
"gameName": "Barrel Racing Path", "gameName": "Barrel Racing Path",
"outputDir": ".." "outputDir": ".."
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
[{"time":0.0,"velocity":0.0,"acceleration":2.7,"pose":{"translation":{"x":3.2,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.3042903097250923,"velocity":0.8215838362577492,"acceleration":2.7,"pose":{"translation":{"x":3.325,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.43033148291193524,"velocity":1.161895003862225,"acceleration":-2.7,"pose":{"translation":{"x":3.45,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.5563726560987782,"velocity":0.8215838362577492,"acceleration":-2.7,"pose":{"translation":{"x":3.575,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.8606629658238705,"velocity":0.0,"acceleration":-2.7,"pose":{"translation":{"x":3.7,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0}] [{"time":0.0,"velocity":0.0,"acceleration":2.6000000000000005,"pose":{"translation":{"x":3.2,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.3100868364730211,"velocity":0.806225774829855,"acceleration":2.6000000000000005,"pose":{"translation":{"x":3.325,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.43852900965351455,"velocity":1.140175425099138,"acceleration":-2.6000000000000005,"pose":{"translation":{"x":3.45,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.566971182834008,"velocity":0.806225774829855,"acceleration":-2.6000000000000005,"pose":{"translation":{"x":3.575,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.8770580193070292,"velocity":0.0,"acceleration":-2.6000000000000005,"pose":{"translation":{"x":3.7,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0}]
@@ -1 +1 @@
[{"time":0.0,"velocity":0.0,"acceleration":2.7,"pose":{"translation":{"x":3.2,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.3042903097250923,"velocity":0.8215838362577492,"acceleration":2.7,"pose":{"translation":{"x":3.325,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.43033148291193524,"velocity":1.161895003862225,"acceleration":-2.7,"pose":{"translation":{"x":3.45,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.5563726560987782,"velocity":0.8215838362577492,"acceleration":-2.7,"pose":{"translation":{"x":3.575,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.8606629658238705,"velocity":0.0,"acceleration":-2.7,"pose":{"translation":{"x":3.7,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0}] [{"time":0.0,"velocity":0.0,"acceleration":2.6000000000000005,"pose":{"translation":{"x":3.2,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.3100868364730211,"velocity":0.806225774829855,"acceleration":2.6000000000000005,"pose":{"translation":{"x":3.325,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.43852900965351455,"velocity":1.140175425099138,"acceleration":-2.6000000000000005,"pose":{"translation":{"x":3.45,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.566971182834008,"velocity":0.806225774829855,"acceleration":-2.6000000000000005,"pose":{"translation":{"x":3.575,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0},{"time":0.8770580193070292,"velocity":0.0,"acceleration":-2.6000000000000005,"pose":{"translation":{"x":3.7,"y":-2.3},"rotation":{"radians":0.0}},"curvature":0.0}]
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -46,6 +46,7 @@ import frc4388.robot.commands.InterruptSubystem;
import frc4388.robot.commands.auto.AutoPath1FromCenter; import frc4388.robot.commands.auto.AutoPath1FromCenter;
import frc4388.robot.commands.auto.Barrel; import frc4388.robot.commands.auto.Barrel;
import frc4388.robot.commands.auto.BarrelMany; import frc4388.robot.commands.auto.BarrelMany;
import frc4388.robot.commands.auto.BarrelStart;
import frc4388.robot.commands.auto.Wait; import frc4388.robot.commands.auto.Wait;
import frc4388.robot.commands.climber.DisengageRachet; import frc4388.robot.commands.climber.DisengageRachet;
import frc4388.robot.commands.climber.RunClimberWithTriggers; import frc4388.robot.commands.climber.RunClimberWithTriggers;
@@ -131,6 +132,8 @@ public class RobotContainer {
Barrel m_barrel; Barrel m_barrel;
BarrelStart m_barrelStart;
BarrelMany m_barrelMany; BarrelMany m_barrelMany;
SequentialTesting m_sequentialTesting; SequentialTesting m_sequentialTesting;
@@ -318,6 +321,12 @@ public class RobotContainer {
m_barrel = new Barrel(m_robotDrive, buildPaths(barrel)); m_barrel = new Barrel(m_robotDrive, buildPaths(barrel));
String[] barrelStart = new String[]{
"BarrelStart"
};
m_barrelStart = new BarrelStart(m_robotDrive, buildPaths(barrelStart));
String[] barrelMany = new String[]{ String[] barrelMany = new String[]{
"BarrelManyWaypoints" "BarrelManyWaypoints"
}; };
@@ -384,7 +393,8 @@ public class RobotContainer {
//return m_fiveBallAutoMiddle.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); //return m_fiveBallAutoMiddle.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0));
//return m_tenBallAutoMiddle.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0)); //return m_tenBallAutoMiddle.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0));
//return m_slalom.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0)); //return m_slalom.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0));
return m_barrel.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0)); //return m_barrel.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0));
return m_barrelStart.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0));
//return m_barrelMany.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0)); //return m_barrelMany.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0));
//return m_sequentialTesting.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0)); //return m_sequentialTesting.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0));
@@ -0,0 +1,28 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc4388.robot.commands.auto;
import edu.wpi.first.wpilibj2.command.RamseteCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc4388.robot.subsystems.Drive;
// NOTE: Consider using this command inline, rather than writing a subclass. For more
// information, see:
// https://docs.wpilib.org/en/latest/docs/software/commandbased/convenience-features.html
public class BarrelStart extends SequentialCommandGroup {
/**
* Creates a new BarrelStart.
*/
public BarrelStart(Drive drive, RamseteCommand[] paths) {
// Add your commands in the super() call, e.g.
// super(new FooCommand(), new BarCommand());
addCommands(
paths[0]
);
}
}