mirror of
https://github.com/Team4388/RiseOfRidgebotics2020.git
synced 2026-06-08 16:28:01 -06:00
Added comp paths
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
X,Y,Tangent X,Tangent Y,Fixed Theta,Name
|
||||
1.2561734200863233,-2.456091477162919,0.5504778715454488,0.4453304129356437,true,
|
||||
2.9447179024673065,-2.1159085228370804,0.9107458620729512,-0.10178337482746132,false,
|
||||
3.996192488565354,-2.4437211879147065,0.41325189721031075,-0.4547588891338594,false,
|
||||
4.268338852026026,-3.396233460027056,-0.31154791056112574,-0.27942584130171033,false,
|
||||
3.6127135218707718,-3.557047220253817,-0.2879329131005023,0.15605044058073636,false,
|
||||
3.3281968691618884,-3.1797533981833404,-0.06233434485711871,0.3054382027854879,false,
|
||||
3.587972943374347,-2.6292755266378918,0.055666301616955405,0.19173948334729118,true,
|
||||
4.255968562777813,-2.4313508986664947,0.8589703669838744,0.23215891428473245,false,
|
||||
6.1919188301230434,-2.0478719319719123,0.7942729164617968,0.5464826399783518,false,
|
||||
6.8970253172711455,-1.330395155575597,-0.18228040758538172,0.33251716672160114,false,
|
||||
6.210474263995361,-0.9840270566256523,-0.42352801124381567,-0.038909318843301545,false,
|
||||
5.622885524705275,-1.3736911679443404,-0.5225119504158948,-0.5710665615882562,false,
|
||||
6.303251433356953,-2.9756436255878373,0.7461533734181975,-0.6566658397700645,false,
|
||||
7.719649552277264,-3.4890106293886487,0.6320693037609113,0.28886118193638116,false,
|
||||
8.294868002319138,-2.9756436255878373,0.03665613098771699,0.37827064262095067,false,
|
||||
7.991795915737936,-2.3880548862977515,-0.4476410086145891,0.4897347710221099,false,
|
||||
6.525916639824776,-2.363314307801327,-1.108161550250234,0.10975004292544946,false,
|
||||
4.676558397217033,-1.9798353411067444,-1.3182005483288322,0.19662716982004538,false,
|
||||
2.56742408039683,-1.8004661470076657,-1.2087931465936643,0.00827931264915486,false,
|
||||
1.0520636474908198,-1.8746878824969397,-0.9648825613605618,-0.0061851446241067976,true,
|
||||
@@ -0,0 +1,15 @@
|
||||
X,Y,Tangent X,Tangent Y,Fixed Theta,Name
|
||||
1.2994694324550664,-3.8910450299555492,3.048,0.0,true,
|
||||
2.8704961669780324,-2.4313508986664947,1.0081785737293036,0.7607727887650584,true,
|
||||
4.336375442891193,-1.7942810023835594,1.5833970237711776,0.10514745860980468,true,
|
||||
6.031105069896283,-2.1777599690781417,0.9629650370580306,-0.6119074379656407,false,
|
||||
7.144431102235392,-3.748786703601108,0.9129332006861199,-0.3193197571926916,false,
|
||||
8.449496617921792,-3.7116758358564708,0.43075407969515506,0.45701597777948244,false,
|
||||
8.653606390517297,-2.647830960510211,-0.23623592828539644,0.5373704622107232,false,
|
||||
7.82479701088707,-2.0664273658442305,-0.5725748756955894,0.05867536270547524,false,
|
||||
6.946506474263994,-2.3942400309218574,-0.5467714376131736,-0.43799557830063024,false,
|
||||
6.420769181214971,-3.6127135218707718,-0.675970094877858,-0.6987407651139694,false,
|
||||
4.565225793983121,-4.027118211685885,-1.1465338797118756,0.025296532830716423,false,
|
||||
2.9818287702119433,-3.6621946788636217,-1.3050655156864006,0.7607727887650593,true,
|
||||
1.58398608516395,-2.3076480061843716,-0.717476776396315,0.26596121883656565,true,
|
||||
0.5572520775623268,-2.140649101333505,-0.7236619210204216,0.04948115699284905,true,
|
||||
@@ -4,6 +4,6 @@
|
||||
"maxVelocity": 1.7,
|
||||
"maxAcceleration": 2.7,
|
||||
"wheelBase": 0.648,
|
||||
"gameName": "Infinite Recharge",
|
||||
"gameName": "Barrel Racing Path",
|
||||
"outputDir": ".."
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -39,9 +39,11 @@ import frc4388.robot.commands.auto.DriveOffLineForward;
|
||||
import frc4388.robot.commands.auto.EightBallAutoMiddle;
|
||||
import frc4388.robot.commands.auto.FiveBallAutoMiddle;
|
||||
import frc4388.robot.commands.auto.SixBallAutoMiddle;
|
||||
import frc4388.robot.commands.auto.Slalom;
|
||||
import frc4388.robot.commands.auto.TenBallAutoMiddle;
|
||||
import frc4388.robot.commands.InterruptSubystem;
|
||||
import frc4388.robot.commands.auto.AutoPath1FromCenter;
|
||||
import frc4388.robot.commands.auto.Barrel;
|
||||
import frc4388.robot.commands.auto.Wait;
|
||||
import frc4388.robot.commands.climber.DisengageRachet;
|
||||
import frc4388.robot.commands.climber.RunClimberWithTriggers;
|
||||
@@ -119,6 +121,10 @@ public class RobotContainer {
|
||||
|
||||
TenBallAutoMiddle m_tenBallAutoMiddle;
|
||||
|
||||
Slalom m_slalom;
|
||||
|
||||
Barrel m_barrel;
|
||||
|
||||
|
||||
/**
|
||||
* The container for the robot. Contains subsystems, OI devices, and commands.
|
||||
@@ -177,7 +183,7 @@ public class RobotContainer {
|
||||
|
||||
// B driver test button
|
||||
new JoystickButton(getDriverJoystick(), XboxController.B_BUTTON)
|
||||
.whenPressed(new TurnDegrees(m_robotDrive, m_robotDrive.m_currentAngleYaw + 5));
|
||||
.whenPressed(new TurnDegrees(m_robotDrive, 45));
|
||||
// Y driver test button
|
||||
new JoystickButton(getDriverJoystick(), XboxController.Y_BUTTON)
|
||||
.whenPressed(new Wait(m_robotDrive, 0, 0));
|
||||
@@ -276,6 +282,18 @@ public class RobotContainer {
|
||||
|
||||
m_sixBallAutoMiddle = new SixBallAutoMiddle(m_robotDrive, buildPaths(sixBallAutoMiddlePaths));
|
||||
|
||||
String[] slalom = new String[]{
|
||||
"Slalom"
|
||||
};
|
||||
|
||||
m_slalom = new Slalom(m_robotDrive, buildPaths(slalom));
|
||||
|
||||
String[] barrel = new String[]{
|
||||
"Barrel"
|
||||
};
|
||||
|
||||
m_barrel = new Barrel(m_robotDrive, buildPaths(barrel));
|
||||
|
||||
String[] eightBallAutoMiddlePaths = new String[]{
|
||||
"EightBallMidComplete"
|
||||
};
|
||||
@@ -324,10 +342,12 @@ public class RobotContainer {
|
||||
|
||||
//return m_sixBallAutoMiddle.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0));
|
||||
//return m_eightBallAutoMiddle.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0));
|
||||
return m_driveOffLineForward.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0));
|
||||
//return m_driveOffLineForward.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0));
|
||||
//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_barrel.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0));
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("ERROR");
|
||||
@@ -454,6 +474,7 @@ public class RobotContainer {
|
||||
return m_driverXbox;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Used for analog inputs like triggers and axises.
|
||||
* @return The IHandController interface for the Operator Controller.
|
||||
|
||||
@@ -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 Barrel extends SequentialCommandGroup {
|
||||
/**
|
||||
* Creates a new Barrel.
|
||||
*/
|
||||
public Barrel(Drive drive, RamseteCommand[] paths) {
|
||||
// Add your commands in the super() call, e.g.
|
||||
// super(new FooCommand(), new BarCommand());
|
||||
addCommands(
|
||||
paths[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 Slalom extends SequentialCommandGroup {
|
||||
/**
|
||||
* Creates a new Slalom.
|
||||
*/
|
||||
public Slalom(Drive drive, RamseteCommand[] paths) {
|
||||
// Add your commands in the super() call, e.g.
|
||||
// super(new FooCommand(), new BarCommand());
|
||||
addCommands(
|
||||
paths[0]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,7 @@ public class TurnDegrees extends CommandBase {
|
||||
public void initialize() {
|
||||
m_targetAngleTicksIn = (m_targetAngle / 360) * DriveConstants.TICKS_PER_GYRO_REV;
|
||||
m_currentYawInTicks = (m_drive.getGyroYaw() / 360) * DriveConstants.TICKS_PER_GYRO_REV;
|
||||
SmartDashboard.putNumber("Current Yaw Ticks", m_currentYawInTicks);
|
||||
m_targetAngleTicksOut = m_targetAngleTicksIn + m_currentYawInTicks;
|
||||
|
||||
i = 0;
|
||||
@@ -48,7 +49,7 @@ public class TurnDegrees extends CommandBase {
|
||||
public void execute() {
|
||||
m_currentYawInTicks = (m_drive.getGyroYaw() / 360) * DriveConstants.TICKS_PER_GYRO_REV;
|
||||
|
||||
m_drive.runTurningPID(m_targetAngleTicksOut);
|
||||
m_drive.runTurningPID(m_targetAngleTicksIn);
|
||||
|
||||
SmartDashboard.putNumber("Turning Error", Math.abs(m_currentYawInTicks - m_targetAngleTicksOut));
|
||||
SmartDashboard.putNumber("Turning Target", m_targetAngleTicksOut);
|
||||
|
||||
Reference in New Issue
Block a user