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

Internals (again) #25

Merged
merged 6 commits into from
Feb 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public static final class InternalConstants {

public static final int entranceIRPort = 0;
public static final int stagingIRPort = 1;
public static final int exitIRPort = 3;
}

public static final class IntakeConstants {
Expand All @@ -66,7 +65,7 @@ public static final class ClimbConstants {
public static final class JetsonConstants {
public static final int turretCameraPort = 1181;
public static final int intakeCameraPort = 1182;
public static final int jetsonPort = 1337;
public static final int jetsonPort = 5800;
public static final String jetsonIP = "10.1.92.94";
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ public void disabledPeriodic() {}
/** This autonomous runs the autonomous command selected by your {@link RobotContainer} class. */
@Override
public void autonomousInit() {
// Schedule the autonomous command
autonomousCommand = robotContainer.getAutonomousCommand();
if (autonomousCommand != null) autonomousCommand.schedule();

// schedule the autonomous command (example)
if (autonomousCommand != null) {
autonomousCommand.schedule();
}
// Set InternalSubsystem initial ball count
robotContainer.getInternalSubsystem().setAutonInitialBallCount();
}

/** This function is called periodically during autonomous. */
Expand Down
24 changes: 16 additions & 8 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.StartEndCommand;
import edu.wpi.first.wpilibj2.command.button.JoystickButton;

import frc.robot.brownout.PowerController;
import frc.robot.commands.internals.RequestShotCommand;
import frc.robot.commands.tank.FollowPathCommand;
Expand All @@ -41,7 +42,7 @@ public class RobotContainer {
private final InternalSubsystem internalSubsystem;
// private final ClimbSubsystem climbSubsystem;

private final JetsonConnection jetson = null;
private final JetsonConnection jetson;
private final PowerController powerController = null;

// Controllers and buttons
Expand All @@ -66,11 +67,9 @@ public class RobotContainer {
* The container for the robot. Contains subsystems, OI devices, and commands.
*/
public RobotContainer() {

// Instantiate the Jetson connection
// jetson = new JetsonConnection();
// jetson.run();

jetson = new JetsonConnection();

// Instantiate subsystems
tankSubsystem = new TankSubsystem();
turretSubsystem = new TurretSubsystem(tankSubsystem, jetson);
Expand All @@ -91,6 +90,7 @@ public RobotContainer() {

// Instantiate commands
// Drive an S-shaped curve from the origin to 3 meters in front through 2 waypoints
/*
if (tankSubsystem != null) {
autonCommand = new FollowPathCommand(
tankSubsystem,
Expand All @@ -104,6 +104,8 @@ public RobotContainer() {
} else {
autonCommand = new InstantCommand();
}
*/
autonCommand = new InstantCommand();

// Configure the button bindings
configureButtonBindings();
Expand Down Expand Up @@ -198,19 +200,25 @@ private void controllerBindings() {

/**
* Use this to pass the autonomous command to the main {@link Robot} class.
*
* @return the command to run in autonomous
*/
public Command getAutonomousCommand() {
return autonCommand;
}

/**
* Gets the PowerController instance.
*
* Gets the PowerController instance for scaling in `Robot.periodic()`.
* @return The PowerController instance.
*/
public PowerController getPowerController() {
return powerController;
}

/**
* Gets the InternalSubsystem for setting initial ball count in `Robot.autonomousInit()`.
* @return The InternalSubsystem instance.
*/
public InternalSubsystem getInternalSubsystem() {
return internalSubsystem;
}
}
Loading