Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pcl"></param>
        /// <param name="laser"></param>
        /// <param name="drawRay">to draw raycasts send this as true</param>
        /// <returns>true if there are a complete cloud in pcl otherwise return false</returns>
        public bool runCasterSequential(ref pclInterface pcl, laserSensor laser, bool drawRay)
        {
            if (stackDone)//restart
            {
                currentAngle = topA;
                stackDone    = false;
            }

            if (currentAngle >= bottomA)
            {
                float currentHoriAngle = leftA;
                while (currentHoriAngle < rightA)
                {
                    getPointFromRay(currentHoriAngle, currentAngle, maxDist, ref pcl, laser, drawRay);
                    currentHoriAngle += horiInc;
                }
                currentAngle -= horiInc;
            }
            else
            {
                //Debug.Log("done " + pcl.cloudHasPoints());
                stackDone = true;
                if (pcl.cloudHasPoints())
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #2
0
        /// <summary>
        /// when pcl cloud completed return true
        /// </summary>
        /// <param name="pcl"></param>
        /// <param name="laser"></param>
        /// <param name="drawRay"></param>
        /// <returns></returns>
        public bool runCasterSimultaneos(ref pclInterface pcl, laserSensor laser, bool drawRay)
        {
            float currentVertAngle = topA;

            //vertical laser movement
            while (currentVertAngle >= bottomA)
            {
                float currentHoriAngle = leftA;
                //horizontal lase movement
                while (currentHoriAngle < rightA)
                {
                    getPointFromRay(currentHoriAngle, currentVertAngle, maxDist, ref pcl, laser, drawRay);
                    currentHoriAngle += horiInc;
                }
                currentVertAngle -= vertInc;
            }
            if (pcl.cloudHasPoints())
            {
                //Debug.Log("Going to be converted");
                return(true);
            }
            return(false);
        }