Measure the distance using color sensor 2.0

Hi all!

I would like to know if there is a way to measure the distance of an object using the color sensor that comes with the Mindstorms 2.0. I am gaining a few conferences of the sensor, but I don't know how to convert these values to distance.

Any reference or a link would be appreciated!

Thank you!

Hi fran_jo,

Here is an article which offers a good method to calculate the exact values of scaling to convert measures of intensity at a distance: http://www.hitechnic.com/blog/eopd-sensor/eopd-how-to-measure-distance/.  Do not forget that this relates to a third party of sensor, but the concepts should always be applied.

Also note that the color sensor is affected by ambient light.  You can try to use a 2nd sensor to take account of all the ambient light.  What you trying to accomplish with this application?  Is there a reason that you are not using the ultrasonic sensor?

Tags: NI Products

Similar Questions

  • How to measure the distance using script

    Hello

    Is it possible to measure the distance of any document in photoshop using the measure tool, using the script. Below the steps required by me. Hope I'm clear in my communications.

    I've searched the forums, but couldn't find appropriate answers.

    1. open the Photoshop document

    2. allow the user to draw the line with measure tool

    3. the alert distance

    RGS

    Anish

    This only works with CS5 because it now uses the tool instead of a path rule. But it solves all the problems talked about in this thread and many other differences between the original function and the data in the info panel.

    It returns a custom with angle and length properties object if there is a rule tool line in the active document and not of the indefinite. I didn't know if the length must be a unitValue or number in the units of the rule settings. I went with number because the Panel info has different number of decimal places for the different units. And as the Panel assigned the corresponding graduation info per cent the length value is empty

    function getRulerToolLengthAndAngle() {}

    points of var = [];

    points. Start = [];

    points. End = [];

    var / / desc = new ActionDescriptor();

    Var ref = new ActionReference();

    ref.putProperty (charIDToTypeID ('Rprp'), charIDToTypeID ("RrPt"));

    ref.putEnumerated (charIDToTypeID ('Dcmn'), charIDToTypeID ('Ordn'), charIDToTypeID ('Trgt'));

    desc.putReference (charIDToTypeID ('null'), ref);

    var / / desc = executeAction (charIDToTypeID ('getd'), desc, DialogModes.NO);

    If (desc.hasKey (charIDToTypeID ('points'))) {}

    pointList var = desc.getList (charIDToTypeID ('points'));

    var startPointDesc = pointList.getObjectValue (0);

    points. Start.push (startPointDesc.getUnitDoubleValue (charIDToTypeID ('X')));

    points. Start.push (startPointDesc.getUnitDoubleValue (charIDToTypeID ('Y')));

    var endPointDesc = pointList.getObjectValue (2);

    points.end.push (endPointDesc.getUnitDoubleValue (charIDToTypeID ('X')));

    points.end.push (endPointDesc.getUnitDoubleValue (charIDToTypeID ('Y')));

    var RES = {};

    res.toString = function() {return "RulerTool news" ;};}

    Pointed var = points.start;

    var points.end = b;

    If (pointed [0]

    var a = Math.max(pointA[0],pointB[0]) - Math.min (pointed [0], b [0]);

    var o = Math.max(pointA[1],pointB[1]) - Math.min (pointed [1], b [1]);

    var ang = (180/Math.PI) * Math.atan2(o,a);

    If (pointed [1]< pointb[1]){//negative="">

    Ang = - ang;

    };

    Res.angle = ang.toFixed (1);

    } else {}

    var a = Math.max(pointA[1],pointB[1]) - Math.min (pointed [1], b [1]);

    var o = Math.max(pointA[0],pointB[0]) - Math.min (pointed [0], b [0]);

    var = 180-((180/Math.PI) Ang * Math.atan2 (a, o));

    If (pointed [1]< pointb[1]){//negative="">

    Ang = - ang;

    };

    Res.angle = ang.toFixed (1);

    }

    If (app.preferences.rulerUnits == Units.PERCENT) {}

    Res. Length = "";

    } else {}

    var c = Math.sqrt + ((a*a) (o * o));

    var length = new UnitValue (c, 'px');

    length.baseUnit = new UnitValue((1/app.activeDocument.resolution),'in');

    Switch (app.preferences.rulerUnits) {}

    case Units.PIXELS: res.length = length.as('px').toFixed (2); break;

    case Units.INCHES: res.length = length.as('in').toFixed (3); break;

    case Units.CM: res.length = length.as('cm').toFixed (2); break;

    case Units.MM: res.length = length.as('mm').toFixed (1); break;

    case Units.POINTS: res.length = length.as('pt').toFixed (1); break;

    case Units.PICAS: res.length = length.as('pc').toFixed (2); break;

    }

    }

    return res;

    }

    }

    var getRulerToolLengthAndAngle() = Info;

    If (info! = undefined) alert (' the ruler tool angle is: ' + info.angle +'\nThe length is: ' + info.length);

  • How can I measure the output of a sensor pwm ultrasound using the module or 9403

    How can I measure the output of a sensor pwm ultrasound using the module or 9403

    Khalil,

    When you say 'measure' the PWM signal, exactly what to tell you?

    You're looking to measure the frequency or cycle of the signal function? You count the edges of the PWM output increase? Looking to control the waveform?

    With reconfigurable FPGA hardware, it is up to the user to define the function of the physical i/o on the FPGA chip. By connecting the signals as Adam suggests your digital pulse will be brought to the cRIO. In your FPGA program, you define the function. You can set a base counter or transfer digital data from single point to welcome you cRIO for floating-point more complex treatment. Example FPGA programs are located in the http://www.ni.com/IPnet.

    Hope this helps, please post any additional questions.

  • measure the distance between 2 impulses (PCI-6221)

    Hello

    I have a digital signal that sends a pair of impulses (100ns width each) roughly every 100ms and I measure the time between two pulses of a pair (with a resolution of 100 ns).
    For the moment, I got a card PCI-6221 to accomplish this task. Unfortunately, I have no solution until now only measures of counter, I found measure time between constant frequency signals, i.e. they cannot measure the distance between 2 single pulses.

    Any help / ideas / or even telling me that it is impossible to solve this task are appreciated

    Are the two pulses on the same line?

    If so, you need to just configure a task of the measurement period.  If they are on separate lines, you would use a task of "separation of two-edge.

    You might be to throw off by the timing of it:

    If you do not configure implicit synchronization in your task, will start on the first edge after DAQmx Read is called.  Thus, in order to intercept the signal, that you must configure your task, call DAQmx Read and then start your two squares.

    If you want the task to control the signal continuously, you must configure name timing.  In this case, you will receive a sample on each rising edge of the external signal (assuming that the two impulses on the same line) - If you start the task of counter before starting the production of pulses (which you probably should), then the same samples correspond to the time between pulses, the odd samples would be the time between each series of pulses.

    More information on modes of counting on the 6221 lie in the M series user manual.

    Best regards

  • Measure the distance between 2 points of glare

    Hello

    Does anyone know how to measure the distance between 2 points (attached Image) glare. The image shows 10 sets of points of glare. I appreciate if you can guide me to process the image and produce the algorithm to detect the 10 sets of points of glare and measure the distance from each game.

    Thank you

    Farid

    Check if this will do

  • Measure Z to a battery encoder encoder pulse frequency to measure the speed using a 6034 E card

    Hello

    I want to measure the speed of a motor that has an encoder to encoder hung on battery. It provides impulses 3 A, B and Z I uses a PXI 6034 E card. I wanted to know if there are any examples/ideas that could help me with this (I'm new to digital programming in Labview). I moved to NI Daqmx 9.8 recently of the old version that has supported the existing codes and therefore being updated the code. I also want to know if an external clock source is needed to do this. This.

    Hello

    There are several examples in the finder OR example (you can get here by going to help > find examples in a window of LabVIEW). You can browse examples of Encoder on input and output material > DAQmx > entry counter. You should be able to find some examples that will be useful.

    In addition, this link is a good resource to get started using DAQmx: http://www.ni.com/white-paper/5438/en

    Thank you!

  • Get the distance of kinect sensor depth with kinaesthesia

    Hello

    How can I get the distance to the nearest object?

    I use kinesthesia toolkit.

    Solved.

  • How can I change the scale when you measure the distance?

    When you measure a distance of 20 m on the pdr-drawing tool says 10 cm measurement. How can I change the scale? The notice said it's possible, but I don't know how I do

    Hi Bandreason,

    How to change you can visit this link: Adobe Acrobat x: change the measurement scale. ROCKY MOUNTAIN TRAINING blog document is for mac but option is the same.

    Kind regards

    Ajlan Huda.

  • Calculate the distance using values from table

    Based on the coordinates of two points A(x1,y1) and B(x2,y2) and x 1, x 2, y1, y2 are columns of the table to a table, I need a query (function?) to calculate the distance between these two points of each line of the table...
    Table:
    NRCRT (PK) X 1 X 2 Y1 Y2
    1 10 6 2 4
    2 1 3 0 5

    the mathematical formula is:
    http://www.mathwarehouse.com/algebra/distance_formula/images/distance-formula-image.jpg

    It is complex to me, but maybe someone can help me...

    Wintermute3190 wrote:
    Œuvres, but:
    DISTANCE_BETWEEN
    4.47213595499957939281834733746255247088
    5.3851648071345040312507104915403295563

    How to set to 5,38 just and 4.47

    CYCLE of use or function TRUNC

    SQL> WITH test_tab AS
      2       (SELECT 1 nrcrt, 10 x1, 6 x2, 2 y1, 4 y2
      3          FROM DUAL
      4        UNION ALL
      5        SELECT 2, 1, 3, 0, 5
      6          FROM DUAL)
      7  SELECT nrcrt,
      8         TRUNC(SQRT ((POWER ((x2 - x1), 2) + POWER ((y2 - y1), 2)
      9               )),2) distance_between
     10    FROM test_tab
     11  /
    
         NRCRT DISTANCE_BETWEEN
    ---------- ----------------
             1             4.47
             2             5.38
    
    SQL> WITH test_tab AS
      2       (SELECT 1 nrcrt, 10 x1, 6 x2, 2 y1, 4 y2
      3          FROM DUAL
      4        UNION ALL
      5        SELECT 2, 1, 3, 0, 5
      6          FROM DUAL)
      7  SELECT nrcrt,
      8         ROUND(SQRT ((POWER ((x2 - x1), 2) + POWER ((y2 - y1), 2)
      9               )),2) distance_between
     10    FROM test_tab
     11  /
    
         NRCRT DISTANCE_BETWEEN
    ---------- ----------------
             1             4.47
             2             5.39
    

    Notice the difference in the result. Use the one that works best for you.

    Kind regards
    JO

  • How to measure the distance between the elements now? cmd + move tool does not work

    I work on mac os x 10.9 and upgraded to photoshop cc2015.

    I used to measure distances between items by pressing cmd + move selected tool.

    Help please

    Do you have any guides? View > show > Smart Guides

  • To measure the pressure using a pressure transducer that provides the analog current output 4mA-20mA

    I wanted to acquire the current analog signal which varies from 4-20mA using NI 9207. I tried in 2 ways.

    method 1 - created an input channel current analog & used a reading Vi to acquire it. How can I give the channel connections in this...

    method 2 - using NOR-DAQ Assistant, I put the channel connections and I got Amplitude versus time graph. She also gave negative values. Can I do this way which is easier? How can I solve the problem

    First attachment belongs to the 1st method

    Second attachment belongs to the 2nd method


  • How can I change the width of the line that appears when using the distance tool in the toolbar meaasuring

    When I want to measure the distance of a line of architectural drawing and I scroll to the bottom of the toolbar to measure and then I select distance when I measure the distance line is about 24 points. How can I make thinner?

    You should be able to view the properties bar (cmd + E), select the annotation of measure and change the line with setting. If you click on the button 'More', you will be able to select the checkbox 'Use default properties' so any new measure you will have these new settings.

  • How to measure the frequency of NOR-DAQmx RPM tasks

    Hello

    I'm trying to measure the frequency using the NI DAQmx task and then convert it to a RPM if possible.

    I have the following material available to me.

    I have a block SCXI-1327 terminal, as well as a 6289 PXI multifunction data acquisition Module SCXI 1126.

    I wired in a mag ai7 sensor on my 1126 and then of the passage of an object metal I get a range of 6-8, so I am able to read the mag sensor.

    What I'm trying to do is somehow convert this analog measurement a RPM using the NI DAQmx task only.

    Any help would be appreciated.

    Hi, smooth,

    Yes, you would select linear, then put in the result of this calculation of the slope.

    The Manual recommends a minimum frequency of at least 15 Hz for setting low range. This card is not really designed to measure the frequency for a single pulse over a long period of time.

    The number of LAPS down (assuming one pulse per turn) that we recommend that you measure with the 1126 is so 900 RPM. If you need measure low revs, and you cannot increase the number of impulses per turn, you could consider either read the signal as an analog waveform, or if it's a digital pulse, using a counter to basic task. In this way, you can use any method you want to handle the situation where there is only a single pulse in a long time.

  • How to measure the width of pulse with MyRIO

    Hello

    Sorry in advance if this is not the most appropriate forum.  I'm not entirely sure if it's a more general problem of 'software' or the MyRIO-specific.  I have searched the forums and found a few related topics but could find no one who help me in this context.

    I'm trying to measure the width of a sensor pulse ultrasonic ping.  It emits a signal conditioning - the time that it is high directly corelates how far is the object.  Being new to LabVIEW I am confused as to how do I calculate the time it remains high.

    I read that LabVIEW should not need to 'variables' as in python or C, for what is the best way to measure time, the signal is high?  Normally, I'd go (new_time - old_time), but obviously I can't store an old time in LabVIEW as I would in python or C.

    Other notes:

    I have the sensor correctly ping echoing and I can see the blips on a chart and see a perfectly square wave valid.

    To answer your question on how you would in LabVIEW...

    While LabVIEW has not stated/named variables that you have in a language based on text, the data is stored on the wires. You can use the nodes as node registers or shift of feedback to store values between iterations of a loop:

    (this will keep subtracting y (starting with 0) and store the result for the next time it runs)

    LabVIEW also has functions in the range of mathematics/signal processing to make the detection of pulse on a waveform.

  • Decrease the opacity of the layer with the Distance from the camera

    Is there a way to automatically decrease layer opacity that layer away a camera?

    We will break down the process of thought, of expression and see if we can make it work for you.

    First of all, you must measure the distance between the camera and the layer. The Expression Language Menu effects has a under vector math method which measures the distance between two points, we can use. Use the camera to a point and the position of the layer on the other and we have the first number.

    Now we must decide what we want the opacity to what concerns the distance. When the layer is the same distance from the camera the zoom value will be called the equivalent of a scale of 100%. It is perhaps a good place to have the layer is completely visible. This distance is easily implemented by assigning the fully visible distance to the Active camera zoom value. Then we have to decide how far the layer must be when it is completely invisible (opacity = 0). Personally, I think that the best way to proceed is to use a multiplier for the zoom value. 4 X with most lens settings is a nice distance.

    To configure the relationship between the distance and the maximum opacity, you can use one of the methods of Interpolation in the Expression Language Menu. We will use the method with the maximum and minimum values.

    We'll put that together in an expression. The two methods to use are

    length (point1, point2)

    linear (t, tMin, tMax, value1, value2)

    Set some variables for each of the values and we're done:

    point1 = thisComp.activeCamera.position;
    point2 = position;
    tMin = thisComp.activeCamera.zoom;
    tMax = tMin * 4;
    value1 = 100;
    value2 = 0;
    
    t = length(point1, point2);
    easeIn(t, tMin, tMax, value1, value2)
    

    If you really want to get fancy then you can add a transformation from layer space to the camera and the layer so that the expression might work even with or without layers relative to the camera and/or the layer. ToWorld changing looks like this:

    point1 = thisComp.activeCamera.toWorld([0,0,0]);
    point2 = thisLayer.toWorld(anchorPoint);
    

    Furthermore, I use usually more descriptive and shorter names for variables, but thought that it would make it easier to understand what was going on in the expression. I use also usually Active camera for my expressions rather than thisComp.layer ("camera 1") because it works little whatever you named your active camera.

Maybe you are looking for

  • How do I change from automatic backup by oldest date Photos?

    I started to feel comfortable with pictures, but it is something that I can't find out how.  I can sort the albums alphabetically and photos in them by most recent first. However, I can't for the life of find me where to change what seems to be the d

  • How can I choose which photos to iCloud phone

    So I have a lot of pictures on my iMac (under OSX El Capitan) and so now I Cloud that they almost fill the memory on my iPhone 4.  Is there a way I can choose only the pictures I want to leave iCloud appear on my phone?

  • HP 95 LX for PC connection

    Where can I find software to run on Windows 7, which transfers files to/from HP 95 LX? Can I use the original with connector cable series 9 pins? Thank you very much in anticipation. 007 - half

  • Portable PRINTER HP OFFICEJET 4630: How do you define the time in 4630 Officejet?

    Hello, this is a question already asked here, but there is no correct answers. I, too, put the date and time when the installation. Later in the day, the time jumped before 4 hours on its own. Cannot find anywhere on how to reset the time on my PRINT

  • OpenAL alcCaptureOpenDevice hangs on Blackberry Q10

    Q10 firmware: 10.1.0.4285 I am using OpenAL for capture sound, but on Q10 I have problem that cannot open capture device. Device capture open Simulator (v10_1_X.1483) is OK well (I have not tested real sound capture yet). Here is my code for this sni