ReadingLaser code interpretation

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;
  }
}
  1. The included comment is false
  2. 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

Thanks for the feedback. Could you please tell us where we have this code? What unit and what section?

Hello @fgenestcvdl ,

I’ve been reviewing the code and it seems to me that loop is doing nothing. Therefore, I have removed it. Many thanks for your feedback.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.