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

Changes to Intake also Juicy 3 #4

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
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
20 changes: 20 additions & 0 deletions src/main/java/org/usfirst/frc4904/robot/RobotMap.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
package org.usfirst.frc4904.robot;

import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj2.command.Subsystem;

import org.usfirst.frc4904.standard.custom.PCMPort;
import org.usfirst.frc4904.standard.custom.controllers.CustomJoystick;
import org.usfirst.frc4904.standard.custom.controllers.CustomXbox;
import org.usfirst.frc4904.standard.custom.motioncontrollers.CANTalonFX;
import org.usfirst.frc4904.standard.custom.motioncontrollers.CANTalonSRX;
import org.usfirst.frc4904.standard.subsystems.SolenoidSubsystem.SolenoidState;
import org.usfirst.frc4904.standard.subsystems.SolenoidSubsystem;
import org.usfirst.frc4904.standard.subsystems.motor.Motor;


public class RobotMap {
public static class Port {
Expand All @@ -12,6 +21,9 @@ public static class HumanInput {
}

public static class CANMotor {
public static final int AXLE_INTAKE_MOTOR = -1; //TODO: set port for axel intake motor
public static final int SECONDARY_INTAKE_MOTOR = -1; //TODO: set port for axel intake motor

}

public static class PWM {
Expand All @@ -21,6 +33,7 @@ public static class CAN {
}

public static class Pneumatics {
public static final PCMPort DRAWBRIDGE_INTAKE_SOLENOID = new PCMPort(-1, PneumaticsModuleType.CTREPCM, -1, -1); //TODO: set port for drawbridge intake solenoid
}

public static class Digital {
Expand Down Expand Up @@ -51,6 +64,9 @@ public static class Turn {
}

public static class Component {
public static Motor intakeAxleMotor;
public static Motor intakeSecondaryMotor;
public static SolenoidSubsystem intakeDrawbridgeSolenoid;
}

public static class Input {
Expand All @@ -70,5 +86,9 @@ public RobotMap() {
HumanInput.Driver.xbox = new CustomXbox(Port.HumanInput.xboxController);
HumanInput.Operator.joystick = new CustomJoystick(Port.HumanInput.joystick);

Component.intakeDrawbridgeSolenoid = new SolenoidSubsystem("Intake Drawbridge Solenoid", false, SolenoidState.RETRACT, Port.Pneumatics.DRAWBRIDGE_INTAKE_SOLENOID.buildDoubleSolenoid());
Component.intakeAxleMotor = new Motor("Intake Motor", false, new CANTalonFX(Port.CANMotor.AXLE_INTAKE_MOTOR)); //TODO: check if CANTalonFX or SRX
b-cho marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this is a CANTalonFX—confirmed with the intake people on design.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great

Component.intakeSecondaryMotor = new Motor("Intake Secondary Motor", false, new CANTalonFX(Port.CANMotor.SECONDARY_INTAKE_MOTOR)); //TODO: check if CANTalonFX or SRX

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.usfirst.frc4904.robot.commands.intake;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.standard.commands.motor.MotorIdle;

/**
* Stops rotating axle
*/
public class AxleIntakeOff extends MotorIdle {
public AxleIntakeOff() {
super("axleIntakeOff", RobotMap.Component.intakeAxleMotor);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.usfirst.frc4904.robot.commands.intake;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.standard.commands.motor.MotorConstant;

/**
* Rotates the axle to intake the ball
*/
public class AxleIntakeOn extends MotorConstant {
public final static double DEFAULT_INTAKE_MOTOR_SPEED = 0.5; //TODO: needs value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to add value

public AxleIntakeOn() {
super("axleIntakeOn", RobotMap.Component.intakeAxleMotor, DEFAULT_INTAKE_MOTOR_SPEED);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.usfirst.frc4904.robot.commands.intake;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.standard.commands.solenoid.SolenoidExtend;

/**
* Extends the drawbridge which has the intake mechanism attached to it.
*/
public class ExtendIntake extends SolenoidExtend {
public ExtendIntake() {
super("extendIntakeDrawbridge", RobotMap.Component.intakeDrawbridgeSolenoid);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.usfirst.frc4904.robot.commands.intake;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.standard.commands.solenoid.SolenoidRetract;

/**
* Retracts the drawbridge which has the intake mechanism attached to it.
*/
public class RetractIntake extends SolenoidRetract {
public RetractIntake() {
super("retractIntakeDrawbridge", RobotMap.Component.intakeDrawbridgeSolenoid);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.usfirst.frc4904.robot.commands.intake;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.standard.commands.motor.MotorIdle;

/**
* Stops rotating motor
*/
public class SecondaryIntakeOff extends MotorIdle {
public SecondaryIntakeOff() {
super("secondaryIntakeOff", RobotMap.Component.intakeSecondaryMotor);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.usfirst.frc4904.robot.commands.intake;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.standard.commands.motor.MotorConstant;

/**
* Rotates the motor to intake the ball
*/
public class SecondaryIntakeOn extends MotorConstant {
public final static double DEFAULT_INTAKE_MOTOR_SPEED = 0.5; //TODO: needs value
public SecondaryIntakeOn() {
super("SecondaryIntakeOn", RobotMap.Component.intakeSecondaryMotor, DEFAULT_INTAKE_MOTOR_SPEED);
}
}