The blank final field constants may not have been initialized Java(33554513) Error

Simulation code Error

DifferentialDrivetrainSim m_driveSim = new DifferentialDrivetrainSim(

DCMotor.getNEO(2),       // 2 NEO motors on each side of the drivetrain.

7.29,                    // 7.29:1 gearing reduction.

7.5,                     // MOI of 7.5 kg m^2 (from CAD model).

60.0,                    // The mass of the robot is 60 kg.

Units.inchesToMeters(3), // The robot uses 3" radius wheels.

0.7112,                  // The track width is 0.7112 meters.

// The standard deviations for measurement noise:

// x and y:          0.001 m

// heading:          0.001 rad

// l and r velocity: 0.1   m/s

// l and r position: 0.005 m

VecBuilder.fill(0.001, 0.001, 0.001, 0.1, 0.1, 0.005, 0.005));

public DriveSim() {

m_leftEncoder.setDistancePerPulse(2 * Math.PI * 6.35 / 40158);

m_rightEncoder.setDistancePerPulse(2 * Math.PI * 6.35 / 40158);

SmartDashboard.putData("Field", m_field);

}

// I’ve tried to do a robot simulation but that function just gave that error. Although it is illogical, I putted a bracket under that code" VecBuilder.fill(0.001, 0.001, 0.001, 0.1, 0.1, 0.005, 0.005));" it seems it’s solved but another error showed again

Can you provide the full error output, and preferably a link to your code (i.e. in github)?

In short, that error means you have a variable somewhere defined as “final” but without a value, nor does it get a value assigned in the constructor.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.