Index: code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc	(revision 10855)
+++ code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc	(revision 10856)
@@ -1120,3 +1120,27 @@
         }
     }
+    void CommonController::takeActionpoints (std::vector<Point > vector, std::vector<Point > loop, bool b)
+    {
+      this->parsedActionpoints_ = vector;
+      this->loopActionpoints_ = loop;
+      this->bLoop_ = b;
+      this->setAction (Action::NONE);
+      this->setTarget(0);
+      this->setTargetPosition (this->getControllableEntity()->getWorldPosition());
+      orxout(internal_error) << "Top action is " << this->parsedActionpoints_.back().action << endl;
+    }
+    void CommonController::boostControl()
+    {
+        SpaceShip* ship = orxonox_cast<SpaceShip*>(this->getControllableEntity());
+        if(ship == NULL) return;
+        if(ship->getBoostPower()*1.5f > ship->getInitialBoostPower() ) //upper limit ->boost
+        {
+
+            this->getControllableEntity()->boost(true);
+        }
+        else if(ship->getBoostPower()*4.0f < ship->getInitialBoostPower()) //lower limit ->do not boost
+        {
+           this->getControllableEntity()->boost(false);
+        }
+    }
 }
Index: code/branches/campaignHS15/src/orxonox/controllers/CommonController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/CommonController.h	(revision 10855)
+++ code/branches/campaignHS15/src/orxonox/controllers/CommonController.h	(revision 10856)
@@ -156,4 +156,5 @@
                 void setTargetOrientation(const Quaternion& orient);
                 void setTargetOrientation(ControllableEntity* target);
+                virtual void boostControl();
 
 
@@ -227,5 +228,7 @@
                 bool bInLoop_;
                 bool bLoop_;                   
-            //----[/"Private" variables]----               
+            //----[/"Private" variables]----    
+        virtual void takeActionpoints (std::vector<Point > vector, std::vector<Point > loop, bool b);
+           
     };
 }
Index: code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc	(revision 10855)
+++ code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc	(revision 10856)
@@ -52,5 +52,9 @@
         if (this->myFollower_)
         {
-            this->myFollower_->takeActionpoints(this->parsedActionpoints_);
+            this->myFollower_->takeActionpoints(this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_);
+        }
+        else if (this->myWingman_)
+        {
+            this->myWingman_->takeActionpoints(this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_);
         }
         for (size_t i = 0; i < this->actionpoints_.size(); ++i)
@@ -82,35 +86,4 @@
     {
         CommonController::stayNearProtect();
-    }
-    void DivisionController::setTargetPositionOfWingman()
-    {
-        if (!this->myWingman_)
-            return;
-        Vector3* targetRelativePositionOfWingman;
-        switch (this->formationMode_){
-            case FormationMode::WALL:
-            {
-                targetRelativePositionOfWingman = new Vector3 (400, 0, 0);  
-                break;
-            }
-            case FormationMode::FINGER4: 
-            {
-                targetRelativePositionOfWingman = new Vector3 (400, 0, 200);  
-                break;
-            }
-         
-            case FormationMode::DIAMOND: 
-            {
-                targetRelativePositionOfWingman = new Vector3 (400, 0, 200);                  
-                break;
-            }
-        }
-        Quaternion orient = this->getControllableEntity()->getWorldOrientation();
-        
-        Vector3 targetAbsolutePositionOfWingman = ((this->getControllableEntity()->getWorldPosition()) + 
-        (this->getControllableEntity()->getWorldOrientation()* (*targetRelativePositionOfWingman)));
-        
-        myWingman_->setAction( Action::FLY, targetAbsolutePositionOfWingman, orient);
-       
     }
     
Index: code/branches/campaignHS15/src/orxonox/controllers/DivisionController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/DivisionController.h	(revision 10855)
+++ code/branches/campaignHS15/src/orxonox/controllers/DivisionController.h	(revision 10856)
@@ -56,6 +56,4 @@
                 virtual bool hasWingman();
                 virtual bool hasFollower();
-
-                void setTargetPositionOfWingman();
                 
             //----[/own functions]----
