Package pyrobot :: Package robot :: Module device :: Class SensorValue
[frames | no frames]

Class SensorValue


Used in new Python range sensor interface

Method Summary
  __init__(self, device, value, pos, geometry, noise)
Constructor for the SensorValue object.
  angle(self, unit)
Method to return the angle.
  distance(self, unit)
Method to compute distance to the hit.

Property Summary
  hit

Method Details

__init__(self, device, value, pos=None, geometry=None, noise=0.0)
(Constructor)

Constructor for the SensorValue object.

A SensorValue is created for each range device reading.

>>> robot.sonar[0][3]
<SensorValue>
>>> robot.sonar[0][3].value
2.354

Methods:
   display()    - same as .value, but can change units
   angle()      - same as .geometry[3], but can change units 

Properties:
   value    - the rawvalue of the device
   pos      - the ID of this sensor
   geometry - (origin x, origin y, origin z, th, arc in radians) of ray
   noise    - percentage of noise to add to reading
   hit      - the (x,y,z) of the position of the hit

angle(self, unit='degrees')

Method to return the angle. Can change the units of return angle.

distance(self, unit=None)

Method to compute distance to the hit.

Generated by Epydoc 2.1 on Mon Jul 25 01:39:27 2005 http://epydoc.sf.net