|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkoala.KoreCamera
public class KoreCamera
Class to control the camera (motors) of the Koala/Korebot. The camera motors are part of the KoreMotorLE module which is interfaced to the Korebot. Throughout the following the terms pan and tilt are used. To clarify, the "pan" motor rotates around a vertical axis, having the effect of panning the camera left to right. The "tilt" motor rotates around a horizontal axis, having the effect of tilting the camera up and down.
Method Summary | |
---|---|
int[] |
getImage()
Read a frame from the camera as an array of integers, where each element represents one pixel encoded in RGB. |
static KoreCamera |
getInstance()
Get a reference to the KoalaCamera. |
KoalaMotorLimits |
getPanMotorLimits()
Runs an automated movement which detects the left and right positions which limit how far the pan motor can rotate. |
int |
getPanMotorPosition()
Get the position of the pan motor. |
java.awt.Point |
getSpotPosition(boolean red)
Find a red or green spot in the current camera view. |
java.awt.Point |
getSpotPosition(java.awt.Color colour)
Find a spot of the specified colour in the current camera view. |
java.awt.Point |
getSpotPosition(java.awt.Color colour,
int[] colourLimits)
Find a spot of the specified colour in the current camera view. |
KoalaMotorLimits |
getTiltMotorLimits()
Runs an automated movement which detects the up and down positions which limit how far the tilt motor can rotate. |
int |
getTiltMotorPosition()
Get the position of the tilt motor. |
boolean |
isInitialised()
Check the motors have initialised. |
boolean |
isPanMotorBlocked()
Check if the pan motor has reached its physical limits. |
boolean |
isTiltMotorBlocked()
Check if the tilt motor has reached its physical limits. |
void |
setMotorPosition(int panPos,
int tiltPos)
Set the position of the camera motors. |
void |
setSpeed(int panSpeed,
int tiltSpeed)
Set the speed of the camera motors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static KoreCamera getInstance()
public boolean isInitialised()
public void setSpeed(int panSpeed, int tiltSpeed)
setSpeed
in interface KoreMotors
public void setMotorPosition(int panPos, int tiltPos)
setMotorPosition
in interface KoreMotors
public int getPanMotorPosition()
getPanMotorPosition
in interface KoreMotors
public int getTiltMotorPosition()
getTiltMotorPosition
in interface KoreMotors
public KoalaMotorLimits getPanMotorLimits()
getPanMotorLimits
in interface KoreMotors
public KoalaMotorLimits getTiltMotorLimits()
getTiltMotorLimits
in interface KoreMotors
public boolean isPanMotorBlocked()
isPanMotorBlocked
in interface KoreMotors
public boolean isTiltMotorBlocked()
isTiltMotorBlocked
in interface KoreMotors
public int[] getImage()
getImage
in interface KoalaCamera
public java.awt.Point getSpotPosition(java.awt.Color colour, int[] colourLimits)
getSpotPosition
in interface KoalaCamera
public java.awt.Point getSpotPosition(java.awt.Color colour)
getSpotPosition
in interface KoalaCamera
public java.awt.Point getSpotPosition(boolean red)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |