Skip to content
Open
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
46 changes: 46 additions & 0 deletions ChargedUp/.OutlineViewer/outlineviewer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"Clients": {
"open": true
},
"Connections": {
"open": true
},
"NetworkTables Settings": {
"mode": "Client (NT4)",
"serverTeam": "5985"
},
"Server": {
"open": true
},
"retained": {
"LiveWindow": {
"open": true
}
},
"shuffleboard": {
"Publishers": {
"open": true
},
"Subscribers": {
"open": true
},
"open": true
},
"transitory": {
"FMSInfo": {
"open": true
},
"LiveWindow": {
"open": true
},
"Shuffleboard": {
".metadata": {
"open": true
},
".recording": {
"open": true
},
"open": true
}
}
}
10 changes: 10 additions & 0 deletions ChargedUp/.SysId/sysid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"SysId": {
"Analysis Type": "Drivetrain",
"NetworkTables Settings": {
"serverTeam": "5985"
},
"mode": "Client (NT4)",
"serverTeam": "5985"
}
}
8 changes: 0 additions & 8 deletions ChargedUp/src/main/java/com/projectb/Config.java

This file was deleted.

5 changes: 0 additions & 5 deletions ChargedUp/src/main/java/com/projectb/Constants.java

This file was deleted.

5 changes: 0 additions & 5 deletions ChargedUp/src/main/java/com/projectb/Subsystems/Drive.java

This file was deleted.

34 changes: 34 additions & 0 deletions ChargedUp/src/main/java/frc/robot/Commands/CommandController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.Commands;

import edu.wpi.first.wpilibj2.command.button.CommandJoystick;
import frc.robot.Subsystems.Drive;

/** Add your docs here. */
public class CommandController {

private final Drive m_drive = new Drive();
CommandJoystick m_driverJoystick = new CommandJoystick(0); //Setup driver joystick in port 0 on DS

/**
* Use this method to define bindings between conditions and commands. These are useful for
* automating robot behaviors based on button and sensor input.
*
* <p>Should be called during {@link Robot#robotInit()}.
*
* <p>Event binding methods are available on the {@link Trigger} class.
*/
public void configureBindings() {

// Control the drive with split-stick arcade controls
m_drive.setDefaultCommand(
m_drive.arcadeDriveCommand(
() -> m_driverJoystick.getX(), () -> m_driverJoystick.getY()));
}



}
29 changes: 29 additions & 0 deletions ChargedUp/src/main/java/frc/robot/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package frc.robot;

public class Config {

/**
* Drive characterisation values //TODO
*/
public static final double ksVolts = 0.21511; //constant of voltage needed to overcome static friction etc.
public static final double kvVoltSecondsPerMeter = 1.1369; //velocity constant
public static final double kaVoltSecondsSquaredPerMeter = 0.3275;

public static final double kPDriveVel = 0.54175; //preportional

public static final double kTrackwidthMeters = 0.762; //distance in metres between the centre of the each set of wheels on the sides

public static final double kMaxSpeedMetersPerSecond = 2.5915;
public static final double kMaxAccelerationMetersPerSecondSquared = 1;

// Reasonable baseline values for a RAMSETE follower in units of meters and seconds
public static final double kRamseteB = 2; //preportional term
public static final double kRamseteZeta = 0.7; //dampening

public static final double wheelDiameterMetres = (6*2.54)/100; //6 inches to m
public static final double wheelCircumferenceMetres = wheelDiameterMetres * Math.PI;
public static final double kRatioMotorToWheel = (1/11.1/wheelCircumferenceMetres); //gearbox is 11.1:1



}
27 changes: 27 additions & 0 deletions ChargedUp/src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package frc.robot;

public class Constants {

/**
* 2023 robot config
*/
// public static final int kLeftDriveACanId = 1;
// public static final int kLeftDriveBCanId = 3;
// public static final int kLeftDriveCCanId = 5;
// public static final int kRightDriveACanId = 2;
// public static final int kRightDriveBCanId = 4;
// public static final int kRightDriveCCanId = 6;

/**
* Pegasus config
*/

public static final int kLeftDriveACanId = 1;
public static final int kLeftDriveBCanId = 2; //3
public static final int kLeftDriveCCanId = 40; //5
public static final int kRightDriveACanId = 5; //2
public static final int kRightDriveBCanId = 6; //4
public static final int kRightDriveCCanId = 41; //6


}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectb;
package frc.robot;

public class DriverInterface {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package com.projectb;
package frc.robot;

import edu.wpi.first.wpilibj.RobotBase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package com.projectb;
package frc.robot;

import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import frc.robot.Commands.CommandController;
import frc.robot.Subsystems.Drive;
/**
* The VM is configured to automatically run this class, and to call the functions corresponding to
* each mode, as described in the TimedRobot documentation. If you change the name of this class or
Expand All @@ -13,13 +16,18 @@
*/
public class Robot extends TimedRobot {

private final CommandController m_robot = new CommandController();



/**
* This function is run when the robot is first started up and should be used for any
* initialization code.
*/
@Override
public void robotInit() {
m_robot.configureBindings(); //setup bindings for drive, mechanisms etc.
Drive.setBrakes(false); //disable brakes so robot can be pushed

}

Expand All @@ -31,7 +39,9 @@ public void robotInit() {
* SmartDashboard integrated updating.
*/
@Override
public void robotPeriodic() {}
public void robotPeriodic() {
CommandScheduler.getInstance().run();
}

/**
* This autonomous (along with the chooser code above) shows how to select between different
Expand All @@ -45,6 +55,7 @@ public void robotPeriodic() {}
*/
@Override
public void autonomousInit() {
Drive.setBrakes(true); //run brakes

}

Expand All @@ -56,15 +67,21 @@ public void autonomousPeriodic() {

/** This function is called once when teleop is enabled. */
@Override
public void teleopInit() {}
public void teleopInit() {
Drive.setBrakes(true); //run brakes

}

/** This function is called periodically during operator control. */
@Override
public void teleopPeriodic() {}

/** This function is called once when the robot is disabled. */
@Override
public void disabledInit() {}
public void disabledInit() {
Drive.setBrakes(false); //disable brakes so robot is pushable

}

/** This function is called periodically when disabled. */
@Override
Expand Down
Loading