/// <summary> /// Update cell as occupied /// </summary> /// <param name="cell">The cell</param> public void UpdateSetOccupied(LogOddsCell cell) { if (cell.Value < 50.0f) { cell.Value += logOddsOccupied; } }
public float GetObstacleThreshold() { LogOddsCell temp = new LogOddsCell(); temp.Reset(); return(gridFunctions.GetGridProbability(temp)); }
private void BresenhamCellFree(int offset) { LogOddsCell cell = GetCell(offset); if (cell.UpdateIndex < currMarkFreeIndex) { gridFunctions.UpdateSetFree(cell); cell.UpdateIndex = currMarkFreeIndex; } }
/** * Get the probability value represented by the grid cell. * @param cell The cell. * @return The probability */ public float GetGridProbability(LogOddsCell cell) { float odds = MathF.Exp(cell.Value); return(odds / (odds + 1.0f)); /* * float val = cell.logOddsVal; * * //prevent #IND when doing exp(large number). * if (val > 50.0f) { * return 1.0f; * } else { * float odds = exp(val); * return odds / (odds + 1.0f); * } */ //return 0.5f; }
/// <summary> /// Update cell as not free /// </summary> /// <param name="cell">The cell</param> public void UpdateUnsetFree(LogOddsCell cell) { cell.Value -= logOddsFree; }
/// <summary> /// Update cell as free /// </summary> /// <param name="cell">The cell</param> public void UpdateSetFree(LogOddsCell cell) { cell.Value += logOddsFree; }