Exemplo n.º 1
0
        public void AddNewRobot(int robotID, Renderer r)
        {
            Color color;
            try
            {
                color = colors[robotID - 1];
            }
            catch (IndexOutOfRangeException e)
            {
                Random rand = new Random();
                color = Color.FromArgb((int)(rand.NextDouble() * 255), (int)(rand.NextDouble() * 255), (int)(rand.NextDouble() * 255));
            }
            Color colorBloated;
            try
            {
                colorBloated = colorsBloated[robotID - 1];
            }
            catch (IndexOutOfRangeException e)
            {
                Random rand = new Random();
                colorBloated = Color.FromArgb((int)(rand.NextDouble() * 255), (int)(rand.NextDouble() * 255), (int)(rand.NextDouble() * 255));
            }
            if (robotID != 5)
            {
                RobotRenderer rr = new RobotRenderer("Robot " + robotID, color);
                //robots[robotID] = new Robot(rr, color, robotID);
                robots[robotID] = new Robot(rr, color, colorBloated, robotID);
                r.AddRenderable(rr);
                r.AddRenderable(robots[robotID].PathRenderer);
                r.AddRenderable(robots[robotID].LidarRendererFront);
                r.AddRenderable(robots[robotID].LidarRendererRear);
                r.AddRenderable(robots[robotID].PolygonRenderer);
                r.AddRenderable(robots[robotID].BloatedPolygonRenderer);

                r.UpdateRobotPose(robotID, new Magic.Common.RobotPose());
            }
        }
Exemplo n.º 2
0
 public PathFromRobotRenderer(RobotRenderer rr)
 {
     renderer = rr;
     color    = Color.Salmon;
 }
Exemplo n.º 3
0
 public PathFromRobotRenderer(RobotRenderer rr, Color c)
 {
     renderer = rr;
     color    = c;
 }
Exemplo n.º 4
0
 public PathFromRobotRenderer(RobotRenderer rr, Color c, float nodeWidth)
     : this(rr, c)
 {
     this.nodeWidth = nodeWidth;
 }
Exemplo n.º 5
0
 public Robot(RobotRenderer r, Color color, Color colorBloated, int id)
 {
     renderer = r;
     pathRenderer = new PathFromRobotRenderer(r, color, .1f);
     lidarRendererRear = new LidarRenderer("rear", 0, id, new SensorPose(-.36, 0, 0, Math.PI, 0, 0, 0));
     lidarRendererFront = new LidarRenderer("front", 1, id, new SensorPose(0, 0, .20, 0, 0, 0, 0));
     polyRenderer = new PolygonRenderer(color);
     bloatedPolygonRenderer = new PolygonRenderer(colorBloated);
 }
 public PathFromRobotRenderer(RobotRenderer rr)
 {
     renderer = rr;
     color = Color.Salmon;
 }
 public PathFromRobotRenderer(RobotRenderer rr, Color c)
 {
     renderer = rr;
     color = c;
 }
 public PathFromRobotRenderer(RobotRenderer rr, Color c, float nodeWidth)
     : this(rr, c)
 {
     this.nodeWidth = nodeWidth;
 }