Skip to content

Commit 895e3ab

Browse files
committed
fix lookuptable_generator.py
1 parent 20746c4 commit 895e3ab

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

PathPlanning/ModelPredictiveTrajectoryGenerator/lookuptable_generator.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
"""
2+
23
Lookup Table generation for model predictive trajectory generator
34
45
author: Atsushi Sakai
6+
57
"""
68
from matplotlib import pyplot as plt
79
import numpy as np
@@ -14,7 +16,7 @@
1416
def calc_states_list():
1517
maxyaw = np.deg2rad(-30.0)
1618

17-
x = np.arange(1.0, 30.0, 5.0)
19+
x = np.arange(10.0, 30.0, 5.0)
1820
y = np.arange(0.0, 20.0, 2.0)
1921
yaw = np.arange(-maxyaw, maxyaw, maxyaw)
2022

@@ -23,7 +25,7 @@ def calc_states_list():
2325
for iy in y:
2426
for ix in x:
2527
states.append([ix, iy, iyaw])
26-
# print(len(states))
28+
print("nstate:", len(states))
2729

2830
return states
2931

@@ -75,8 +77,8 @@ def generate_lookup_table():
7577
state[0], state[1], state[2], lookuptable)
7678

7779
target = motion_model.State(x=state[0], y=state[1], yaw=state[2])
78-
init_p = np.matrix(
79-
[math.sqrt(state[0] ** 2 + state[1] ** 2), bestp[4], bestp[5]]).T
80+
init_p = np.array(
81+
[math.sqrt(state[0] ** 2 + state[1] ** 2), bestp[4], bestp[5]]).reshape(3, 1)
8082

8183
x, y, yaw, p = planner.optimize_trajectory(target, k0, init_p)
8284

0 commit comments

Comments
 (0)