Ejemplo n.º 1
0
 public bool checkWater(int botPosX, int botPosY, Premises premises)
 {
     if (premises.returnUnderground(botPosX, botPosY).GetType() == typeof(Water))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Lass wen retten");

            //Test
            Premises premises = new Premises(22, 20);

            object[,] map = premises.generateMap();

            RescueBot rescueBot = new RescueBot(premises.returnStartingPosition()[0], premises.returnStartingPosition()[1], premises);

            // Start navigation oder so

            // Bot ground movement Test // --> Works!!!

            /*
             * rescueBot.updateSurroundings();
             * Console.WriteLine("PosY{0}, PosX{1}",rescueBot.positionY,rescueBot.positionX);
             * rescueBot.driveForward();
             * Console.WriteLine("Bot Pos : {0}", rescueBot.returnXpos());
             * rescueBot.updateSurroundings();
             * Console.WriteLine("PosY{0}, PosX{1}",rescueBot.positionY,rescueBot.positionX);
             * rescueBot.driveForward();
             * Console.WriteLine("Bot Pos : {0}", rescueBot.returnXpos());
             * rescueBot.updateSurroundings();
             * Console.WriteLine("PosY{0}, PosX{1}",rescueBot.positionY,rescueBot.positionX);
             * rescueBot.driveForward();
             * Console.WriteLine("Bot Pos : {0}", rescueBot.returnXpos());
             * rescueBot.updateSurroundings();
             * Console.WriteLine("PosY{0}, PosX{1}",rescueBot.positionY,rescueBot.positionX);
             * rescueBot.driveForward();
             * Console.WriteLine("Bot Pos : {0}", rescueBot.returnXpos());
             * rescueBot.updateSurroundings();
             * Console.WriteLine("PosY{0}, PosX{1}",rescueBot.positionY,rescueBot.positionX);
             * rescueBot.driveForward();
             * Console.WriteLine("Bot Pos : {0}", rescueBot.returnXpos());
             * rescueBot.updateSurroundings();
             * Console.WriteLine("PosY{0}, PosX{1}",rescueBot.positionY,rescueBot.positionX);
             * rescueBot.driveForward();
             */

            // TODO:
            // Navigations algorithmus
            // Automatisches aufsammeln von passenden gegenständen
            // wenn sie sich links, rechts, vor oder hinter dem fahrzeug befinden
            // entfernen der gegenstände auf der Karte                              DONE
            // Bot auf der Karte anzeigen
            // Bot auf der Karte bewegen

            rescueBot.startNavigation(rescueBot);
        }
Ejemplo n.º 3
0
        public Ground[] detectSourroundings(int botPosX, int botPosY, Premises premises)
        {
            // 0 = current, 1 = left, 2 = right, 3 = behind, 4 = infront
            // Cast the objects to Ground Objects
            Ground[] sourroundings = new Ground[5];

            sourroundings[0] = (Ground)premises.returnUnderground(botPosX, botPosY);
            sourroundings[1] = (Ground)premises.returnUnderground(botPosX - 1, botPosY);
            sourroundings[2] = (Ground)premises.returnUnderground(botPosX + 1, botPosY);
            sourroundings[3] = (Ground)premises.returnUnderground(botPosX, botPosY + 1);
            sourroundings[4] = (Ground)premises.returnUnderground(botPosX, botPosY - 1);

            return(sourroundings);
        }
Ejemplo n.º 4
0
        // Der bot sollte noch eine Eigene Karte haben die er zur laufzeit erstellt um den weg zurück zu finden.
        public RescueBot(int posX, int posY, Premises premises)
        {
            this.premises = premises;

            this.positionX      = posX;
            this.positionY      = posY;
            this.startPositionX = posX;
            this.startPositionY = posY;
            Console.WriteLine("Rescue Bot generated at X:{0}, Y:{1}", this.positionX, this.positionY);

            // Motoren innerhalöb des Bauteils Initialisieren
            this.motorChainDriveLeft  = new Motor(100, "ChainDriveLeft", false, 0, 0);
            this.motorChainDriveRight = new Motor(100, "ChainDriveRight", false, 0, 0);
            this.turbine = new Motor(100, "Turbine", false, 0, 0);
            this.rudder  = new Motor(100, "Rudder", false, 0, 100);

            // Initilise Grappler and support
            this.grappler = new Grappler();
            this.support  = new Support();



            this.currentLoad = 0;

            this.boxCover = new BoxCover();

            // Kommunikation-Subsystem:
            this.camera      = new Camera();
            this.microphon   = new Microphon();
            this.loudspeaker = new Loudspeaker();

            this.capacitySensor = new CapacitySensor();

            //Objektbergung-Subsystem:
            this.lidar  = new LIDARSensor();
            this.geiger = new GeigerCounter();

            // Navigation-Subsystem:
            this.navigation = new Navigation();

            //Signalverfolgung-Subsystem:
            this.leftAntenna     = new LeftAntenna();
            this.rightAntenna    = new RightAntenna();
            this.backsideAntenna = new BacksideAntenna();
        }
Ejemplo n.º 5
0
 public int[,] getSignal(Premises premises)
 {
     int[,] allmessages = new int[3, 3];
     allmessages        = premises.radioTowersSend();
     return(allmessages);
 }