question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BOOST extension: "when color seen" hat not working

See original GitHub issue

The “when color seen” hat does not seem to trigger at all. I know this was working at some point! maybe the code just got out of sync.

In general, it looks like some cleanup may be needed in how color is represented in the code, to help distinguish between the numeric values reported by the sensor, the values used internally in the menu, the localized names used on the menu, and the localized names reported by the reporter.

I would also suggest renaming the _colorBucket data structure, since we are using a “token bucket” in the rate limiter which is quite different- this approach seems more like a sliding window? but it could just be called _colorSamples or _colorArray.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ericrosenbaumcommented, Apr 8, 2019

Just a detail here: this is not so obvious, but hat block opcodes should never have side effects. I noticed that the ANY case for the when color opcode sets the previousColor here. The reason this is not okay is that, as soon as you have more than one hat block of that type, the second one will not work (the first one will have have already set previousColor, so the second one will have a different result).

0reactions
knandersencommented, Apr 8, 2019

@ericrosenbaum @evhan55

Just a few notes about the sensor:

  • It is designed to detect certain LEGO bricks (shiny plastic): Bright Red, Blue, Dark Green, Yellow, White, and Black.
  • Its range is somewhere between 5-15mm.

After having tested the sensor this morning I feel like it’s actually performing as well as I would ever expect it to. I do however feel like I’m biased when testing the sensor, because I know how to use it ‘properly’, but others naturally may expect it to perform differently.

I’d like to have a discussion (including some hands-on demo) around this, because I do see some things we could do. Examples:

  • Rename block from when [COLOR] color seen to when [COLOR] *brick* seen, to clarify that it’s optimized for LEGO bricks.
  • Keep working to optimize the sensor stability (although I honestly don’t think there’s much to gain)
  • If we’re not happy with the performance, drop the sensor and use it’s distance-sensing capabilities instead.
Read more comments on GitHub >

github_iconTop Results From Across the Web

BOOST extension: using multiple "when color any" hats does ...
It should be possible to use the "when color seen" hat with the "any" option selected in two different stacks at the same...
Read more >
2 Piece Set Hat Cap Size Extension, add Size and Comfort ...
Buy 2 Piece Set Hat Cap Size Extension, add Size and Comfort - Snap-in and Go Black: Shop top fashion brands Baseball Caps...
Read more >
Color regions in Logic Pro - Apple Support
You can change the color of regions to identify sections of your arrangement, distinguish between track types, or for other uses.
Read more >
Color and psychological functioning: a review of theoretical ...
Empirical work on color and avoidance motivation has linked viewing red in achievement contexts to increased caution and avoidance (see Elliot ...
Read more >
New Rules of Cowboy Hat Etiquette - American Hat Makers
Cowboy hats are often considered an extension of their owner's personality and style. Cowboy greets the sunrise in a distressed leather cowboy ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found