From 27a25739eaa8b7d0c3bd69dcd4450d1e8f94b1fa Mon Sep 17 00:00:00 2001 From: nbhog <146785661+nbhog@users.noreply.github.com> Date: Wed, 17 Jan 2024 19:01:38 -0500 Subject: [PATCH] started hardware code --- .../robot2023/config/constants/ElevatorConstants.kt | 3 +++ .../robot2023/subsystems/elevator/ElevatorIOKraken.kt | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/team4099/robot2023/config/constants/ElevatorConstants.kt b/src/main/kotlin/com/team4099/robot2023/config/constants/ElevatorConstants.kt index 5857342a..4c27e1d5 100644 --- a/src/main/kotlin/com/team4099/robot2023/config/constants/ElevatorConstants.kt +++ b/src/main/kotlin/com/team4099/robot2023/config/constants/ElevatorConstants.kt @@ -43,4 +43,7 @@ object ElevatorConstants { val HOMING_STALL_TIME_THRESHOLD = 0.0.seconds val HOMING_APPLIED_VOLTAGE = 0.0.volts val ELEVATOR_GROUND_OFFSET = 0.0.inches + + val LEADER_VOLTAGE = 0.0.volts + val LEADER_GEAR_RATIO = 0.0 } \ No newline at end of file diff --git a/src/main/kotlin/com/team4099/robot2023/subsystems/elevator/ElevatorIOKraken.kt b/src/main/kotlin/com/team4099/robot2023/subsystems/elevator/ElevatorIOKraken.kt index 67de1ff8..984c3bda 100644 --- a/src/main/kotlin/com/team4099/robot2023/subsystems/elevator/ElevatorIOKraken.kt +++ b/src/main/kotlin/com/team4099/robot2023/subsystems/elevator/ElevatorIOKraken.kt @@ -1,4 +1,12 @@ package com.team4099.robot2023.subsystems.elevator -object ElevatorIOKraken { +import com.ctre.phoenix6.hardware.TalonFX +import com.team4099.robot2023.config.constants.Constants +import com.team4099.robot2023.config.constants.ElevatorConstants +import org.team4099.lib.units.ctreLinearMechanismSensor + +object ElevatorIOKraken: ElevatorIO { + private val elevatorLeaderKraken = TalonFX(Constants.Elevator.LEADER_MOTOR_ID) + private val elevatorFollowerKraken = TalonFX(Constants.Elevator.FOLLOWER_MOTOR_ID) + private val leaderSensor = ctreLinearMechanismSensor(elevatorLeaderKraken, ElevatorConstants.LEADER_GEAR_RATIO, ElevatorConstants.LEADER_VOLTAGE) } \ No newline at end of file