@@ -105,12 +105,13 @@ def calc_next_node(current, steer, direction, config, ox, oy, kd_tree):
105105 x , y , yaw = current .x_list [- 1 ], current .y_list [- 1 ], current .yaw_list [- 1 ]
106106
107107 arc_l = XY_GRID_RESOLUTION * 1.5
108- x_list , y_list , yaw_list = [], [], []
108+ x_list , y_list , yaw_list , direction_list = [], [], [], []
109109 for _ in np .arange (0 , arc_l , MOTION_RESOLUTION ):
110110 x , y , yaw = move (x , y , yaw , MOTION_RESOLUTION * direction , steer )
111111 x_list .append (x )
112112 y_list .append (y )
113113 yaw_list .append (yaw )
114+ direction_list .append (direction == 1 )
114115
115116 if not check_car_collision (x_list , y_list , yaw_list , ox , oy , kd_tree ):
116117 return None
@@ -134,7 +135,7 @@ def calc_next_node(current, steer, direction, config, ox, oy, kd_tree):
134135 cost = current .cost + added_cost + arc_l
135136
136137 node = Node (x_ind , y_ind , yaw_ind , d , x_list ,
137- y_list , yaw_list , [ d ] ,
138+ y_list , yaw_list , direction_list ,
138139 parent_index = calc_index (current , config ),
139140 cost = cost , steer = steer )
140141
0 commit comments