|
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.rccar.Driver
public class Driver
Drives the RC car using the output from an enclosed line detector filter. The enclosed filter chain is a MultiLineClusterTracker which itself encloses a chain of XYTypeFilter - BackgroundActivityFilter - OnOffProximityFilter - SimpleOrientationFilter.
Preference values for these enclosed filters are stored by keys based on the enclosing Driver filter.
Driver uses the detected line to control steering and speed to drive along the line. The line is parameritized by its normal form (rho, theta), where rho is the angle of the normal to the line from the center of the chip image and theta is the length of the normal vector (closest passge to the origin at the chip image center). The angle rho is 0 or 180 for a vertical line and is 90 or 270 for a horizontal line.
(rho,theta) control the steering
Fires PropertyChangeEvent for the following
Nested Class Summary | |
---|---|
class |
Driver.DriverPreFilter
This filter chain is a common preprocessor for Driver line detectors |
Field Summary | |
---|---|
static float |
MAX_SPEED
Maximum constant speed of car under automatic driving via Driver property. |
Fields inherited from class net.sf.jaer.eventprocessing.EventFilter2D |
---|
enclosedFilter, out |
Fields inherited from class net.sf.jaer.eventprocessing.EventFilter |
---|
annotationEnabled, chip, enclosedFilterChain, filterEnabled, perf, propertyTooltipMap, support |
Constructor Summary | |
---|---|
Driver(AEChip chip)
Creates a new instance of Driver |
Method Summary | |
---|---|
void |
annotate(float[][][] frame)
annotate the RGB frame somehow by color pixels in the rendered pixel frame data. |
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)
each annotator is called by the relevant class (e.g. |
EventPacket<?> |
filterPacket(EventPacket<?> in)
Applies the enclosed LineDetector filter to extract the lowpassed dominant line feature in the scene, then computes steering and speed based on the filter output. |
float |
getAngleGain()
|
float |
getDefaultSpeed()
|
java.lang.Object |
getFilterState()
should return the filter state in some useful form |
float |
getOffsetGain()
|
float |
getSteerCommand()
Gets the actual steering command based on flipSteering |
float |
getTauDynMs()
|
void |
initFilter()
this should allocate and initialize memory: it may be called when the chip e.g. |
boolean |
isFlipSteering()
|
boolean |
isLoggingEnabled()
|
boolean |
isSendControlToBlenderEnabled()
|
boolean |
isShowAccelerometerGUI()
|
boolean |
isUseMultiLineTracker()
|
void |
resetFilter()
should reset the filter to initial state |
void |
setAngleGain(float angleGain)
Sets steering angleGain |
void |
setDefaultSpeed(float defaultSpeed)
|
void |
setFlipSteering(boolean flipSteering)
If set true, then drive towards events (road is textured), if false, drive away from events (side is textured). |
void |
setLoggingEnabled(boolean loggingEnabled)
|
void |
setOffsetGain(float offsetGain)
Sets steering offsetGain |
void |
setSendControlToBlenderEnabled(boolean sendControlToBlenderEnabled)
|
void |
setShowAccelerometerGUI(boolean showAccelerometerGUI)
|
void |
setTauDynMs(float tauDynMs)
|
void |
setUseMultiLineTracker(boolean useMultiLineTracker)
|
Methods inherited from class net.sf.jaer.eventprocessing.EventFilter2D |
---|
checkOutputPacketEventType, checkOutputPacketEventType, getEnclosedFilter, resetOut, setEnclosedFilter, setFilterEnabled |
Methods inherited from class net.sf.jaer.eventprocessing.EventFilter |
---|
getChip, getDescription, 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.jaer.graphics.FrameAnnotater |
---|
isAnnotationEnabled, setAnnotationEnabled |
Field Detail |
---|
public static final float MAX_SPEED
Constructor Detail |
---|
public Driver(AEChip chip)
Method Detail |
---|
public EventPacket<?> filterPacket(EventPacket<?> in)
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()
EventFilter
initFilter
in class EventFilter
public void annotate(float[][][] frame)
FrameAnnotater
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)
FrameAnnotater
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 float getOffsetGain()
public void setOffsetGain(float offsetGain)
public float getAngleGain()
public void setAngleGain(float angleGain)
public boolean isFlipSteering()
public void setFlipSteering(boolean flipSteering)
public float getSteerCommand()
public boolean isUseMultiLineTracker()
public void setUseMultiLineTracker(boolean useMultiLineTracker)
public float getTauDynMs()
public void setTauDynMs(float tauDynMs)
public float getDefaultSpeed()
public void setDefaultSpeed(float defaultSpeed)
public boolean isSendControlToBlenderEnabled()
public void setSendControlToBlenderEnabled(boolean sendControlToBlenderEnabled)
public boolean isLoggingEnabled()
public void setLoggingEnabled(boolean loggingEnabled)
public boolean isShowAccelerometerGUI()
public void setShowAccelerometerGUI(boolean showAccelerometerGUI)
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |