Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

moving average for ultrasonic rangefinder

$
0
0
Hello! I'm on a robotics team, and I have been tasked with programming the rangefinders (I'm not exactly an expert... I'm 16). Due to the noise when measuring the distance, we thought we should use a moving average to smooth the data. What we're stuck on at this point is how to feed the data from the sensor into an array. I've done quite a bit of research, which turned up a few methods for calculating the moving average, but I just want to know how to use the array.... We're working on an imbedded system, so we're basically limited to two libraries: Math and WPI. WPI includes classes for things such as rangefinder->GetDistance(inches) , rangefinder->SetSensitivity(sample_rate_per_second) , Wait(seconds), and so on, which allows it to replace most of the other libraries we would normally be requiring if we were programming something else. We know how to get and return data from the sensor, but, as I said before, can't figure out the array. Once we figure that part out, we'll be able to figure out the rest (the actual averaging and whatnot). If anyone happens to know how to do this, I would love to hear about it! Thanks!

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>