Go to Post "Oh, the farmer and the cowhand can be friends, la la la..." - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #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
  #2   Spotlight this post!  
Unread 20-01-2017, 23:11
wlogeais wlogeais is offline
Registered User
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2016
Rookie Year: 2011
Location: Minnesota
Posts: 18
wlogeais is an unknown quantity at this point
Re: Java vision example heading not changing

Quote:
Originally Posted by tkdberger View Post
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?
Reply With Quote
  #3   Spotlight this post!  
Unread 21-01-2017, 09:47
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
Lightbulb Re: Java vision example heading not changing

Quote:
Originally Posted by wlogeais View Post
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:15.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi