Giter VIP home page Giter VIP logo

Comments (10)

dwalton76 avatar dwalton76 commented on July 3, 2024

Red vs. Orange is always a beast :( I am able to reproduce the problem with the output from the html file you attached (thanks)...let me see what I can do

from rubiks-cube-tracker.

apurvakalia avatar apurvakalia commented on July 3, 2024

Thanks for responding so quickly. A couple of other things that may be important:

  • I am actually implementing this on BuildHat (and not on BrickPi3). So my solution is a combination of your code and the original PrimeCuber code
  • However, I am using your scanning code pretty much as is since PrimeCuber scans using the color sensor
  • Could the problem be related to the direction of spin in between scanning? I dont think so, but thought I would put it out there
  • I tried looking into the init.py file to see if there are any tolerances etc that I could tweak but could not see anything obvious
    Very interested to see what you find out. So please do let me know

from rubiks-cube-tracker.

dwalton76 avatar dwalton76 commented on July 3, 2024

image

question...is square 23 Orange and square 41 Red or is it the other way around?

from rubiks-cube-tracker.

apurvakalia avatar apurvakalia commented on July 3, 2024

I think that is the problem. The actual cube looks like this:
IMG-7730
IMG-7731

So by that 23 should be Red, right? The dictionary of returned RGB values shows:
'23': (230, 61, 33) ... '41': (180, 0, 7)

If 41 is orange as per the actual cube pictures, then the RGB values seem good (230 is "more" red than 180).

So am I spinning the cube the wrong way in between scans? Or is it some other problem?

from rubiks-cube-tracker.

dwalton76 avatar dwalton76 commented on July 3, 2024

yeah so 23 is Red and 41 is Orange...so we are getting the centers and corners correct but the orange vs red edges are all reversed.
image

You are not doing anything wrong...I suspect this is a bug:

from rubiks-cube-tracker.

apurvakalia avatar apurvakalia commented on July 3, 2024

Yes, the edges seem to be getting flipped. The RGB values of the edges look good (e.g. '20': (224, 54, 29) vs '38': (172, 0, 5)). So it does look like a bug.....

from rubiks-cube-tracker.

dwalton76 avatar dwalton76 commented on July 3, 2024

I see what was wrong and pushed a fix, do sudo python3 -m pip install git+https://github.com/dwalton76/rubiks-color-resolver.git to install the latest code from the repo with the fix and let me know if it works

from rubiks-cube-tracker.

apurvakalia avatar apurvakalia commented on July 3, 2024

wow! that was quick. Unfortunately, I wont get to testing this later today, but I will try and match your alacrity and let you know as soon as I test it out :) Do I need to uninstall the current install before pulling in the fix? Also, just out of curiosity, what was the bug?

from rubiks-cube-tracker.

dwalton76 avatar dwalton76 commented on July 3, 2024

In a nutshell we were looking at all of the corner squares and classifying them as one of the six colors and we used that to define a baseline RGB for each of the six colors. For an odd cube though we can do a little better by only using the square in the dead center of each side for defining a baseline RGB for each of the six colors. For odd cubes we know that:

  • yellow must always be opposite white
  • red must always be opposite orange
  • green must always be opposite blue

so that makes it much easier to get them classified as one of the size colors correctly.

from rubiks-cube-tracker.

apurvakalia avatar apurvakalia commented on July 3, 2024

Your fix worked! I can now successfully scan the cube 4 times out of 5. Every once in a while the cube becomes a little skewed while turning and then the scanner complains about not finding the black border, but that is a mechanical issue. I need to adjust my flipper so that the cube does not get skewed. Thanks a lot - I am now moving to the next part. Hopefully I can get this working for BuildHat soon....

from rubiks-cube-tracker.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.