Index: code/branches/campaignHS15/src/orxonox/controllers/LeaderController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/LeaderController.cc	(revision 10855)
+++ code/branches/campaignHS15/src/orxonox/controllers/LeaderController.cc	(revision 10856)
@@ -51,12 +51,5 @@
     {
     }
-    void LeaderController::takeActionpoints (std::vector<Point > vector)
-    {
-      this->parsedActionpoints_ = vector;
-      this->setAction (Action::NONE);
-      this->setTarget(0);
-      this->setTargetPosition (this->getControllableEntity()->getWorldPosition());
-      orxout(internal_error) << "Top action is " << this->parsedActionpoints_.back().action << endl;
-    }
+    
 
 
Index: code/branches/campaignHS15/src/orxonox/controllers/LeaderController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/LeaderController.h	(revision 10855)
+++ code/branches/campaignHS15/src/orxonox/controllers/LeaderController.h	(revision 10856)
@@ -53,5 +53,4 @@
                     { return true; }
             //----[/pseudo virtual methods]----
-                virtual void takeActionpoints (std::vector<Point > vector);
 
 
Index: code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc	(revision 10855)
+++ code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc	(revision 10856)
@@ -51,4 +51,8 @@
     SectionController::~SectionController()
     {
+        if (this->myWingman_)
+        {
+            this->myWingman_->takeActionpoints(this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_);
+        }
        for (size_t i = 0; i < this->actionpoints_.size(); ++i)
         {
@@ -151,18 +155,5 @@
     }
 
-    void SectionController::boostControl()
-    {
-        SpaceShip* ship = orxonox_cast<SpaceShip*>(this->getControllableEntity());
-        if(ship == NULL) return;
-        if(ship->getBoostPower()*1.5f > ship->getInitialBoostPower() ) //upper limit ->boost
-        {
-
-            this->getControllableEntity()->boost(true);
-        }
-        else if(ship->getBoostPower()*4.0f < ship->getInitialBoostPower()) //lower limit ->do not boost
-        {
-           this->getControllableEntity()->boost(false);
-        }
-    }
+    
     //PRE: myDivisionLeader_ != 0 && myDivisionLeader_->action_ == Action::FIGHT
     //POST: this->target_ is set unless division leader doesn't have one
@@ -250,36 +241,5 @@
     }
 
-    //----stay in formation----
-    //gani-TODO: sum targetAbso... and this->predicted position 
-    void SectionController::setTargetPositionOfWingman()
-    {
-        if (!this->myWingman_)
-            return;
-        Vector3* targetRelativePositionOfWingman;
-        switch (this->formationMode_){
-            case FormationMode::WALL:
-            {
-                targetRelativePositionOfWingman = new Vector3 (-400, 0, 0);  
-                break;
-            }
-            case FormationMode::FINGER4: 
-            {
-                targetRelativePositionOfWingman = new Vector3 (-400, 0, 200);  
-                break;
-            }
-            case FormationMode::DIAMOND: 
-            {
-                targetRelativePositionOfWingman = new Vector3 (400, -200, 0);                  
-                break;
-            }
-        }
-        Quaternion orient = this->getControllableEntity()->getWorldOrientation();
-        
-        Vector3 targetAbsolutePositionOfWingman = ((this->getControllableEntity()->getWorldPosition()) + 
-        (this->getControllableEntity()->getWorldOrientation()* (*targetRelativePositionOfWingman)));
-        
-        myWingman_->setAction (Action::FLY, targetAbsolutePositionOfWingman, orient);
-       
-    }
+    
 
     LeaderController* SectionController::findNewDivisionLeader()
Index: code/branches/campaignHS15/src/orxonox/controllers/SectionController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/SectionController.h	(revision 10855)
+++ code/branches/campaignHS15/src/orxonox/controllers/SectionController.h	(revision 10856)
@@ -52,5 +52,4 @@
             //----[own functions]----
                 LeaderController* findNewDivisionLeader();
-                void setTargetPositionOfWingman();
 
                 virtual bool setWingman(CommonController* cwingman);
@@ -64,5 +63,4 @@
                 virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour.
                 Vector3 getFormationPosition ();
-                void boostControl();
         private:
             //----private variables-----
