Class Seeker

java.lang.Object
  |
  +--Seeker

public class Seeker
extends java.lang.Object

The purpose of this robot is to search for different colored objects and manuver the robot to pick them up. It also uses speech to say what it has found, and the total count by shape and color at the end.

This is the main start point for the Seeker robot (in the main() function).
After initialization, the main robot AI algorithm is handled in the Run() function.

Here are the Overall Flow and Functional Partition for the robot.


Field Summary
(package private) static int[] BallCounts
           
(package private) static CameraImage cImage
           
(package private) static motors RobotControl
           
(package private) static int TrackColor
           
(package private) static java.lang.String VoiceAllDone
           
(package private) static java.lang.String VoiceBall
           
(package private) static java.lang.String VoiceBalls
           
(package private) static java.lang.String VoiceFive
           
(package private) static java.lang.String VoiceFound
           
(package private) static java.lang.String VoiceFour
           
(package private) static java.lang.String VoiceGiveBin
           
(package private) static java.lang.String VoiceGreen
           
(package private) static java.lang.String VoiceLooking
           
(package private) static java.lang.String VoiceOne
           
(package private) static java.lang.String VoicePickingUp
           
(package private) static java.lang.String VoiceRed
           
(package private) static serialComm VoiceSerial
           
(package private) static java.lang.String VoiceThree
           
(package private) static java.lang.String VoiceTracking
           
(package private) static java.lang.String VoiceTwo
           
(package private) static java.lang.String VoiceWhite
           
(package private) static java.lang.String VoiceYellow
           
 
Constructor Summary
Seeker()
          Class constructor.
This function initialized the external components used by the robot.
One is the camera class, which does all the interaction and processing of the camera data.
 
Method Summary
private  void CameraClear()
          Tells the camera to go back to idle state and wait for it to happen.
 void Delay(int Amount)
          Sleep for the amount specified
static void main(java.lang.String[] args)
          This is the main function called by java to start things running.
This fuction simply creates an instance of the class and starts it running.
 void Run()
          This is where the actual overall AI of the robot is controlled from.
The general flow of the AI is as follows: Take a snapshot from the camera via serial download. Search the image for one of our pre-defined colors.
 void VoiceOutput(java.lang.String Cmd)
          Send one or more (up to 4) commands to voice extreme board for it to say in order.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

cImage

static CameraImage cImage

RobotControl

static motors RobotControl

TrackColor

static int TrackColor

VoiceSerial

static serialComm VoiceSerial

VoiceOne

static final java.lang.String VoiceOne

VoiceTwo

static final java.lang.String VoiceTwo

VoiceThree

static final java.lang.String VoiceThree

VoiceFour

static final java.lang.String VoiceFour

VoiceFive

static final java.lang.String VoiceFive

VoiceRed

static final java.lang.String VoiceRed

VoiceGreen

static final java.lang.String VoiceGreen

VoiceYellow

static final java.lang.String VoiceYellow

VoiceWhite

static final java.lang.String VoiceWhite

VoiceBall

static final java.lang.String VoiceBall

VoiceBalls

static final java.lang.String VoiceBalls

VoiceLooking

static final java.lang.String VoiceLooking

VoiceAllDone

static final java.lang.String VoiceAllDone

VoiceGiveBin

static final java.lang.String VoiceGiveBin

VoiceTracking

static final java.lang.String VoiceTracking

VoicePickingUp

static final java.lang.String VoicePickingUp

VoiceFound

static final java.lang.String VoiceFound

BallCounts

static int[] BallCounts
Constructor Detail

Seeker

public Seeker()
Class constructor.
This function initialized the external components used by the robot.
One is the camera class, which does all the interaction and processing of the camera data. A second is the robot control class, which handles the robot motor and sensors to actually move the robot around.
Method Detail

main

public static void main(java.lang.String[] args)
This is the main function called by java to start things running.
This fuction simply creates an instance of the class and starts it running.

Run

public void Run()
This is where the actual overall AI of the robot is controlled from.
The general flow of the AI is as follows:
  1. Take a snapshot from the camera via serial download.
  2. Search the image for one of our pre-defined colors.
    • If a color is found, tell camera to start tracking that color.
    • If a color is not found, rotate and repeat from #1
  3. Once we are tracking a color, track and move the robot till the bounding box is centered and of a pre-defined size (since we will be using a fixed size object).
  4. The object should not be inside the gripper hand of the robot. Grip the object and lift it till it is directly in front of the camera.
  5. Take another serial snapshot with the camera and use image processing to tell. if the object is a sphere or a cube. It will also to get color of the object.
  6. Use sound chip to verbalize the color and shape of the object.
  7. Drop the object into a holding bin onboard the robot.
  8. Repeat from #1
If in step 2 we have rotated through 360° and not found any object, we will stop searching.
The robot will use the sound chip to verbalize the total count of each type of object found.
For example, "2 blue circles, 1 red square, 3 yellow circles".

CameraClear

private void CameraClear()
Tells the camera to go back to idle state and wait for it to happen.

VoiceOutput

public void VoiceOutput(java.lang.String Cmd)
Send one or more (up to 4) commands to voice extreme board for it to say in order.
Parameters:
Cmd - String of 1 to 4 ascii voice commands. Use the Voice???? constants definded in this class.

Delay

public void Delay(int Amount)
Sleep for the amount specified
Parameters:
Amount - Number of milliseconds to delay