]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/blobdiff - src/rrtext6.cc
Update self source file with license
[hubacji1/rrts.git] / src / rrtext6.cc
index 0f4c35fde42250e8e19a310bef9e29e93007ae6b..2abf77a11dc958e60060c52998cf2fb7793d71f9 100644 (file)
@@ -1,18 +1,27 @@
-#include "rrtext.h"
+/*
+ * SPDX-FileCopyrightText: 2021 Jiri Vlasak <jiri.vlasak.2@cvut.cz>
+ *
+ * SPDX-License-Identifier: GPL-3.0-only
+ */
+
+#include "rrtext.hh"
 #include "reeds_shepp.h"
 
-double RRTExt6::cost_build(RRTNode &f, RRTNode &t)
+namespace rrts {
+
+double
+RRTExt6::cost_build(RRTNode const& f, RRTNode const& t) const
 {
-        double q0[] = {f.x(), f.y(), f.h()};
-        double q1[] = {t.x(), t.y(), t.h()};
-        ReedsSheppStateSpace rsss(this->bc.mtr());
-        return rsss.distance(q0, q1);
+       double q0[] = {f.x(), f.y(), f.h()};
+       double q1[] = {t.x(), t.y(), t.h()};
+       ReedsSheppStateSpace rsss(this->bc_.mtr());
+       return rsss.distance(q0, q1);
 }
 
-double RRTExt6::cost_search(RRTNode &f, RRTNode &t)
+double
+RRTExt6::cost_search(RRTNode const& f, RRTNode const& t) const
 {
-        double q0[] = {f.x(), f.y(), f.h()};
-        double q1[] = {t.x(), t.y(), t.h()};
-        ReedsSheppStateSpace rsss(this->bc.mtr());
-        return rsss.distance(q0, q1);
+       return this->cost_build(f, t);
 }
+
+} // namespace rrts