mrjadkowski / SMARS-mini-XL

A small wheeled or tracked robot running on Circuit Python
18 stars 3 forks source link

Stuck detection generates erroneous stuck events #4

Open mrjadkowski opened 3 years ago

mrjadkowski commented 3 years ago

Proximity sensor is reading roughly the same distance ahead of the robot while driving on flat ground (particularly on carpet) and the constant distance reading is triggering the stuck detection logic when the robot is not stuck

mrjadkowski commented 3 years ago

Move ToF/prox sensor higher?

mrjadkowski commented 3 years ago

Tried angling the sensor up slightly and it is a little better but erroneous stuck events are still happening when the robot is in wide open spaces. I think it might be cause by the sensor reading max range (8190), even though the code should reject any readings above 8000.

mrjadkowski commented 3 years ago

This may have been fixed in the 2.1.0 code by lowering stuck_variance to 10 from 20. It seems to be working now but I'm going to do more testing before closing the issue.

mrjadkowski commented 3 years ago

Still not perfect. It occasionally has an erroneous stuck event when in an open area, or doesn't detect that it is stuck. It's probably 90% reliable, but needs to be better. Some ideas:

Tune the "stuck_variance" parameter to minimize erroneous events Maybe move the LOS of the sensor even higher? It's gonna block the USB connector though. Use a longer-range ToF sensor that can detect further distances to minimize non-detect events