|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jaer.eventprocessing.EventFilter
net.sf.jaer.eventprocessing.EventFilter2D
ch.unizh.ini.jaer.projects.tobi.goalie.Goalie
public class Goalie
Controls a servo motor that swings an arm in the way of a ball rolling towards a goal box. Calibrates itself as well.
Nested Class Summary | |
---|---|
protected class |
Goalie.GoalieState
|
static class |
Goalie.State
possible states, ACTIVE meaning blocking ball we can see, RELAXED is between blocks. |
Field Summary | |
---|---|
protected RectangularClusterTracker.Cluster |
ball
|
protected ServoArm |
servoArm
|
Fields inherited from class net.sf.jaer.eventprocessing.EventFilter2D |
---|
enclosedFilter, out |
Fields inherited from class net.sf.jaer.eventprocessing.EventFilter |
---|
annotationEnabled, chip, enclosedFilterChain, filterEnabled, log, perf, propertyTooltipMap, support |
Constructor Summary | |
---|---|
Goalie(AEChip chip)
Creates a Goaliestance of Goalie |
Method Summary | |
---|---|
void |
annotate(float[][][] frame)
not used |
void |
annotate(javax.media.opengl.GLAutoDrawable drawable)
Each annotator enters annotate with graphics context current, in coordinates with pixel 0,0 in LL corner (note opposite from Java2D) and pixel spacing 1 unit after the scaling transform (which is already active). |
void |
annotate(java.awt.Graphics2D g)
not used |
void |
doLearn()
|
void |
doRelax()
|
void |
doResetLearning()
|
EventPacket<?> |
filterPacket(EventPacket<?> in)
Subclasses implement this method to define custom processing. |
protected void |
finalize()
|
int |
getArmRows()
|
static java.lang.String |
getDescription()
|
java.lang.Object |
getFilterState()
should return the filter state in some useful form |
int |
getLearnDelayMS()
|
int |
getMaxPlayingTimeBeforeRestSec()
|
int |
getMaxYToUseVelocity()
|
int |
getMinPathPointsToUseVelocity()
|
int |
getPixelsToTipOfArm()
|
int |
getRangeOutsideViewToBlockPixels()
|
int |
getRelaxationDelayMs()
|
int |
getRestIntervalSec()
|
int |
getSleepDelaySec()
|
java.lang.Enum |
getState()
|
int |
getTopRowsToIgnore()
|
RectangularClusterTracker |
getTracker()
Returns the ball tracker |
float |
getWakeupBallDistance()
|
XYTypeFilter |
getXYFilter()
|
void |
initFilter()
initializes arm lowpass filter |
boolean |
isLogGoalieEnabled()
|
boolean |
isUseSoonest()
|
boolean |
isUseVelocityForGoalie()
|
void |
resetFilter()
should reset the filter to initial state |
void |
setArmRows(int armRows)
Defines the number of retina rows from bottom of image to tip of goalie arm to define tracking region for arm. |
void |
setFilterEnabled(boolean yes)
Resets the filter |
void |
setLearnDelayMS(int learnDelayMS)
|
void |
setLogGoalieEnabled(boolean logGoalieEnabled)
|
void |
setMaxPlayingTimeBeforeRestSec(int maxPlayingTimeBeforeRestSec)
|
void |
setMaxYToUseVelocity(int maxYToUseVelocity)
|
void |
setMinPathPointsToUseVelocity(int minPathPointsToUseVelocity)
|
void |
setPixelsToTipOfArm(int pixelsToTipOfArm)
Defines the distance in image rows to the tip of the goalie arm. |
void |
setRangeOutsideViewToBlockPixels(int rangeOutsideViewToBlockPixels)
|
void |
setRelaxationDelayMs(int relaxationDelayMs)
sets the delay after all targets disappear that the goalie relaxes |
void |
setRestIntervalSec(int restIntervalSec)
|
void |
setSleepDelaySec(int sleepDelaySec)
|
void |
setState(Goalie.State newState)
Sets the state. |
void |
setTopRowsToIgnore(int topRowsToIgnore)
|
void |
setUseSoonest(boolean useSoonest)
If true, then goalie uses ball that will hit soonest. |
void |
setUseVelocityForGoalie(boolean useVelocityForGoalie)
Sets whether the goalie uses the ball velocity or just the position |
void |
setWakeupBallDistance(float wakeupBallDistance)
|
void |
setXYFilter(XYTypeFilter xYFilter)
|
void |
update(java.util.Observable o,
java.lang.Object arg)
|
Methods inherited from class net.sf.jaer.eventprocessing.EventFilter2D |
---|
checkOutputPacketEventType, checkOutputPacketEventType, getEnclosedFilter, resetOut, setEnclosedFilter |
Methods inherited from class net.sf.jaer.eventprocessing.EventFilter |
---|
getChip, getEnclosedFilterChain, getEnclosingFilter, getPrefs, getPropertyChangeSupport, getPropertyTooltip, isAnnotationEnabled, isEnclosed, isFilterEnabled, prefsEnabledKey, setAnnotationEnabled, setChip, setEnclosed, setEnclosedFilter, setEnclosedFilterChain, setEnclosingFilter, setPreferredEnabledState, setPrefs, setPropertyTooltip |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.jaer.graphics.FrameAnnotater |
---|
isAnnotationEnabled, setAnnotationEnabled |
Field Detail |
---|
protected ServoArm servoArm
protected volatile RectangularClusterTracker.Cluster ball
Constructor Detail |
---|
public Goalie(AEChip chip)
Method Detail |
---|
public static java.lang.String getDescription()
public EventPacket<?> filterPacket(EventPacket<?> in)
EventFilter2D
filterPacket
in class EventFilter2D
in
- the input packet
public java.lang.Object getFilterState()
EventFilter
getFilterState
in class EventFilter
public void resetFilter()
EventFilter
resetFilter
in class EventFilter
public void initFilter()
initFilter
in class EventFilter
public void setFilterEnabled(boolean yes)
EventFilter2D
setFilterEnabled
in class EventFilter2D
yes
- true to resetEventFilter.setPreferredEnabledState()
public void annotate(float[][][] frame)
annotate
in interface FrameAnnotater
frame
- the RGB pixel information. First dimension is Y, second is X, third is RGBpublic void annotate(java.awt.Graphics2D g)
annotate
in interface FrameAnnotater
g
- the Graphics2D contextpublic void annotate(javax.media.opengl.GLAutoDrawable drawable)
FrameAnnotater
GL gl = drawable.getGL(); gl.glBegin(GL.GL_LINES); gl.glColor3f(.5f, .5f, 0); gl.glVertex2f(0, 0); gl.glVertex2f(getSizeX() - 1, getSizeY() - 1); gl.glEnd();
annotate
in interface FrameAnnotater
drawable
- the OpenGL drawable components, e.g., GLCanvaspublic boolean isUseVelocityForGoalie()
public void setUseVelocityForGoalie(boolean useVelocityForGoalie)
useVelocityForGoalie
- true to use ball velocitypublic int getRelaxationDelayMs()
public void setRelaxationDelayMs(int relaxationDelayMs)
relaxationDelayMs
- delay in mspublic boolean isUseSoonest()
public void setUseSoonest(boolean useSoonest)
useSoonest
- true to use soonest threat, false to use closest threatsetUseVelocityForGoalie(boolean)
public int getTopRowsToIgnore()
public void setTopRowsToIgnore(int topRowsToIgnore)
public int getArmRows()
public void setArmRows(int armRows)
armRows
- the number of rows of pixelspublic int getLearnDelayMS()
public void setLearnDelayMS(int learnDelayMS)
public void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
public void doResetLearning()
public void doLearn()
public void doRelax()
public int getPixelsToTipOfArm()
public void setPixelsToTipOfArm(int pixelsToTipOfArm)
pixelsToTipOfArm
- the number of image rows to the tippublic RectangularClusterTracker getTracker()
public float getWakeupBallDistance()
public void setWakeupBallDistance(float wakeupBallDistance)
public int getSleepDelaySec()
public void setSleepDelaySec(int sleepDelaySec)
public XYTypeFilter getXYFilter()
public void setXYFilter(XYTypeFilter xYFilter)
public int getRangeOutsideViewToBlockPixels()
public void setRangeOutsideViewToBlockPixels(int rangeOutsideViewToBlockPixels)
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public int getMinPathPointsToUseVelocity()
public void setMinPathPointsToUseVelocity(int minPathPointsToUseVelocity)
public int getMaxYToUseVelocity()
public void setMaxYToUseVelocity(int maxYToUseVelocity)
public java.lang.Enum getState()
public void setState(Goalie.State newState)
public boolean isLogGoalieEnabled()
public void setLogGoalieEnabled(boolean logGoalieEnabled)
public int getMaxPlayingTimeBeforeRestSec()
public void setMaxPlayingTimeBeforeRestSec(int maxPlayingTimeBeforeRestSec)
public int getRestIntervalSec()
public void setRestIntervalSec(int restIntervalSec)
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |