locked
AnalogSensor State Not Accurate for Nxt Light Sensor RRS feed

  • Question

  • When running the LegoNxtLightSensor service in the samples solution at "C:\Microsoft Robotics Studio (1.0)\samples\Platforms\LEGO\NXT\LegoNXTServices\LegoNXTLightSensor.cs", when the Tribot configured Nxt robot goes over a black line, the "SendorNotificationHandler" does not always get called.  The same when it goes back to a white surface.  The event only seems to get raised when the light sensor goes over a large black or white surface.  Even then, the RawMeasurement does not accurately reflect the surface value. 

     

    When I don't use the service and directly interact with the Brick through the Bram.Lego.NxtLightSensor, it does raise the ValueChanged event as soon as it hits a different color.  It also accurately returns the value.

     

    How can I get the AnalogSensor to work the same way, so I can run this through the service rather than calling the Brick direclty?

     

    Thanks,

    Brian

    Friday, April 13, 2007 2:00 AM

Answers

  • Hi Brian.

    This may be because MSRS uses a little program on the LEGO to poll for sensor data.  It could be running too slow to capture the sensor changes when it quickly passes over an alternate color.

    From what I understand, Bram polls from the PC directly.  I'm not sure, but this may be working better because fewer sensors are  being monitored.

    You could try changing the MSRS configuration to not return other sensors that you are not using - this will cause the program running on the NXT side to do less work and it may provide better results.

     

    Sunday, June 3, 2007 4:39 PM

All replies

  • I've noticed the same thing.  Have you, or anyone else, found the cause?  I can get a measurement, but it doesn't seem to be very accurate.  It's always around 30 with the lights on, and always around 15 with the lights off.  However, when I run the light sensor test program directly from the brick, it has accurate measurements from below 10 all the way up to 100.  Strange.
    Friday, May 25, 2007 10:01 PM
  • Hi Brian.

    This may be because MSRS uses a little program on the LEGO to poll for sensor data.  It could be running too slow to capture the sensor changes when it quickly passes over an alternate color.

    From what I understand, Bram polls from the PC directly.  I'm not sure, but this may be working better because fewer sensors are  being monitored.

    You could try changing the MSRS configuration to not return other sensors that you are not using - this will cause the program running on the NXT side to do less work and it may provide better results.

     

    Sunday, June 3, 2007 4:39 PM