what is the intent of this loop ?
// 200 readings, from right to left, from -57 to 57 degress
// calculate new velocity cmd
float min = 10;
float current;
for (int i = 0; i < 200; i++) {
current = data1;
if (current < min) {
min = current;
}
}
- The included comment is false
- Since data1 = _msg->ranges[0] and is provided by the call back of the subscriber to the laser scan it is looking this look is only to increase the chance that the laser scan value be below the “succes” thresold by sampling any updated value during the loop execution