Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8791 for code/branches


Ignore:
Timestamp:
Jul 26, 2011, 11:41:45 PM (13 years ago)
Author:
jo
Message:

Bug is triggered in AIController.cc @ line 243. Can't find the reason at the moment.

Location:
code/branches/ai2/src/orxonox/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai2/src/orxonox/controllers/AIController.cc

    r8786 r8791  
    120120
    121121            // update Checkpoints
    122             random = rnd(maxrand);
     122            /*random = rnd(maxrand);
    123123            if (this->defaultWaypoint_ && random > (maxrand-10))
    124124                this->manageWaypoints();
    125             else //if(random > maxrand-10) //CHECK USABILITY!!
     125            else //if(random > maxrand-10) //CHECK USABILITY!!*/
     126            if (this->waypoints_.size() == 0 )
    126127                this->manageWaypoints();
    127128
     
    214215
    215216                // update Checkpoints
    216                 random = rnd(maxrand);
     217                /*random = rnd(maxrand);
    217218                if (this->defaultWaypoint_ && random > (maxrand-10))
    218219                    this->manageWaypoints();
    219                 else //if(random > maxrand-10) //CHECK USABILITY!!
     220                else //if(random > maxrand-10) //CHECK USABILITY!!*/
     221                if (this->waypoints_.size() == 0 )
    220222                    this->manageWaypoints();
    221223            }
     
    237239            if (this->waypoints_.size() > 0 ) //Waypoint functionality.
    238240            {
    239                 if (this->waypoints_[this->waypoints_.size()-1]->getWorldPosition().squaredDistance(controllable->getPosition()) <= this->squaredaccuracy_)
     241                WorldEntity* wPoint = this->waypoints_[this->waypoints_.size()-1];
     242                if(wPoint)
     243                    this->moveToPosition(wPoint->getWorldPosition()); //BUG ?? sometime wPoint->getWorldPosition() causes crash
     244                if (wPoint->getWorldPosition().squaredDistance(controllable->getPosition()) <= this->squaredaccuracy_)
    240245                    this->waypoints_.pop_back(); // if goal is reached, remove it from the list
    241                 if(this->waypoints_.size() > 0 )
    242                     this->moveToPosition(this->waypoints_[this->waypoints_.size()-1]->getWorldPosition());
     246
    243247            }
    244248            else if(this->defaultWaypoint_ && ((this->defaultWaypoint_->getPosition()-controllable->getPosition()).length()  > 200.0f))
  • code/branches/ai2/src/orxonox/controllers/ArtificialController.cc

    r8786 r8791  
    9696        this->timeout_ = 0;
    9797        this->currentWaypoint_ = 0;
    98         this->setAccuracy(9);
     98        this->setAccuracy(5);
    9999        this->defaultWaypoint_ = NULL;
    100100    }
Note: See TracChangeset for help on using the changeset viewer.