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

SumoEyes: this class provides PiStorms specific interface for the SumoEyes obstacle detection sensor from mindsensors.com. More...

Inheritance diagram for MsDevices.SumoEyes:

Public Member Functions

def __init__
 Initialize the class with the PiStorms bank. More...
 
def detectObstactleZone
 Check the zones for an obstacle. More...
 
def readSensorValue
 Reads the value from the SumoEyes sensor. More...
 
def setRange
 Sets the sensor range to LONG_RANGE or SHORT_RANGE setting. More...
 
def isNear
 Checks if the sensor reading is within a tolerance to find the zone. More...
 

Public Attributes

 sensor
 

Static Public Attributes

list SE_None = [0, "None"]
 
dictionary SE_Values
 
int PS_S1EV_Ready = 0x70
 
int PS_S2EV_Ready = 0xA4
 
 LONG_RANGE = True
 
 SHORT_RANGE = False
 

Detailed Description

SumoEyes: this class provides PiStorms specific interface for the SumoEyes obstacle detection sensor from mindsensors.com.

Constructor & Destructor Documentation

def MsDevices.SumoEyes.__init__ (   self,
  port 
)

Initialize the class with the PiStorms bank.

Parameters
selfThe object pointer.
portThe PiStorms bank.
Remarks
Example implementation in your program:
1 ...
2 psm = PiStorms()
3 se_sensor = MsDevices.SumoEyes(psm.BAS1)
4 ...

Member Function Documentation

def MsDevices.SumoEyes.detectObstactleZone (   self,
  verbose = False 
)

Check the zones for an obstacle.

Parameters
selfThe object pointer.
verboseOutputs the string value of the direction if set to True
Remarks
Example implementation in your program:
1 ...
2 psm = PiStorms()
3 se_sensor = MsDevices.SumoEyes(psm.BAS1)
4 print se_sensor.detectObstactleZone()
5 ...
def MsDevices.SumoEyes.isNear (   self,
  reference,
  value,
  tolerance = 40 
)

Checks if the sensor reading is within a tolerance to find the zone.

Parameters
selfThe object pointer.
referenceThe reference value.
valueThe sensor measurement.
toleranceThe tolerance.
Remarks
Should not be used in other programs
def MsDevices.SumoEyes.readSensorValue (   self)

Reads the value from the SumoEyes sensor.

Parameters
selfThe object pointer.
Remarks
Should not be used in other programs
def MsDevices.SumoEyes.setRange (   self,
  range = LONG_RANGE 
)

Sets the sensor range to LONG_RANGE or SHORT_RANGE setting.

Parameters
selfThe object LONG_RANGE.
rangeThe range (long is default)
Remarks
Example implementation in your program:
1 ...
2 psm = PiStorms()
3 se_sensor = MsDevices.SumoEyes(psm.BAS1)
4 se_sensor.setRange(se_sensor.SHORT_RANGE)
5 ...

Member Data Documentation

dictionary MsDevices.SumoEyes.SE_Values
static
Initial value:
1 = {
2  465: [1, "Front"],
3  555: [3, "Right"],
4  800: [2, "Left"]
5  }

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