Pitt-RAS / micromouse-2016

7 stars 6 forks source link

Fixed the curve fitting script in plots directory #70

Closed amiller27 closed 7 years ago

amiller27 commented 7 years ago

This was really bothering me, so I fixed it.

The curve fitter is now much more robust, and is also completely parameterless, meaning that it should work with different sensors in the future without any modifications.

ghost commented 7 years ago

In the old version with left.cut I get

/usr/lib/python2.7/site-packages/scipy/optimize/minpack.py:715: OptimizeWarning: Covariance of the parameters could not be estimated
  category=OptimizeWarning)
[ nan  nan  nan  nan]

But it doesn't happen in the new version. Is that good because it's fixed, or bad because the behavior changed?

ghost commented 7 years ago

This happens in both old and new versions, so I doubt it's an issue, but just mentioning it.

RuntimeWarning: invalid value encountered in power return a*(x-b)**c+d

amiller27 commented 7 years ago

For the first one, as long as the new version spits out a plot with a fitted curve, that's good because it's fixed. The RuntimeWarning is fine.

ghost commented 7 years ago

OK, and should the input data still be plotted as points (ea8dd3700f125503c968e19c3a5e66b2d3aa23e4), or did you want it to be a line?

amiller27 commented 7 years ago

I think points is better