]> rtime.felk.cvut.cz Git - hubacji1/path-to-traj.git/commitdiff
Fix plot for various wheel angles in path
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Mon, 27 Mar 2023 11:44:39 +0000 (13:44 +0200)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Mon, 27 Mar 2023 11:44:39 +0000 (13:44 +0200)
plot.py

diff --git a/plot.py b/plot.py
index d76c2a3047589225ff43003517e0895a00b93235..5339e9934284ecc08a0cb02969483615143842e0 100755 (executable)
--- a/plot.py
+++ b/plot.py
@@ -733,7 +733,11 @@ if __name__ == "__main__":
         i = 0
         for p in scenario["path"]:
             if len(p) > 5:
-                pc = {36: "red", 0: "blue", -36: "green"}
+                pc = "blue"
+                if p[4] > 0:
+                    pc = "red"
+                elif p[4] < 0:
+                    pc = "green"
                 pm = "o" if p[5] else "+"
                 plt.plot(p[0] - MINX, p[1] - MINY, color=pc[p[4]], marker=pm)
                 #plt.plot(*plot_car(p), color="blue")