size() method return value with type size_t, which is an unsigned type. When kf.lidar_uncertainty[num].size() == 0, kf.lidar_uncertainty[num].size() - 1 overflows, leading this expression to a very large number (e.g. 2^64-1). This might make the loop executes wrongly. A forced typecasting will fix this problem.
size() method return value with type size_t, which is an unsigned type. When kf.lidar_uncertainty[num].size() == 0, kf.lidar_uncertainty[num].size() - 1 overflows, leading this expression to a very large number (e.g. 2^64-1). This might make the loop executes wrongly. A forced typecasting will fix this problem.