Module idealReadings
[frames] | no frames]

Module idealReadings

Utility for computing ideal sonar readings

Functions
 
computeIdealReadings(worldPath, xMin, xMax, y, numStates, numObs)
Returns: list of numStates values, each of which is between 0 and numObs-1, which lists the ideal discretized sonar reading that the robot would receive if it were at the midpoint of each of the x bins.
 
idealSonarReading(robotPose, sensorPose, world)
Returns: length of ideal sonar reading; if the distance is longer than sonarDist.sonarMax or there is no hit at all, then sonarDist.sonarMax is returned.
 
discreteSonar(d, numBins)
Returns: number of the bin into which this sonar reading should fall; any reading greater than or equal to c{sonarDist.sonarMax} is put into bin numBins - 1.
 
discreteSonarValue(d, numBins)
Returns: number of the bin into which this sonar reading should fall; any reading greater than or equal to c{sonarDist.sonarMax} is put into bin numBins - 1.
Variables
  __package__ = None
Function Details

computeIdealReadings(worldPath, xMin, xMax, y, numStates, numObs)

 
Parameters:
  • worldPath - string naming file to read the world description from
  • xMin - minimum x coordinate for center of robot
  • xMax - maximum x coordinate for center of robot
  • y - constant y coordinate for center of robot
  • numStates - number of discrete states into which to divide the range of x coordinates
  • numObs - number of discrete observations into which to divide the range of good sonar observations, between 0 and goodSonarRange
Returns:
list of numStates values, each of which is between 0 and numObs-1, which lists the ideal discretized sonar reading that the robot would receive if it were at the midpoint of each of the x bins.

idealSonarReading(robotPose, sensorPose, world)

 
Parameters:
  • robotPose - util.Pose representing pose of robot in world
  • sensorPose - c{util.Pose} representing pose of sonar sensor with respect to the robot
  • world - soarWorld.SoarWorld representing obstacles in the world
Returns:
length of ideal sonar reading; if the distance is longer than sonarDist.sonarMax or there is no hit at all, then sonarDist.sonarMax is returned.

discreteSonar(d, numBins)

 
Parameters:
  • d - value of a sonar reading
  • numBins - number of bins into which to divide the interval between 0 and sonardist.sonarMax
Returns:
number of the bin into which this sonar reading should fall; any reading greater than or equal to c{sonarDist.sonarMax} is put into bin numBins - 1.

discreteSonarValue(d, numBins)

 
Parameters:
  • d - value of a sonar reading
  • numBins - number of bins into which to divide the interval between 0 and sonardist.sonarMax
Returns:
number of the bin into which this sonar reading should fall; any reading greater than or equal to c{sonarDist.sonarMax} is put into bin numBins - 1.