Пример #1
0
        /// <summary>
        /// Returns arrays to send out through messaging
        /// </summary>
        /// <param name="largeUDiff"></param>
        /// <param name="largeSigDiff"></param>
        /// <param name="pijDiff"></param>
        /// <param name="colIdx"></param>
        /// <param name="rowIdx"></param>
        public void GetArraysToSend(out List <Index> indexList, out List <float> heightList, out List <float> covList, out List <float> pijSumList, out List <float> laserHit)
        {
            int index = 0;

            if (indicesDictionary == null)
            {
                indexList  = new List <Index>();
                heightList = new List <float>();
                covList    = new List <float>();
                pijSumList = new List <float>();
                laserHit   = new List <float>();
                return;
            }
            else
            {
                indexList  = new List <Index>(indicesDictionary.Count);
                heightList = new List <float>(indicesDictionary.Count);
                covList    = new List <float>(indicesDictionary.Count);
                pijSumList = new List <float>(indicesDictionary.Count);
                laserHit   = new List <float>(indicesDictionary.Count);
            }

            lock (locker)
            {
                foreach (KeyValuePair <Index, int> pair in indicesDictionary)
                {
                    indexList.Add(pair.Key);
                    heightList.Add((float)uhatGM.GetCellByIdxUnsafe(pair.Key.Col, pair.Key.Row));
                    //heightList.Add((float)thresholdedHeightMap.GetCellByIdxUnsafe(pair.Key.Col, pair.Key.Row));
                    covList.Add((float)sigSqrGM.GetCellByIdxUnsafe(pair.Key.Col, pair.Key.Row));
                    pijSumList.Add((float)pij_sum.GetCellByIdxUnsafe(pair.Key.Col, pair.Key.Row));
                    laserHit.Add((float)LaserHit.GetCellByIdxUnsafe(pair.Key.Col, pair.Key.Row));
                    indexMap.SetCellByIdx(pair.Key.Col, pair.Key.Row, 0.0);                     // reset the index map
                }
                indicesDictionary.Clear();
            }
        }