Skip to content

Commit 46b547d

Browse files
committed
code clean up
1 parent d86ba52 commit 46b547d

File tree

6 files changed

+12
-273
lines changed

6 files changed

+12
-273
lines changed

PathPlanning/ModelPredictiveTrajectoryGenerator/__init__.py

Whitespace-only changes.

PathPlanning/ModelPredictiveTrajectoryGenerator/model_predictive_trajectory_generator.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
from matplotrecorder import matplotrecorder
1212

1313
# optimization parameter
14-
maxiter = 100
15-
h = np.matrix([0.1, 0.001, 0.001]).T # parameter sampling distanse
14+
max_iter = 100
15+
h = np.matrix([0.5, 0.02, 0.02]).T # parameter sampling distanse
16+
cost_th = 0.1
1617

1718
matplotrecorder.donothing = True
1819
show_graph = False
@@ -102,14 +103,13 @@ def show_trajectory(target, xc, yc):
102103

103104

104105
def optimize_trajectory(target, k0, p):
105-
106-
for i in range(maxiter):
106+
for i in range(max_iter):
107107
xc, yc, yawc = motion_model.generate_trajectory(p[0], p[1], p[2], k0)
108108
dc = np.matrix(calc_diff(target, xc, yc, yawc)).T
109109
# print(dc.T)
110110

111111
cost = np.linalg.norm(dc)
112-
if cost <= 0.05:
112+
if cost <= cost_th:
113113
print("path is ok cost is:" + str(cost))
114114
break
115115

@@ -146,7 +146,6 @@ def test_optimize_trajectory():
146146

147147
show_trajectory(target, x, y)
148148
matplotrecorder.save_movie("animation.gif", 0.1)
149-
150149
# plt.plot(x, y, "-r")
151150
plot_arrow(target.x, target.y, target.yaw)
152151
plt.axis("equal")

PathPlanning/StateLatticePlanner/model_predictive_trajectory_generator.py

Lines changed: 0 additions & 183 deletions
This file was deleted.

PathPlanning/StateLatticePlanner/motion_model.py

Lines changed: 0 additions & 82 deletions
This file was deleted.

PathPlanning/StateLatticePlanner/state_lattice_planner.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
44
author: Atsushi Sakai
55
"""
6+
import sys
7+
import os
8+
9+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
10+
611
from matplotlib import pyplot as plt
712
import numpy as np
813
import math
914
import pandas as pd
10-
import model_predictive_trajectory_generator as planner
11-
import motion_model
15+
import ModelPredictiveTrajectoryGenerator.model_predictive_trajectory_generator as planner
16+
import ModelPredictiveTrajectoryGenerator.motion_model as motion_model
1217

1318

1419
def search_nearest_one_from_lookuptable(tx, ty, tyaw, lookup_table):

PathPlanning/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)