Announcement

Collapse
No announcement yet.

Modern Robotics Range Sensor Spikes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • KernelPanic
    replied
    Something like this might work.
    if (math.abs(senseValue - prevSenseValue) > 100) {
    senseValue = prevSenseValue;
    }
    else {
    prevSenseValue = senseValue;
    }

    or ...
    if (senseValue == 255) {
    // Ignore it
    senseValue = prevSenseValue;
    etc.

    Although personally, I'd be tempted to sample pretty quickly and run it through a fairly strong first order filter.... and ignore any changes that were greater than 100 counts.

    Leave a comment:


  • Alec
    replied
    Our team found out the hard way that, for whatever reason(s), your opmodes will occasionally get bad samples from your sensors. This is an opportunity for teams to find this out the easy way and design your sampling algorithms accordingly.

    Leave a comment:


  • RollerCoaster45
    replied
    We are having to do the same thing. I was just wondering if there was any way to prevent this.

    Leave a comment:


  • mikets
    replied
    When it doesn't receive an echo, it will return 255. This is expected. Our code keep track of the previous Range sensor reading and if it gives us 255, we throw away the bogus data and return the previous data instead.

    Leave a comment:


  • RollerCoaster45
    started a topic Modern Robotics Range Sensor Spikes

    Modern Robotics Range Sensor Spikes

    Hello all,

    We have been using the MR Range Sensor with our REV hub using a level shifter and sensor cable adapter. We found that the sensor returns good values except sometimes it returns values of 255 and we don't know why. Could anybody help with this?

    Thank you,
    Ishaan
    FTC 9794
    Wizards.exe
Working...
X