]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/blobdiff - decision_control/slotplanner.cc
Generalize sampling info
[hubacji1/iamcar.git] / decision_control / slotplanner.cc
index 4b80a17f876447841cf19c6e41ea6d5312612468..fb1b868eabbd09bfd13207152ededfc1bfe4b99f 100644 (file)
@@ -489,9 +489,13 @@ struct SamplingInfo ParallelSlot::getSamplingInfo()
         }
         si.r = CC->diag_radi();
         si.sh = this->slotHeading();
-        si.h = this->slotHeading() - acos(EDIST( // TODO generalize
-                this->slot().bnodes()[0],
-                this->slot().bnodes()[1]
-        ) / BCAR_LENGTH);
+        if (this->slotType() == PARALLEL) {
+                si.h = this->slotHeading() - acos(EDIST(
+                        this->slot().bnodes()[0],
+                        this->slot().bnodes()[1]
+                ) / BCAR_LENGTH);
+        } else {
+                si.h = M_PI /2;
+        }
         return si;
 }