Hi,
I find that there is a bug in DelayedDynamics.get_commands_at. Namely, it seems it causes the out-of-range issue when idx == len(a).
|
if idx > 0 and (idx == len(a) or math.fabs(t - a[idx - 1]) < math.fabs(t - a[idx])): |
|
return idx, a[idx], self.commands[idx - 1] |
I guess it should be a[idx-1] when idx == len(a). However, I am not sure if it is OK to simply replace this part with return idx, a[idx], self.commands[idx - 1] or we need another elsif to split the case of idx == len(a) and math.fabs(t - a[idx - 1]) < math.fabs(t - a[idx]).
Hi,
I find that there is a bug in
DelayedDynamics.get_commands_at. Namely, it seems it causes the out-of-range issue whenidx == len(a).duckietown-world/src/duckietown_world/world_duckietown/dynamics_delay.py
Lines 61 to 62 in 407018e
I guess it should be
a[idx-1]whenidx == len(a). However, I am not sure if it is OK to simply replace this part withreturn idx, a[idx], self.commands[idx - 1]or we need anotherelsifto split the case ofidx == len(a)andmath.fabs(t - a[idx - 1]) < math.fabs(t - a[idx]).