/* if only one sonar, write it to the original distance parameter so that it's still used as altitude sonar */
if(addr_ind.size()==1){
report.distance=si_units;
report.distance_vector[0]=si_units;
for(unsignedi=1;i<(SRF02_MAX_RANGEFINDERS);i++){
report.distance_vector[i]=0;
}
report.just_updated=0;
}else{
/* for multiple sonars connected */
/* don't use the original single sonar variable */
report.distance=0;
/* intermediate vector _latest_sonar_measurements is used to store the measurements as every cycle the other sonar values of the report are thrown away and/or filled in with garbage. We don't want this. We want the report to give the latest value for each connected sonar */
/* a just_updated variable is added to indicate to autopilot (ardupilot or whatever) which sonar has most recently been collected as this could be of use for Kalman filters */
report.just_updated=_index_counter;
/* Make sure all elements of the distance vector for which no sonar is connected are zero to prevent strange numbers */