I’m getting inconsistent distance readings on my GoPiGo3’s distance sensor. At distances greater than 3m it will seemingly randomly report substantially smaller distances. I checked with a tape measure and there’s nothing nearby at those distances, and there seems to be no pattern to it in frequency.
It happens in all the scripts I write, but as an example here’s a script I wrote to test this:
import time import easygopigo3 as easy robot = easy.EasyGoPiGo3() ds = robot.init_distance_sensor() index = int(input("Enter # of loops: ")) pause = float(input("Enter pause time: ")) for i in range(index): print(i,".",ds.read()) time.sleep(pause)
Here’s an example of the kinds of results I get (this one isn’t printing index the loop is at):
Is it possible for a dust mote to affect the readings? I’m running out of ideas. Any help would be suuuuuuper appreciated!
EDIT: Info below to help with troublehsooting.
OS (not Raspian for Robots or DexterOS):
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)" NAME="Raspbian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=raspbian ID_LIKE=debian
Hardware Test output:
Manufacturer : Dexter Industries Board : GoPiGo3 Serial Number : 493FB80D514E4C47324B2020FF071D0D Hardware version: 3.1.3 Firmware version: 0.3.4 Battery voltage : 15.856 5v voltage : 5.009
Commands used to update GoPiGo3:
sudo sh -c "curl -kL dexterindustries.com/update_gopigo3 | bash" sudo sh -c "curl -kL dexterindustries.com/update_sensors | bash"