Skip to content

refresh settings before applying #10

@y0shi

Description

@y0shi

public void configureCoralMotor(){
SoftwareLimitSwitchConfigs m_softLimitConfig = new SoftwareLimitSwitchConfigs();
MotionMagicConfigs m_motionMagicConfigs = new MotionMagicConfigs();
MotorOutputConfigs m_motorConfig = new MotorOutputConfigs();
TalonFXConfiguration m_fxCfg = new TalonFXConfiguration();
Slot0Configs slot = new Slot0Configs();
slot.kV = EndEffectorConstants.CORAL_kV;
slot.kS = EndEffectorConstants.CORAL_kS;
slot.kP = EndEffectorConstants.CORAL_kP;
slot.kI = EndEffectorConstants.CORAL_kI;
slot.kD = EndEffectorConstants.CORAL_kD;
m_coralMotor.getConfigurator().apply(slot);
}
public void configureAlgaeMotor(){
SoftwareLimitSwitchConfigs m_softLimitConfig = new SoftwareLimitSwitchConfigs();
MotionMagicConfigs m_motionMagicConfigs = new MotionMagicConfigs();
MotorOutputConfigs m_motorConfig = new MotorOutputConfigs();
TalonFXConfiguration m_fxCfg = new TalonFXConfiguration();
Slot0Configs slot = new Slot0Configs();
slot.kV = EndEffectorConstants.ALGAE_kV;
slot.kS = EndEffectorConstants.ALGAE_kS;
slot.kP = EndEffectorConstants.ALGAE_kP;
slot.kI = EndEffectorConstants.ALGAE_kI;
slot.kD = EndEffectorConstants.ALGAE_kD;
m_algaeMotor.getConfigurator().apply(slot);
}
public void configureWristMotor(){
SoftwareLimitSwitchConfigs m_softLimitConfig = new SoftwareLimitSwitchConfigs();
MotionMagicConfigs m_motionMagicConfigs = new MotionMagicConfigs();
MotorOutputConfigs m_motorConfig = new MotorOutputConfigs();
TalonFXConfiguration m_fxCfg = new TalonFXConfiguration();
Slot0Configs slot = new Slot0Configs();
slot.kV = EndEffectorConstants.WRIST_kV;
slot.kS = EndEffectorConstants.WRIST_kS;
slot.kP = EndEffectorConstants.WRIST_kP;
slot.kI = EndEffectorConstants.WRIST_kI;
slot.kD = EndEffectorConstants.WRIST_kD;
slot.kG = EndEffectorConstants.WRIST_kG;

you should alwasy refresh configurators first before applying changes in order to not overwrite with zeros.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions