Skip to content

Commit

Permalink
inital intake testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewChoulas committed Feb 14, 2024
1 parent a754159 commit e88717f
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/main/kotlin/com/team4099/robot2023/BuildConstants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ package com.team4099.robot2023
const val MAVEN_GROUP = ""
const val MAVEN_NAME = "Crescendo-2024"
const val VERSION = "unspecified"
const val GIT_REVISION = 251
const val GIT_SHA = "1a5cd691b3825fd1b825b86600fe50624c599ae9"
const val GIT_DATE = "2024-02-12T13:14:04Z"
const val GIT_REVISION = 252
const val GIT_SHA = "a75415924e15957e6eab7634a96897602bd09639"
const val GIT_DATE = "2024-02-12T21:30:20Z"
const val GIT_BRANCH = "main"
const val BUILD_DATE = "2024-02-12T21:26:42Z"
const val BUILD_UNIX_TIME = 1707791202834L
const val BUILD_DATE = "2024-02-13T20:34:06Z"
const val BUILD_UNIX_TIME = 1707874446982L
const val DIRTY = 1
2 changes: 1 addition & 1 deletion src/main/kotlin/com/team4099/robot2023/RobotContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ object RobotContainer {
// CameraIONorthstar("backward")
)
limelight = LimelightVision(object : LimelightVisionIO {})
intake = Intake(object: IntakeIO {})
intake = Intake(IntakeIONEO)
feeder = Feeder(FeederIONeo)
elevator = Elevator(ElevatorIONEO)
flywheel = Flywheel(FlywheelIOTalon)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ object Constants {
}

object Intake {
const val ROLLER_MOTOR_ID = 32
const val ARM_MOTOR_ID = 31
const val ROLLER_MOTOR_ID = 31
const val CENTER_MOTOR_ID = 32
const val REV_ENCODER_PORT = 7
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object IntakeConstants {
val IDLE_ROLLER_VOLTAGE = 1.0.volts

val IDLE_CENTER_WHEEL_VOLTAGE = 0.0.volts
val INTAKE_ROLLER_VOLTAGE = 10.volts
val INTAKE_ROLLER_VOLTAGE = -9.volts
val INTAKE_CENTER_WHEEL_VOLTAGE = 10.volts
val OUTTAKE_ROLLER_VOLTAGE = (-10).volts
val OUTTAKE_CENTER_WHEEL_VOLTAGE = (-10).volts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Feeder(val io: FeederIO) : SubsystemBase() {
var lastBeamState = false
val hasNote: Boolean
get() {
return true
return false
/*
return (inputs.beamBroken &&
Clock.fpgaTime - firstTripBeamBreakTime > FeederConstants.BEAM_BREAK_WAIT_TIME) || inputs.isSimulated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ object IntakeIONEO : IntakeIO {
rollerSparkMax, IntakeConstants.ROLLER_GEAR_RATIO, IntakeConstants.VOLTAGE_COMPENSATION
)

private val centerWheelSparkMax =
/*private val centerWheelSparkMax =
CANSparkMax(Constants.Intake.ROLLER_MOTOR_ID, CANSparkMaxLowLevel.MotorType.kBrushless)
*/


private val centerWheelSensor =
sparkMaxAngularMechanismSensor(
Expand Down Expand Up @@ -57,6 +59,7 @@ object IntakeIONEO : IntakeIO {
90.celsius
),
)
/*
centerWheelSparkMax.restoreFactoryDefaults()
centerWheelSparkMax.clearFaults()
Expand All @@ -68,6 +71,7 @@ object IntakeIONEO : IntakeIO {
centerWheelSparkMax.idleMode = CANSparkMax.IdleMode.kCoast
centerWheelSparkMax.burnFlash()
*/

MotorChecker.add(
"Intake",
Expand Down Expand Up @@ -96,13 +100,17 @@ object IntakeIONEO : IntakeIO {
inputs.rollerTemp = rollerSparkMax.motorTemperature.celsius

inputs.centerWheelVelocity = centerWheelSensor.velocity

/*
inputs.centerWheelAppliedVotlage =
centerWheelSparkMax.busVoltage.volts * centerWheelSparkMax.appliedOutput
inputs.centerWheelStatorCurrent = centerWheelSparkMax.outputCurrent.amps
inputs.centerWheelSupplyCurrent =
inputs.centerWheelStatorCurrent * centerWheelSparkMax.appliedOutput.absoluteValue
inputs.centerWheelTemp = centerWheelSparkMax.motorTemperature.celsius
*/
}

/**
Expand All @@ -122,7 +130,7 @@ object IntakeIONEO : IntakeIO {
)
.inVolts
)

/*
centerWheelSparkMax.setVoltage(
clamp(
centerWheelVoltage,
Expand All @@ -131,6 +139,8 @@ object IntakeIONEO : IntakeIO {
)
.inVolts
)
*/
}

/**
Expand All @@ -145,10 +155,13 @@ object IntakeIONEO : IntakeIO {
rollerSparkMax.idleMode = CANSparkMax.IdleMode.kCoast
}

/*
if (centerWheelBrake) {
centerWheelSparkMax.idleMode = CANSparkMax.IdleMode.kBrake
} else {
centerWheelSparkMax.idleMode = CANSparkMax.IdleMode.kCoast
}
*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.team4099.lib.units.base.inSeconds
import org.team4099.lib.units.base.inches
import org.team4099.lib.units.base.meters
import org.team4099.lib.units.derived.degrees
import org.team4099.lib.units.derived.volts

class Superstructure(
private val intake: Intake,
Expand Down Expand Up @@ -237,6 +238,7 @@ class Superstructure(
)
feeder.currentRequest =
Request.FeederRequest.OpenLoopIntake(Feeder.TunableFeederStates.intakeVoltage.get())
flywheel.currentRequest = Request.FlywheelRequest.OpenLoop(2.volts)
if (feeder.hasNote) {
currentRequest = Request.SuperstructureRequest.Idle()
nextState = SuperstructureStates.IDLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,17 @@ class Wrist(val io: WristIO) : SubsystemBase() {
}

val isAtTargetedPosition: Boolean
get() =
get() = true
/*
(
currentState == WristStates.TARGETING_POSITION &&
wristProfile.isFinished(Clock.fpgaTime - timeProfileGeneratedAt) &&
(inputs.wristPosition - wristPositionTarget).absoluteValue <=
WristConstants.WRIST_TOLERANCE
)
*/

fun setWristVoltage(appliedVoltage: ElectricalPotential) {
io.setWristVoltage(appliedVoltage)
}
Expand Down

0 comments on commit e88717f

Please sign in to comment.