Skip to content

Commit

Permalink
Climber
Browse files Browse the repository at this point in the history
  • Loading branch information
KPatel008 committed Feb 8, 2025
1 parent 8f37a04 commit 9ea48d1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/main/deploy/pathplanner/paths/TAXI.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"waypoints": [
{
"anchor": {
"x": 7.418338815789473,
"y": 4.077589897260274
"x": 7.476069078947368,
"y": 3.9095394736842106
},
"prevControl": null,
"nextControl": {
"x": 6.180382856313421,
"y": 4.077589897260274
"x": 6.238113119471316,
"y": 3.9095394736842106
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 5.753782894736841,
"y": 4.077589897260274
"x": 5.724917763157895,
"y": 3.9095394736842106
},
"prevControl": {
"x": 7.122440525396381,
"y": 4.077589897260274
"x": 7.093575393817434,
"y": 3.9095394736842106
},
"nextControl": null,
"isLocked": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package frc.robot.subsystems.Climber;

import com.ctre.phoenix6.configs.MotorOutputConfigs;
import com.ctre.phoenix6.configs.TalonFXConfiguration;
import com.ctre.phoenix6.controls.DutyCycleOut;
import com.ctre.phoenix6.hardware.TalonFX;
import com.ctre.phoenix6.signals.InvertedValue;
import com.ctre.phoenix6.signals.NeutralModeValue;

public class ClimberIOTalonFX implements ClimberIO {
Expand All @@ -12,10 +14,14 @@ public ClimberIOTalonFX() {
m_Climbermotor = new TalonFX(20, "CANivore2");

final TalonFXConfiguration climberMotorConfig = new TalonFXConfiguration();
final MotorOutputConfigs outputConfigs = new MotorOutputConfigs();

outputConfigs.NeutralMode = NeutralModeValue.Brake;
climberMotorConfig.CurrentLimits.SupplyCurrentLimit = 40.0;
climberMotorConfig.CurrentLimits.SupplyCurrentLimitEnable = true;

m_Climbermotor.getConfigurator().apply(climberMotorConfig);
m_Climbermotor.getConfigurator().apply(outputConfigs);dfcv
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ public ElevatorIOTalonFX() {
m_request = new PositionVoltage(0).withSlot(0);

final TalonFXConfiguration elevatorMotorConfig = new TalonFXConfiguration();
final MotorOutputConfigs outputConfigs = new MotorOutputConfigs();
outputConfigs.Inverted = InvertedValue.Clockwise_Positive;
outputConfigs.NeutralMode = NeutralModeValue.Brake;
final MotorOutputConfigs rightOutputConfigs = new MotorOutputConfigs();
final MotorOutputConfigs leftOutputConfigs = new MotorOutputConfigs();
rightOutputConfigs.Inverted = InvertedValue.Clockwise_Positive;
rightOutputConfigs.NeutralMode = NeutralModeValue.Brake;
leftOutputConfigs.NeutralMode = NeutralModeValue.Brake;
elevatorMotorConfig.CurrentLimits.SupplyCurrentLimit = 40.0;
elevatorMotorConfig.CurrentLimits.SupplyCurrentLimitEnable = true;
// in init function, set slot 0 gains
Expand All @@ -55,7 +57,8 @@ public ElevatorIOTalonFX() {
m_right.setPosition(29 * (0.5 * (1d / (1.75100 * Math.PI)) * ( 2d / 3d ) * 25));
m_left.getConfigurator().apply(elevatorMotorConfig);
m_right.getConfigurator().apply(elevatorMotorConfig);
m_right.getConfigurator().apply(outputConfigs);
m_right.getConfigurator().apply(rightOutputConfigs);
m_left.getConfigurator().apply(leftOutputConfigs);
m_left.getConfigurator().apply(slot0Configs);
m_right.getConfigurator().apply(slot0Configs);
m_left.setControl(new Follower(22, true));
Expand Down

0 comments on commit 9ea48d1

Please sign in to comment.