]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/commitdiff
When path not found, do not optimize it
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Tue, 24 Aug 2021 07:50:54 +0000 (09:50 +0200)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Tue, 24 Aug 2021 08:17:25 +0000 (10:17 +0200)
Reseting ogoal_cc and otime is not desired as the original path is the
first path found (even with reset.)

src/rrtext13.cc

index 8c5a45108df68589fcc406befe52416ef57a0fa7..602788674d2f4dc5d20d573b4abae51e00cca122 100644 (file)
@@ -138,6 +138,9 @@ void
 RRTExt13::compute_path()
 {
        RRTS::compute_path();
+       if (this->goal_.cc() == 0.0 || this->path_.size() == 0) {
+               return;
+       }
 #if 0 // TODO 0.59 should work for sc4-1-0 only.
        if (this->goal_.cc() * 0.59 > this->last_goal_cc_
                        && this->last_goal_cc_ != 0.0) {
@@ -199,8 +202,6 @@ RRTExt13::reset()
 {
        RRTS::reset();
        this->opath_.clear();
-       this->ogoal_cc_ = 0.0;
-       this->otime_ = 0.0;
 }
 
 } // namespace rrts