Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colour sensor should return 0-255 instead of 0 -100 in general #185

Open
VinArt opened this issue Jul 11, 2019 · 9 comments
Open

Colour sensor should return 0-255 instead of 0 -100 in general #185

VinArt opened this issue Jul 11, 2019 · 9 comments
Labels
bug Something isn't working

Comments

@VinArt
Copy link
Contributor

VinArt commented Jul 11, 2019

Describe the bug

  • If one would print out the RGB values gotten from colour sensor on the EV3 screen in simulation the overall range is form 0 to 100 and not from 0 to 255

To Reproduce

  • Create such a program:
    image
  • Run in simulation with robot view open

Expected behavior

  • Values would be from 0 to 255

Device information

  • OS: Linux
  • Browser Chrome 75

Additional context
Actual EV3 HAL implmentation has the following:

public synchronized ArrayList<Float> getColorSensorRgb(SensorPort sensorPort) {
        SampleProvider sampleProvider = this.deviceHandler.getProvider(sensorPort, ColorSensorMode.RGB.getValues()[0]);
        float[] sample = new float[sampleProvider.sampleSize()];
        sampleProvider.fetchSample(sample, 0);
        ArrayList<Float> result = new ArrayList<>();
        result.add((float) Math.round(sample[0] * 255.0f));
        result.add((float) Math.round(sample[1] * 255.0f));
        result.add((float) Math.round(sample[2] * 255.0f));
        return result;
    }

image
image

and since samples are from 0 to 1, then the overall result should be from 0 to 255

BTW, it treats transparent as black.

@bjost2s bjost2s added the bug Something isn't working label Aug 5, 2019
@bjost2s
Copy link
Contributor

bjost2s commented Aug 5, 2019

see #74

@bjost2s bjost2s added this to To do in release 3.6.0 via automation Aug 5, 2019
@rbudde
Copy link
Contributor

rbudde commented Aug 6, 2019

see #215

@rbudde rbudde closed this as completed Aug 6, 2019
release 3.6.0 automation moved this from To do to Done Aug 6, 2019
@bjost2s bjost2s removed this from Done in release 3.6.0 Sep 23, 2019
@bjost2s bjost2s added this to To do in release 3.6.2 via automation Sep 23, 2019
@bjost2s
Copy link
Contributor

bjost2s commented Sep 23, 2019

not solved in #215

@bjost2s bjost2s reopened this Sep 23, 2019
release 3.6.2 automation moved this from To do to In progress Sep 23, 2019
@VinArt VinArt moved this from In progress to To do in release 3.6.2 Sep 23, 2019
@bjost2s bjost2s changed the title Show text with RGB values from colour sensor shows 0-100 range in simulation Colour sensor should return 0-255 instead of 0 -100 in general Oct 2, 2019
@bjost2s
Copy link
Contributor

bjost2s commented Oct 2, 2019

Please also check this in all robots systems, simulation and real robots!

@bjost2s bjost2s removed this from To do in release 3.6.2 Nov 7, 2019
Caffetaria added a commit to Caffetaria/openroberta-lab that referenced this issue Dec 17, 2019
@boonto
Copy link
Contributor

boonto commented Dec 17, 2019

The simulation part was solved by a GCI student in PR #379.

boonto pushed a commit that referenced this issue Dec 18, 2019
@schrodingersca8
Copy link

If the issue is still open, I would like to work on this one.

@boonto
Copy link
Contributor

boonto commented Jan 30, 2020

Do you have a real EV3 to test with? The simulation parts are already solved.

@schrodingersca8
Copy link

No, I don't have one.

@boonto
Copy link
Contributor

boonto commented Feb 4, 2020

Then you can't work on this sadly. Maybe check out another issue. I'll go through them soon and add some "good first issue" labels, so stay tuned for that.

lmoellendorf pushed a commit to phaenovum/RoboRAVE-Cyberspace that referenced this issue Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants