Java vision example heading not changing

I’m using WPI’s vision tracker example, and there seems to be a strange issue: the turn heading doesn’t change. I added a call to print the turn value in autonomousPeriodic() to make sure of this.


/**
 * This function is called periodically during autonomous
 */
@Override
public void autonomousPeriodic() {
	// commented out for vision
	// Scheduler.getInstance().run();
	double centerX;
	synchronized (imgLock) {
		centerX = this.centerX;
	}
	double turn = centerX - (IMG_WIDTH / 2);
	// drive with turn
	System.out.println("Turn value: " + turn * 0.005);
	wpiDrive.arcadeDrive(0.5, turn * 0.005);
}

(The result code is at https://github.com/BHSSFRC/patricias-coffee/blob/develop/JavaBot/src/org/usfirst/frc/team3494/robot/Robot.java)

The console output looks like this:


Turn value: -0.025
Turn value: -0.025
Turn value: -0.025
...

Does anyone have any idea why the turn value doesn’t appear to be updating?

Within your Robot.java, line 69 …if !empty…, this is a dependency for finding at least one contour, is that false?

You know what, it probably is. I’ve been refining our vision pipeline to see if this is the case. Will update when I have answers.