Trouble with FRC Characterization Tool

We are trying to use to the FRC Characterization tool (using the the talon template) and have run into some issues with getting it to run our robot for the data logger. There is no value of speed being sent, we checked the network tables and used print statements and have not found anything. When we run quasistatic forward in autonomous it says it is running however there is no movement and no change in any of the values. Is there anything we have overlooked that could help us fix our issue?

1 Like

You have to enable the robot before it will start sending values; be sure it is disabled when you start the test. The test will end when you disable it again.

We had it enabled and nothing seemed to change

The quasistatic test takes a while to ramp up; give it time.

We left it on for five minutes or so but nothing seemed to change

Next thing would be to ensure that your motor ports are correct in the configuration file.

We checked the ports and they are correct

Can you show me the code you used, and your config file?

This is our config file:

   public class Robot extends TimedRobot {

static private double WHEEL_DIAMETER = 0.5;
static private double ENCODER_EDGES_PER_REV = 906;
static private int PIDIDX = 0;

Joystick stick;
DifferentialDrive drive;

WPI_TalonSRX leftMaster;
WPI_TalonSRX rightMaster;

Supplier leftEncoderPosition;
Supplier leftEncoderRate;
Supplier rightEncoderPosition;
Supplier rightEncoderRate;
Supplier gyroAngleRadians;

NetworkTableEntry autoSpeedEntry =
NetworkTableInstance.getDefault().getEntry("/robot/autospeed");
NetworkTableEntry telemetryEntry =
NetworkTableInstance.getDefault().getEntry("/robot/telemetry");
NetworkTableEntry rotateEntry =
NetworkTableInstance.getDefault().getEntry("/robot/rotate");

double priorAutospeed = 0;
Number[] numberArray = new Number[10];

@Override
public void robotInit() {
if (!isReal()) SmartDashboard.putData(new SimEnabler());

stick = new Joystick(0);

leftMaster = new WPI_TalonSRX(13);
leftMaster.setInverted(false);
leftMaster.setSensorPhase(false);
leftMaster.setNeutralMode(NeutralMode.Brake);

rightMaster = new WPI_TalonSRX(2);
rightMaster.setInverted(false);
rightMaster.setSensorPhase(false);
rightMaster.setNeutralMode(NeutralMode.Brake);

WPI_TalonSRX leftSlave0 = new WPI_TalonSRX(15);
leftSlave0.setInverted(false);
leftSlave0.follow(leftMaster);
leftSlave0.setNeutralMode(NeutralMode.Brake);

WPI_TalonSRX rightSlave0 = new WPI_TalonSRX(5);
rightSlave0.setInverted(false);
rightSlave0.follow(rightMaster);
rightSlave0.setNeutralMode(NeutralMode.Brake);

//
// Configure gyro
//

// Note that the angle from the NavX and all implementors of wpilib Gyro
// must be negated because getAngle returns a clockwise positive angle
Gyro gyro = new AnalogGyro(0);
gyroAngleRadians = () -> -1 * Math.toRadians(gyro.getAngle());

//
// Configure drivetrain movement
//

drive = new DifferentialDrive(leftMaster, rightMaster);

drive.setDeadband(0);

//
// Configure encoder related functions -- getDistance and getrate should
// return units and units/s
//

double encoderConstant =
    (1 / ENCODER_EDGES_PER_REV) * WHEEL_DIAMETER * Math.PI;

leftMaster.configSelectedFeedbackSensor(
    FeedbackDevice.QuadEncoder,
    PIDIDX, 10
);
leftEncoderPosition = ()
    -> leftMaster.getSelectedSensorPosition(PIDIDX) * encoderConstant;
leftEncoderRate = ()
    -> leftMaster.getSelectedSensorVelocity(PIDIDX) * encoderConstant *
           10;

rightMaster.configSelectedFeedbackSensor(
    FeedbackDevice.QuadEncoder,
    PIDIDX, 10
);
rightEncoderPosition = ()
    -> rightMaster.getSelectedSensorPosition(PIDIDX) * encoderConstant;
rightEncoderRate = ()
    -> rightMaster.getSelectedSensorVelocity(PIDIDX) * encoderConstant *
           10;

// Reset encoders
leftMaster.setSelectedSensorPosition(0);
rightMaster.setSelectedSensorPosition(0);

// Set the update rate instead of using flush because of a ntcore bug
// -> probably don't want to do this on a robot in competition
NetworkTableInstance.getDefault().setUpdateRate(0.010);

}

@Override
public void disabledInit() {
System.out.println(“Robot disabled”);
drive.tankDrive(0, 0);
}

@Override
public void disabledPeriodic() {}

@Override
public void robotPeriodic() {
// feedback for users, but not used by the control program
SmartDashboard.putNumber(“l_encoder_pos”, leftEncoderPosition.get());
SmartDashboard.putNumber(“l_encoder_rate”, leftEncoderRate.get());
SmartDashboard.putNumber(“r_encoder_pos”, rightEncoderPosition.get());
SmartDashboard.putNumber(“r_encoder_rate”, rightEncoderRate.get());
}

@Override
public void teleopInit() {
System.out.println(“Robot in operator control mode”);
}

@Override
public void teleopPeriodic() {
drive.arcadeDrive(-stick.getY(), stick.getX());
}

@Override
public void autonomousInit() {
System.out.println(“Robot in autonomous mode”);
}

/**

  • If you wish to just use your own robot program to use with the data logging
  • program, you only need to copy/paste the logic below into your code and
  • ensure it gets called periodically in autonomous mode
  • Additionally, you need to set NetworkTables update rate to 10ms using the
  • setUpdateRate call.
    */
    @Override
    public void autonomousPeriodic() {
// Retrieve values to send back before telling the motors to do something
double now = Timer.getFPGATimestamp();

double leftPosition = leftEncoderPosition.get();
double leftRate = leftEncoderRate.get();

double rightPosition = rightEncoderPosition.get();
double rightRate = rightEncoderRate.get();

double battery = RobotController.getBatteryVoltage();

double leftMotorVolts = leftMaster.getMotorOutputVoltage();
double rightMotorVolts = rightMaster.getMotorOutputVoltage();

// Retrieve the commanded speed from NetworkTables
double autospeed = autoSpeedEntry.getDouble(0);
priorAutospeed = autospeed;

// command motors to do things
drive.tankDrive(
  (rotateEntry.getBoolean(false) ? -1 : 1) * autospeed, autospeed,
  false
);

// send telemetry data array back to NT
numberArray[0] = now;
numberArray[1] = battery;
numberArray[2] = autospeed;
numberArray[3] = leftMotorVolts;
numberArray[4] = rightMotorVolts;
numberArray[5] = leftPosition;
numberArray[6] = rightPosition;
numberArray[7] = leftRate;
numberArray[8] = rightRate;
numberArray[9] = gyroAngleRadians.get();

telemetryEntry.setNumberArray(numberArray);

}
}

You said you inserted print statements to verify nothing was coming in over networktables; I don’t see any place where you’re printing autospeed in that code, however.

Sorry I don’t have the print statements on this laptop it is on a different one which is not with me at the moment but we had it printing out right after priorAutospeed = autospeed

I’ve just run the Talon project from the most recent frc-characterization build in simulation on my computer and it worked fine; I also ran it on an actual robot earlier today, and it also worked fine.

If your descriptions so far are accurate, I suspect that you disconnected from NT during the test. I suggest you try it again, and keep an eye out for the “disconnected from NT” error window. If it appears, exit and re-enter the logger.

Okay, we will try that our next meeting and report back if there are anymore issues. I really appreciate your help!

So we checked for any disconnection error and nothing appeared in the riolog, the network table seems connected and setting auto speed to a value of 0.

Are you sure you’ve entered your team number correctly into the tool?

Yes

I’m at a loss, then. The tool works fine when I test it on my end, and without a recording and/or screenshots of your setup there’s not much more I can do.

I will try to get a recording of our process next meeting would that be alright?

That would be helpful. Please be sure to show the config file, the riolog, and the driver station throughout the process.

Okay so here is the recording:

and the config file and code:
robotconfig.py (2.0 KB)

characterization-project.zip (73.4 KB)