Index: code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10855)
+++ code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc	(revision 10856)
@@ -96,5 +96,55 @@
         else if (this->myLeader_)
         {
-
+            switch (this->myLeader_->getAction())
+            {
+                // case Action::FLY:
+                // {
+                //     // Vector3 targetRelativePosition = getFormationPosition();
+                //     // Quaternion orient = 
+                //     //     this->myDivisionLeader_->getControllableEntity()->getWorldOrientation();
+                //     // Vector3 targetAbsolutePosition = 
+                //     //     ((this->myDivisionLeader_->getControllableEntity()->getWorldPosition()) + 
+                //     //         (orient* (targetRelativePosition)));
+                //     // this->setAction (Action::FLY, targetAbsolutePosition, orient);
+                //     break;
+                // }
+                // case Action::FIGHT:
+                // {
+
+                //     // this->setAction (Action::FLY, targetAbsolutePosition, orient);
+                //     break;
+                // }
+                default:
+                {
+                    ControllableEntity* myEntity = this->getControllableEntity();
+                    Vector3 myPosition = myEntity->getWorldPosition();
+                    if (!this->myLeader_)
+                    {
+                        return;
+                    }
+                    ControllableEntity* leaderEntity = this->myLeader_->getControllableEntity();
+                    Quaternion orient = leaderEntity->getWorldOrientation();
+                    Vector3 leaderPosition = leaderEntity->getWorldPosition();
+
+                    Vector3 targetRelativePosition = getFormationPosition();
+                    if (!this->myLeader_)
+                    {
+                        return;
+                    }
+                    Vector3 targetAbsolutePosition = 
+                        (leaderPosition + (orient*WorldEntity::FRONT) * (leaderEntity->getVelocity().length()/5)
+                         + (orient* (targetRelativePosition)));
+               
+                    this->setAction (Action::FLY, targetAbsolutePosition, orient);
+                    if ((targetAbsolutePosition - myPosition).length() > this->tolerance_ * 1.5f)
+                    {
+                        this->boostControl();
+                    }
+                    else
+                    {
+                       this->getControllableEntity()->boost(false);
+                    }
+                }
+            }
         }
         
@@ -102,5 +152,52 @@
      
    
-    
+    Vector3 WingmanController::getFormationPosition ()
+    {
+        this->setFormationMode( this->myLeader_->getFormationMode() );
+        Vector3* targetRelativePosition;
+
+        if (this->myLeader_->getRank() == Rank::DIVISIONLEADER)
+        {
+            switch (this->formationMode_){
+                case FormationMode::WALL:
+                {
+                    targetRelativePositionOfWingman = new Vector3 (400, 0, 0);  
+                    break;
+                }
+                case FormationMode::FINGER4: 
+                {
+                    targetRelativePositionOfWingman = new Vector3 (400, 0, 200);  
+                    break;
+                }
+                case FormationMode::DIAMOND: 
+                {
+                    targetRelativePositionOfWingman = new Vector3 (400, 0, 200);                  
+                    break;
+                }
+            }
+        }
+        else
+        {
+            switch (this->formationMode_){
+                case FormationMode::WALL:
+                {
+                    targetRelativePositionOfWingman = new Vector3 (-400, 0, 0);  
+                    break;
+                }
+                case FormationMode::FINGER4: 
+                {
+                    targetRelativePositionOfWingman = new Vector3 (-400, 0, 200);  
+                    break;
+                }
+                case FormationMode::DIAMOND: 
+                {
+                    targetRelativePositionOfWingman = new Vector3 (400, -200, 0);                  
+                    break;
+                }
+            }
+        }
+        
+        return *targetRelativePosition;
+    }
     //----POST: closest leader that is ready to take a new wingman is returned----
     CommonController* WingmanController::findNewLeader()
Index: code/branches/campaignHS15/src/orxonox/controllers/WingmanController.h
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/WingmanController.h	(revision 10855)
+++ code/branches/campaignHS15/src/orxonox/controllers/WingmanController.h	(revision 10856)
@@ -58,4 +58,5 @@
             //----action must only be managed by this----
                 virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour.
+                Vector3 getFormationPosition ();
 
         private:
