18

While working on my localization algorithm, I also set up a baseline I can compare my results to. I chose AMCL which is the go-to localization package everyone uses in ROS.
I took a peek at their code and found this atrocity - "ad hoc weighting scheme" where probabilities that are not mutually exclusive are added together, and also taken to the power of 3 because why the hell not!

Comments
  • 1
    Ah, the ole cat whispering algorithm.
  • 0
    Well, the algorithm is probabilistic anyways...
  • 3
    Said ad-hoc scheme might have some intuitive justification that they didn't bother proving. I once modified a PID controller by exponentiating random parts of the PID equation for "tighter" response, it worked really well but I didn't bother with a proof. Also, nobody asked...
  • 1
    If it truly does work for this particular case and was derived from experience (i.e. pulled out of one's ass) then it's `ad-hoc`. Good code would be `a priori`.
  • 0
    @RememberMe Well, that works because squaring PID components just makes it rise/lower faster for larger values(taking care if the power is even or odd). Even if one of them goes crazy, the others will bring it down eventually.
  • 0
    @AvyChanna depends on the constants and system characteristics. Like I said, I did that intuitively, never bothered with a proof.
Add Comment