Ejemplo n.º 1
0
def config_talon(talon: WPI_TalonSRX, motor_config: TalonMotorConfig):
    # when deploying it might be a somewhat good idea to actually uncomment this next line
    talon.configFactoryDefault()
    talon.enableVoltageCompensation(True)
    talon.configVoltageCompSaturation(motor_config.voltage_saturation)
    talon.enableCurrentLimit(True)
    talon.configPeakCurrentLimit(motor_config.peak_current)
    talon.configContinuousCurrentLimit(motor_config.continuous_current)
    talon.setNeutralMode(motor_config.default_mode)
    talon.configNeutralDeadband(motor_config.deadband)
    # talon.configOpenLoopRamp(motor_config.ramp_rate)
    talon.setInverted(motor_config.reversed)
Ejemplo n.º 2
0
def config_talon(talon: WPI_TalonSRX, motor_config: MotorConfig) -> None:
    talon.enableVoltageCompensation(True)
    talon.configVoltageCompSaturation(motor_config.voltage_saturation)

    talon.enableCurrentLimit(True)
    talon.configPeakCurrentLimit(motor_config.peak_current)
    talon.configContinuousCurrentLimit(motor_config.continuous_current)

    talon.setNeutralMode(motor_config.default_mode)

    talon.configNeutralDeadband(motor_config.deadband)

    talon.configOpenLoopRamp(motor_config.ramp_rate)