nathankellenicki / node-poweredup

A Javascript module to interface with LEGO Powered Up components.
https://nathankellenicki.github.io/node-poweredup/
MIT License
477 stars 59 forks source link

change colordistancesensor distance calculation #149

Closed Debenben closed 2 years ago

Debenben commented 2 years ago

I know the distances in general are not very accurate and it depends on the material used for testing how the infrared based distance value and light based partial value combine. But still, with this simplification my overall results were better.

nathankellenicki commented 2 years ago

This one is tricky. I originally had this set to -22 a couple of years ago, but I discovered that the delta varied wildly depending on the color of the object as well as the ambient light in the room. Testing it now using my hand, a white object appears somewhat accurate, whereas my hand is approx 20mm off.

Saying that, I've been considering changing it for a little bit based on my experience lately with a Christmas train project, so I'll accept this back for now (and change the WeDo 2.0 sensor too). We'll see if there's any complaints. :)