コード例 #1
0
        /// <summary>
        /// Configures the point for plotting
        /// </summary>
        /// <param name="ellipse"></param>
        /// <param name="point"></param>
        private void ConfigureEllipse(ref Ellipse ellipse, Point point)
        {
            var polar = Lidar.ConvertToPolar(point);

            // Set the color based on how close the point is to the robot
            var ellipseColor = Colors.White;

            if (controller.Analysis.IsInStopZone(polar.Angle, polar.Distance))
            {
                ellipseColor = Colors.Red;
            }
            else if (controller.Analysis.IsInAdjustZone(polar.Angle, polar.Distance))
            {
                ellipseColor = Colors.Yellow;
            }

            ellipse.Width = ellipse.Height = 25;
            ellipse.Fill  = new SolidColorBrush(ellipseColor);
            ellipse.Name  = "point";
        }