frc-characterization icon indicating copy to clipboard operation
frc-characterization copied to clipboard

List index out of bounds

Open Mee42 opened this issue 4 years ago • 1 comments

I'm trying to characterize our drivetrain. We're running falcon motors on mecanum. When trying to generate the project, the error "Unable to generate project, config might be bad. Details: IndexError("List index out of range")". There's nothing printed to stdin/out, all that is printed is

2021-02-05 18:02:07,946:946 INFO    : logger              : Config: {'motorPorts': [31, 34], 'rightMotorPorts': [32, 33], 'controllerTypes': ['WPI_TalonFX'], 'rightControllerTypes': ['WPI_TalonFX'], 'motorsInverted': [31, 34], 'rightMotorsInverted': [32, 33], 'encoderEPR': 16384, 'gearing': 1, 'encoderPorts': [31, 34], 'rightEncoderPorts': [32, 33], 'encoderInverted': False, 'rightEncoderInverted': False, 'gyroType': 'NavX', 'gyroPort': '', 'controlType': 'CTRE'}

And here's the config

{
    # Ports for motors
    # If doing drive test, treat this as the left side of the drivetrain
    "motorPorts": [31, 34],
    # Only if you are doing drive (leave empty "[]" if not)
    "rightMotorPorts": [32, 33],
    # Class names of motor controllers used.
    # 'WPI_TalonSRX'
    # 'WPI_VictorSPX'
    # 'WPI_TalonFX'
    # If doing drive test, treat this as the left side of the drivetrain
    "controllerTypes": ["WPI_TalonFX"],
    # Only if you are doing drive (leave empty "[]" if not)
    "rightControllerTypes": ["WPI_TalonFX"],
    # Set motors to inverted or not
    # If doing drive test, treat this as the left side of the drivetrain
    "motorsInverted": [31, 34],
    # Only if you are doing drive (leave empty "[]" if not)
    "rightMotorsInverted": [32,33],
    # Encoder edges-per-revolution (*NOT* cycles per revolution!)
    # For the CTRE Mag Encoder, use 16384 (4 * 4096 = 16384)
    "encoderEPR": 16384,
    # Gearing accounts for the gearing between the encoder and the output shaft
    "gearing": 1,
    # Encoder ports (leave empty "[]" if not needed)
    # Specifying encoder ports indicates you want to use Rio-side encoders
    # If doing drive test, treat this as the left side of the drivetrain
    "encoderPorts": [31, 34],
    # Only if you are doing drive (leave empty "[]" if not)
    "rightEncoderPorts": [32, 33],
    # Set to True if encoders need to be inverted
    # If doing drive test, treat this as the left side of the drivetrain
    "encoderInverted": False,
    # Only if you are doing drive (set to False if not needed)
    "rightEncoderInverted": False,
    # ** The following is only if you are using a gyro for the DriveTrain test**
    # Gyro type (one of "NavX", "Pigeon", "ADXRS450", "AnalogGyro", or "None")
    "gyroType": "NavX",
    # Whatever you put into the constructor of your gyro
    # Could be:
    # "SPI.Port.kMXP" (MXP SPI port for NavX or ADXRS450),
    # "SerialPort.Port.kMXP" (MXP Serial port for NavX),
    # "I2C.Port.kOnboard" (Onboard I2C port for NavX),
    # "0" (Pigeon CAN ID or AnalogGyro channel),
    # "new WPI_TalonSRX(3)" (Pigeon on a Talon SRX),
    # "" (NavX using default SPI, ADXRS450 using onboard CS0, or no gyro)
    "gyroPort": "",
}

Mee42 avatar Feb 05 '21 23:02 Mee42

You're only passing 1 controller type per side. You need to have 2 values for the controllerTypes and rightControllerTypes.

Piphi5 avatar Feb 05 '21 23:02 Piphi5