All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.gatech.cc.is.newton.NewtonTrans

java.lang.Object
   |
   +----EDU.gatech.cc.is.newton.NewtonTrans

public class NewtonTrans
extends Object
Introduction
Translates objects seen by an newton cognachrome board into robot-centric coordinates using a linear interpolation method. It (will soon) catagorizes the blobs for channels A & B according to size.

Frames of Reference
If (X,Y) is the center of a colored blob in the image, X is the column, numbered from 0 on the left to 200 on the right. Y is the row, from 0 at the top to 255 on the bottom.

In robot coordinates +x is forward, +y is to the left. A Nomad 150 is .24659467 meters in radius.

File Format
To work properly, NewtonTrans must read a configuration file, passed to it at construction time. Here is the format:

a_ratio          // true blob area = range * a_ratio * pixels_in_blob 
num_x            // number of X data elements 
row x_val        // the row of the bottom of the blob and the x coordinate 
row x_val        // MUST BE IN ASCENDING ROW ORDER !
row x_val
row x_val
row x_val
num_y            // number of Y data elements 
col y_val        // the col of the center of the blob and the y coordinate 
col y_val
col y_val
col y_val
col y_val
Here is an example file:
0.00007676243
3
91  2.40559
129 1.31339
235 0.36089
3
95  -0.762
136 0
190 0.762

Version:
July 1997
Author:
(c)1997 Tucker Balch, All Rights Reserved

Variable Index

 o a_ratio
 o ALL_MIN
 o BIG
 o DEBUG
 o MAX_BLOBS
 o newt
 o NO_DATA
 o xLut
 o yLut

Constructor Index

 o NewtonTrans(Newton, String)
Instantiate a newton.NewtonTrans object.

Method Index

 o getVisualObjects(int)
Get an array of Vec2s that point egocentrically from the turret, or position of the camera to a perceived object.
 o main(String[])
Test NewtonTrans
 o read_frame()
Tell the newton to get a data frame.

Variables

 o xLut
 protected double xLut[]
 o yLut
 protected double yLut[]
 o a_ratio
 protected double a_ratio
 o newt
 protected Newton newt
 o NO_DATA
 public static final double NO_DATA
 o MAX_BLOBS
 public static final int MAX_BLOBS
 o BIG
 public static final double BIG
 o ALL_MIN
 public static final double ALL_MIN
 o DEBUG
 public static final boolean DEBUG

Constructors

 o NewtonTrans
 public NewtonTrans(Newton n,
                    String f)
Instantiate a newton.NewtonTrans object.

Parameters:
n - the Newton object to get data from.
f - the configuration file name.

Methods

 o read_frame
 public void read_frame()
Tell the newton to get a data frame.

 o getVisualObjects
 public Vec2[] getVisualObjects(int chan)
Get an array of Vec2s that point egocentrically from the turret, or position of the camera to a perceived object.

Parameters:
chan - the channel (color) of the data to get.
Returns:
the array of visible objects.
 o main
 public static void main(String args[])
Test NewtonTrans


All Packages  Class Hierarchy  This Package  Previous  Next  Index