View Single Post
  #1   Spotlight this post!  
Unread 20-01-2017, 19:37
tkdberger's Avatar
tkdberger tkdberger is offline
SPAAACE
AKA: Edwan Vi
FRC #3494 (Quadrangles)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Bloomington, IN
Posts: 26
tkdberger is an unknown quantity at this point
Question 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.

Code:
/**
 * 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...bot/Robot.java)

The console output looks like this:

Code:
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?
Reply With Quote