Added bounce path

Co-Authored-By: Nirvan Bhalala <78400306+nbhalala27@users.noreply.github.com>
This commit is contained in:
Aarav Shah
2021-02-25 17:15:10 -07:00
parent e660b59d1f
commit 709630533a
5 changed files with 52 additions and 2 deletions
+11
View File
@@ -0,0 +1,11 @@
X,Y,Tangent X,Tangent Y,Fixed Theta,Name
1.2685437093345355,-2.2829074276879466,3.048,0.0,true,
2.258166849191522,-0.6129183791792823,0.11133260323391081,-0.38347896669458226,true,
2.9818287702119433,-3.1735682535592344,0.5566630161695545,-1.4473238420408423,true,
4.385856599884042,-3.3405671584101007,0.6556253301552539,1.3731021065515683,true,
4.596151517103652,-0.8726944533917412,0.20415183442002244,0.00717066557576255,false,
4.998185917670552,-3.3158265799136757,0.8164390903820147,-1.4163981189203128,true,
6.408398891966757,-3.4766403401404364,0.9958082844810932,0.8288093796302256,true,
6.87228473877472,-0.829398441022998,0.12370289248212352,-0.40821954519100667,true,
7.311430007086258,-1.8561324486246213,0.4858385107411982,-0.5239684308130039,false,
8.3567194485602,-2.375684597049539,0.6246996070347217,-0.25359092958835294,true,
+1 -1
View File
@@ -4,6 +4,6 @@
"maxVelocity": 2.3,
"maxAcceleration": 2.7,
"wheelBase": 0.648,
"gameName": "Slalom Path",
"gameName": "Bounce Path",
"outputDir": ".."
}
File diff suppressed because one or more lines are too long
@@ -45,6 +45,7 @@ import frc4388.robot.commands.InterruptSubystem;
import frc4388.robot.commands.auto.AutoPath1FromCenter;
import frc4388.robot.commands.auto.Barrel;
import frc4388.robot.commands.auto.BarrelMany;
import frc4388.robot.commands.auto.Bounce;
import frc4388.robot.commands.auto.Wait;
import frc4388.robot.commands.climber.DisengageRachet;
import frc4388.robot.commands.climber.RunClimberWithTriggers;
@@ -132,6 +133,8 @@ public class RobotContainer {
BarrelMany m_barrelMany;
Bounce m_bounce;
/**
* The container for the robot. Contains subsystems, OI devices, and commands.
*/
@@ -311,6 +314,12 @@ public class RobotContainer {
};
m_barrel = new Barrel(m_robotDrive, buildPaths(barrel));
String[] bounce = new String[]{
"Bounce"
};
m_bounce = new Bounce(m_robotDrive, buildPaths(bounce));
String[] barrelMany = new String[]{
"BarrelManyWaypoints"
@@ -371,9 +380,11 @@ public class RobotContainer {
//return m_driveOffLineBackward.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_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_barrelMany.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0));
return m_bounce.andThen(()-> m_robotDrive.tankDriveVelocity(0,0));
} catch (Exception e) {
System.err.println("ERROR");
}
@@ -0,0 +1,27 @@
/*----------------------------------------------------------------------------*/
/* 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 Bounce extends SequentialCommandGroup {
/**
* Creates a new Bounce.
*/
public Bounce(Drive drive, RamseteCommand[] paths) {
// Add your commands in the super() call, e.g.
// super(new FooCommand(), new BarCommand());
addCommands(paths[0]
);
}
}