Пример #1
0
        /// <summary>
        /// show the path through which the robot moves
        /// </summary>
        /// <param name="img">image data</param>
        /// <param name="width">width of the image</param>
        /// <param name="height">height of the image</param>
        public void ShowPath(byte[] img, int width, int height)
        {
            float min_xx = min_x;
            float max_xx = max_x;

            if (max_xx - min_xx < 10)
            {
                min_xx = -5;
                max_xx = 5;
            }
            float min_yy = min_y;
            float max_yy = max_y;

            if (max_yy - min_yy < 10)
            {
                min_yy = -5;
                max_yy = 5;
            }

            if (path != null)
            {
                path.Show(img, width, height,
                          0, 0, 0, 1, min_xx - 100, min_yy - 100, max_xx + 100, max_yy + 100, true, 0);
            }
        }
Пример #2
0
 /// <summary>
 /// show the most probable path taken by the robot
 /// </summary>
 /// <param name="img">image data within which to draw</param>
 /// <param name="width">width of the image</param>
 /// <param name="height">height of the image</param>
 /// <param name="r">red</param>
 /// <param name="g">green</param>
 /// <param name="b">blue</param>
 /// <param name="line_thickness">thickness of the path</param>
 /// <param name="min_x">bounding box top left x coordinate</param>
 /// <param name="min_y">bounding box top left y coordinate</param>
 /// <param name="max_x">bounding box bottom right x coordinate</param>
 /// <param name="max_y">bounding box bottom right y coordinate</param>
 /// <param name="clear_background">whether to clear the image before drawing</param>
 public void ShowPath(byte[] img, int width, int height,
                      int r, int g, int b, int line_thickness,
                      float min_x_mm, float min_y_mm,
                      float max_x_mm, float max_y_mm,
                      bool clear_background)
 {
     if (best_path != null)
     {
         best_path.Show(img, width, height, r, g, b, line_thickness,
                        min_x_mm, min_y_mm, max_x_mm, max_y_mm,
                        clear_background, 0);
     }
 }
Пример #3
0
 /// <summary>
 /// show the tree of possible paths
 /// </summary>
 /// <param name="img"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 /// <param name="r"></param>
 /// <param name="g"></param>
 /// <param name="b"></param>
 /// <param name="line_thickness"></param>
 public void ShowTree(Byte[] img, int width, int height,
                      int r, int g, int b, int line_thickness)
 {
     for (int i = 0; i < ActivePoses.Count; i++)
     {
         bool clearBackground = false;
         if (i == 0)
         {
             clearBackground = true;
         }
         particlePath path = ActivePoses[i];
         path.Show(img, width, height, r, g, b, line_thickness,
                   min_tree_x, min_tree_y, max_tree_x, max_tree_y,
                   clearBackground, root_time_step);
     }
 }