View Single Post
  #6   Spotlight this post!  
Unread 16-02-2016, 14:54
fireXtract fireXtract is offline
MegaHertz_Lux
FRC #2847 (Mega Hertz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: fmt
Posts: 42
fireXtract is an unknown quantity at this point
Re: Vision for frc 2016

I use a for loop to sort out all but the largest area item in the array. This is usually going to be the target if you are pointing the right way. Also using a filter contours pipe in GRIP may give you what you want.

EDIT:
Code:
public boolean isContours() {
		Robot.table.getNumberArray("area", greenAreasArray);
		if (greenAreasArray.length > 1) {
			return true;
		} else {
			return false;
		}
	}

	public void findMaxArea() {
		if (isContours()) {
			for (int counter = 0; counter < greenAreasArray.length; counter++) {
				if (greenAreasArray[counter] > maxArea) {
					maxArea = greenAreasArray[counter];
					arrayNum = counter;
				}
			}
			System.out.println(maxArea);
		}
	}
Reply With Quote