|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.unizh.ini.jaer.hardware.pantilt.PanTilt
public class PanTilt
Encapsulates a pan tilt controller based on using SiLabsC8051F320_USBIO_ServoController. Currently assumes that there is only one controller attached and that the pan and tilt servos are tied to the PAN and TILT servo output channels on the board. Port 2 of the ServoUSB board is used to power a laser pointer that can be activated. PanTilt directly controls the servo settings, but does not implement a calbration that maps from visual coordinates to pan tilt settings. To control the pan tilt to aim at a particular visual location in the field of view of a silicon retina, see PanTiltTracker.
PAN
,
TILT
,
PanTiltTracker
Field Summary | |
---|---|
int |
PAN
Servo output number on SiLabsC8051F320_USBIO_ServoController, 0 based. |
int |
TILT
Servo output number on SiLabsC8051F320_USBIO_ServoController, 0 based. |
Constructor Summary | |
---|---|
PanTilt()
|
|
PanTilt(ServoInterface servo)
Constructs instance with previously constructed SiLabsC8051F320_USBIO_ServoController |
Method Summary | |
---|---|
void |
acquire()
A method can set this flag to tell other objects that the servo is "owned" |
float |
getJitterAmplitude()
Returns the jitter amplitude |
float |
getJitterFreqHz()
Returns the jitter frequency in Hz |
float[] |
getPanTiltValues()
Returns the last value set, even if the servo interface is not functional. |
ServoInterface |
getServoInterface()
|
boolean |
isLockOwned()
A method can check this to see if it can use the servo |
void |
release()
Releases the "acquired" flag |
void |
setJitterAmplitude(float jitterAmplitude)
Sets the amplitude (1/2 of peak to peak) of circular jitter of pan tilt during jittering |
void |
setJitterFreqHz(float jitterFreqHz)
The frequency of the jitter |
void |
setLaserEnabled(boolean yes)
|
void |
setLaserOn(boolean yes)
Hack to control laser pointer power through pin 2 opendrain pulldown pins (multiple to share laser current of about 200mA |
void |
setPanTiltValues(float pan,
float tilt)
Simultaneously sets pan and tilt values. |
void |
setServoInterface(ServoInterface servo)
Sets the ServoInterface |
void |
startJitter()
Starts the servo jittering around its set position at a frequency of 50 Hz with an amplitude of 0.02f |
void |
stopJitter()
Stops the jittering |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final int PAN
public final int TILT
Constructor Detail |
---|
public PanTilt()
public PanTilt(ServoInterface servo)
Method Detail |
---|
public void setPanTiltValues(float pan, float tilt) throws HardwareInterfaceException
setPanTiltValues
in interface PanTiltInterface
pan
- the pan value from 0 to 1 inclusive, 0.5f is the center position. 1 is full right.tilt
- the tilt value from 0 to 1. 1 is full down.
HardwareInterfaceException
public void acquire()
acquire
in interface PanTiltInterface
public void release()
release
in interface PanTiltInterface
public boolean isLockOwned()
isLockOwned
in interface PanTiltInterface
public float[] getPanTiltValues()
getPanTiltValues
in interface PanTiltInterface
public float getJitterAmplitude()
PanTiltInterface
getJitterAmplitude
in interface PanTiltInterface
public void setJitterAmplitude(float jitterAmplitude)
setJitterAmplitude
in interface PanTiltInterface
jitterAmplitude
- the amplitudepublic float getJitterFreqHz()
PanTiltInterface
getJitterFreqHz
in interface PanTiltInterface
public void setJitterFreqHz(float jitterFreqHz)
setJitterFreqHz
in interface PanTiltInterface
jitterFreqHz
- in Hzpublic void startJitter()
startJitter
in interface PanTiltInterface
setJitterAmplitude(float)
public void stopJitter()
stopJitter
in interface PanTiltInterface
public void setLaserOn(boolean yes)
yes
- to turn on laserpublic void setServoInterface(ServoInterface servo)
PanTiltInterface
setServoInterface
in interface PanTiltInterface
servo
- the interfacepublic ServoInterface getServoInterface()
getServoInterface
in interface PanTiltInterface
public void setLaserEnabled(boolean yes)
setLaserEnabled
in interface LaserOnOffControl
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |