Module sonarDist
[frames] | no frames]

Module sonarDist

Useful constants and utilities for dealing with sonar readings in soar.

Functions
 
getDistanceRight(sonarValues)
Returns: the perpendicular distance to a surface on the right of the robot, assuming there is a linear surface.
 
getDistanceRightAndAngle(sonarValues)
Returns: (d, a) where, d is the perpendicular distance to a surface on the right of the robot, assuming there is a linear surface; and a is the angle to that surface.
 
sonarHit(distance, sonarPose, robotPose)
Returns: util.Point representing position of the sonar hit in the global frame.
 
distAndAngle(h0, h1)
 
line(h0, h1)
Variables
  sonarPoses = [pose:(0.080000, 0.134000, 1.570796), pose:(0.122...
Positions and orientations of sonar sensors with respect to the center of the robot.
  sonarMax = 1.5
Maximum good sonar reading.
  __package__ = None
Function Details

getDistanceRight(sonarValues)

 
Parameters:
  • sonarValues - list of 8 sonar readings
Returns:
the perpendicular distance to a surface on the right of the robot, assuming there is a linear surface.

getDistanceRightAndAngle(sonarValues)

 
Parameters:
  • sonarValues - list of 8 sonar readings
Returns:
(d, a) where, d is the perpendicular distance to a surface on the right of the robot, assuming there is a linear surface; and a is the angle to that surface.

Change to use sonarHit, or at least point and pose transforms.

sonarHit(distance, sonarPose, robotPose)

 
Parameters:
  • distance - distance along ray that the sonar hit something
  • sonarPose - util.Pose of the sonar on the robot
  • robotPose - util.Pose of the robot in the global frame
Returns:
util.Point representing position of the sonar hit in the global frame.

Variables Details

sonarPoses

Positions and orientations of sonar sensors with respect to the center of the robot.

Value:
[pose:(0.080000, 0.134000, 1.570796),
 pose:(0.122000, 0.118000, 0.872665),
 pose:(0.156000, 0.077000, 0.523599),
 pose:(0.174000, 0.026600, 0.174533),
 pose:(0.174000, -0.026600, -0.174533),
 pose:(0.156000, -0.077000, -0.523599),
 pose:(0.122000, -0.118000, -0.872665),
 pose:(0.080000, -0.134000, -1.570796)]