Hello Team,
I have some issues with planning the motion of the ego vehicle. When I try to run commonRoad_io Tutorial 2 Exercise 4, an error occurs:
constr.append(x[0, k + 1] <= s_max[k])
IndexError: list index out of range
It seems the problem originates in the following lines
for o in dyn_obstacles:
if o.initial_state.position[0] < x_0[0]:
[...]
prediction = o.prediction.trajectory.state_list
for p in prediction:
s_min.append(p.position[0] + o.obstacle_shape.length/2. + 2.5)
else:
[...]
prediction = o.prediction.trajectory.state_list
for p in prediction:
s_max.append(p.position[0] - o.obstacle_shape.length/2. - 2.5)
where prediction is evaluated for both following and leading vehicle. However, it seems like the line
prediction = o.prediction.trajectory.state_list
does not generate output of the same length in both cases, as suggested by evaluating the sizes of s_min and s_max:
npy.shape(s_min)
(40,)
npy.shape(s_max)
(39,)
Is there a reason why the prediction of the leading vehicle is missing one time step? I hope I didnt miss anything important, thanks in advance for your answer!