Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Merge branch 'mayhem-geared-up' of https://github.com/Team766/2024 in…
Browse files Browse the repository at this point in the history
…to mayhem-geared-up
  • Loading branch information
raghavsial committed Nov 23, 2024
2 parents 20d15d8 + 5621fef commit 9457962
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 1,382 deletions.
2 changes: 1 addition & 1 deletion .wpilib/wpilib_preferences.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"enableCppIntellisense": false,
"currentLanguage": "java",
"projectYear": "2024",
"teamNumber": 766
"teamNumber": 7664
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public class BurroDrive extends Drive {
public BurroDrive() {
loggerCategory = Category.DRIVE;

leftMotor = RobotProvider.instance.getMotor(DRIVE_LEFT);
rightMotor = RobotProvider.instance.getMotor(DRIVE_RIGHT);
leftMotor = RobotProvider.instance.getMotor("drive.leftMotor");
rightMotor = RobotProvider.instance.getMotor("drive.rightMotor");

leftEncoder = null; //FIXME
rightEncoder = null; //FIXME
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/team766/robot/rookie_bot/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void run(final Context context) {
context.waitFor(() -> RobotProvider.instance.hasNewDriverStationData());
RobotProvider.instance.refreshDriverStationData();

Robot.drive.setArcadeDrivePower(joystick0.getAxis(1), joystick0.getAxis(4));
Robot.drive.drive(joystick0.getAxis(1), joystick0.getAxis(4);

if ( joystick0.getButtonPressed(5) ){
context.startAsync(new PIDElevator(false));
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/team766/robot/rookie_bot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
import com.team766.framework.AutonomousMode;
import com.team766.framework.Procedure;
import com.team766.hal.RobotConfigurator;
import com.team766.robot.common.mechanisms.BurroDrive;
import com.team766.robot.rookie_bot.mechanisms.*;

public class Robot implements RobotConfigurator {
// Declare mechanisms (as static fields) here
public static Drive drive;
public static BurroDrive drive;
public static Elevator elevator;
public static Intake Intake;
//public static Launcher launcher;

@Override
public void initializeMechanisms() {
// Initialize mechanisms here
drive = new Drive();
drive = new BurroDrive();
elevator= new Elevator();
Intake = new Intake();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ public void drive(double leftPower, double rightPower) {
}

public void setArcadeDrivePower(double forward, double turn) {
double leftMotorPower= 0.75*(turn - forward);
double rightMotorPower= 0.75*(-turn - forward);
double leftMotorPower= 0.8*(turn - forward);
double rightMotorPower= 0.8*(-turn - forward);
drive(leftMotorPower, rightMotorPower);



}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
import com.team766.hal.RobotProvider;
import com.team766.hal.wpilib.CANSparkMaxMotorController;
import com.team766.hal.MotorController;
import com.team766.hal.EncoderReader;

public class Elevator extends Mechanism{
private MotorController m_elevator;
private EncoderReader m_elevatorEncoder;

public Elevator() {
m_elevator = RobotProvider.instance.getMotor("elevator");

((CANSparkMaxMotorController) m_elevator).setSmartCurrentLimit(10, 80, 200);

m_elevatorEncoder = RobotProvider.instance.getEncoder("elevator_encoder");
resetEncoder();
}

Expand All @@ -29,7 +25,7 @@ public double getElevatorDistance(){
}

public void resetEncoder(){
m_elevatorEncoder.reset();
m_elevator.setSensorPosition(0);
}

}
Expand Down
Loading

0 comments on commit 9457962

Please sign in to comment.