why is LeftSide based on volts3? Should it be a function of volts4?
Good catch, I missed it, although it isn't used in the decision structure.
Another thing occurred to me this morning that may have bearing on the
overall behavior. If these are GP2D12 type devices being used, and it still
isn't clear if this is the case, they take about 50-msec to produce a new
output reading, and each reading is based upon the average of 10 triangulations
made over those 50-msec.
If the bot is moving fast, or especially if "rotating" fast, GP2 devices can
produce large errors in distance measurement. And this is worse if some
of the readings are taken at oblique angles, such as the bot near a wall
and the sensor pickup angle turned almost parallel to it.
FWIW, Joe Jones in his book Robot Programming goes on and on about the
general unreliability of most sensor readings, and how it pays to have different
types backing up each other. If you only have one temperature probe on your
nuclear reactor, and the probe fails, then what? Just something to think about.