PiStorms  4.012
PiStorms Library Reference by mindsensors.com
 All Classes Namespaces Files Functions Variables
mindsensors.NXTCAM Class Reference

NXTCAM: this class provides functions for models of the NXTCAM and PixyAdapter from mindsensors.com for read and write operations. More...

Inheritance diagram for mindsensors.NXTCAM:

Public Member Functions

def __init__
 Initialize the class with the i2c address of your NXTCAM. More...
 
def command
 Writes a value to the command register. More...
 
def sortSize
 Sort the detected objects by size. More...
 
def trackObject
 Track detected colors as objects. More...
 
def writeImageRegisters
 Write to image sensor registers. More...
 
def stopTracking
 Disable tracking. More...
 
def startTracking
 Enable tracking. More...
 
def getColorMap
 Get the color map from NXTCAM. More...
 
def illuminationOn
 Turn on illumination. More...
 
def readImageRegisters
 Read to image sensor registers. More...
 
def trackLine
 Track detected colors as lines. More...
 
def ping
 Ping the NXTCAM. More...
 
def reset
 Reset the NXTCAM. More...
 
def sendColorMap
 Send ColorMap to NXTCAM. More...
 
def illuminationOff
 Turn off illumination. More...
 
def sortColor
 Sort tracked objects by color. More...
 
def firmware
 Get the firmware version of the NXTCAM. More...
 
def sortNone
 Do not sort tracked objects. More...
 
def getNumberObjects
 Read the number of objects detected (0-8) More...
 
def getBlobs
 Reads data of the tracked object(s) More...
 

Static Public Attributes

tuple NXTCAM_ADDRESS = (0x02)
 Default NXTCAM I2C Address.
 
int COMMAND = 0x41
 Command Register.
 
int NumberObjects = 0x42
 Number of Tracked Ojects Register. More...
 
int Color = 0x43
 First Register Containing Tracked Object Data. More...
 
int X_Top = 0x44
 X-axis Top Register.
 
int Y_Top = 0x45
 Y-axis Top Register.
 
int X_Bottom = 0x46
 X-axis Bottom Register.
 
int Y_Bottom = 0x47
 Y-axis Bottom Register.
 

Detailed Description

NXTCAM: this class provides functions for models of the NXTCAM and PixyAdapter from mindsensors.com for read and write operations.

Constructor & Destructor Documentation

def mindsensors.NXTCAM.__init__ (   self,
  nxtcam_address = NXTCAM_ADDRESS 
)

Initialize the class with the i2c address of your NXTCAM.

Parameters
selfThe object pointer.
nxtcam_addressAddress of your AngleSensor.
Remarks

Member Function Documentation

def mindsensors.NXTCAM.command (   self,
  command 
)

Writes a value to the command register.

Parameters
selfThe object pointer.
commandValue to write to the command register.
def mindsensors.NXTCAM.firmware (   self)

Get the firmware version of the NXTCAM.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.getBlobs (   self,
  blobNum = 1 
)

Reads data of the tracked object(s)

Parameters
selfThe object pointer.
blobNumThe number of the tracked object.
Remarks
To use this function in your program:
1 from mindsensors import NXTCAM
2 ...
3 cam = NXTCAM()
4 cam.startTracking()
5 cam.trackObject()
6 b = cam.getBlobs(1)
7 print "Color: " + str(b.color)
8 print "Left: " + str(b.left)
9 print "Top: " + str(b.top)
10 print "Right: " + str(b.right)
11 print "Bottom: " + str(b.bottom)
def mindsensors.NXTCAM.getColorMap (   self)

Get the color map from NXTCAM.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.getNumberObjects (   self)

Read the number of objects detected (0-8)

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.illuminationOff (   self)

Turn off illumination.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.illuminationOn (   self)

Turn on illumination.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.ping (   self)

Ping the NXTCAM.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.readImageRegisters (   self)

Read to image sensor registers.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.reset (   self)

Reset the NXTCAM.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.sendColorMap (   self)

Send ColorMap to NXTCAM.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.sortColor (   self)

Sort tracked objects by color.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.sortNone (   self)

Do not sort tracked objects.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.sortSize (   self)

Sort the detected objects by size.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.startTracking (   self)

Enable tracking.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.stopTracking (   self)

Disable tracking.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.trackLine (   self)

Track detected colors as lines.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.trackObject (   self)

Track detected colors as objects.

Parameters
selfThe object pointer.
def mindsensors.NXTCAM.writeImageRegisters (   self)

Write to image sensor registers.

Parameters
selfThe object pointer.

Member Data Documentation

int mindsensors.NXTCAM.Color = 0x43
static

First Register Containing Tracked Object Data.

This is to be read in an array

int mindsensors.NXTCAM.NumberObjects = 0x42
static

Number of Tracked Ojects Register.

Will return a byte (0-8)


The documentation for this class was generated from the following file: