iris-ua / iris_lama

LaMa - A Localization and Mapping library
BSD 3-Clause "New" or "Revised" License
336 stars 72 forks source link

FrequencyMap: is this correct or a bug? #29

Closed facontidavide closed 3 years ago

facontidavide commented 3 years ago

I was looking at this code:

bool lama::FrequencyOccupancyMap::setOccupied(const Vector2ui& coordinates)
{
    // ...
    bool occupied = prob(*cell) > occ_thresh;
    cell->occupied++;
    cell->visited++;
    // ...
}

Shouldn't it be instead:

    bool occupied = prob(*cell) > occ_thresh;
    if( occupied ) cell->occupied++;
    cell->visited++;
}
facontidavide commented 3 years ago

oh, I think I figured it out, never mind

eupedrosa commented 3 years ago

I was writting my reply to you, but it seems that it solved by it self :)