From bc79d02eba4d844c839185ba98ebc9b8e67f5929 Mon Sep 17 00:00:00 2001 From: Atsushi Sakai Date: Fri, 12 Jan 2018 21:50:44 -0800 Subject: [PATCH] add test --- .../frenet_optimal_trajectory.py | 7 ++++--- README.md | 8 +++++--- tests/test_frenet_optimal_trajectory.py | 15 +++++++++++++++ tests/{test_rrtdubins.py => test_rrt_dubins.py} | 0 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 tests/test_frenet_optimal_trajectory.py rename tests/{test_rrtdubins.py => test_rrt_dubins.py} (100%) diff --git a/PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py b/PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py index fed59db0..3957df90 100644 --- a/PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py +++ b/PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py @@ -333,9 +333,10 @@ def main(): plt.pause(0.0001) print("Finish") - plt.grid(True) - plt.pause(0.0001) - plt.show() + if show_animation: + plt.grid(True) + plt.pause(0.0001) + plt.show() if __name__ == '__main__': diff --git a/README.md b/README.md index a8348cc1..84a62a00 100644 --- a/README.md +++ b/README.md @@ -350,15 +350,16 @@ Ref: - [ghliu/pyReedsShepp: Implementation of Reeds Shepp curve\.](https://github.com/ghliu/pyReedsShepp) -## Frenet Optimal Trajectory +## Optimal Trajectory in a Frenet Frame ![3](https://github.com/AtsushiSakai/PythonRobotics/blob/master/PathPlanning/FrenetOptimalTrajectory/animation.gif) -It is a optimal trajectory generation on Frenet Frame. +It is a optimal trajectory generation in a Frenet Frame. -The cyan line is target course and black crosses are obstacles. +The cyan line is the target course and black crosses are obstacles. The red line is predicted path. +   Ref: @@ -367,6 +368,7 @@ Ref: - [Optimal trajectory generation for dynamic street scenarios in a Frenet Frame](https://www.youtube.com/watch?v=Cj6tAQe7UCY) + ## Mix Integer Optimization based model predictive planning and control ![2](https://github.com/AtsushiSakai/PythonRobotics/blob/master/PathPlanning/MixIntegerPathPlanning/animation.gif) diff --git a/tests/test_frenet_optimal_trajectory.py b/tests/test_frenet_optimal_trajectory.py new file mode 100644 index 00000000..4e154809 --- /dev/null +++ b/tests/test_frenet_optimal_trajectory.py @@ -0,0 +1,15 @@ +from unittest import TestCase + +import sys +sys.path.append("./PathPlanning/FrenetOptimalTrajectory/") + +from PathPlanning.FrenetOptimalTrajectory import frenet_optimal_trajectory as m + +print(__file__) + + +class Test(TestCase): + + def test1(self): + m.show_animation = False + m.main() diff --git a/tests/test_rrtdubins.py b/tests/test_rrt_dubins.py similarity index 100% rename from tests/test_rrtdubins.py rename to tests/test_rrt_dubins.py