[ARDrone] Use ++var instead of var++ if possible
This commit is contained in:
parent
b2b24ed551
commit
7ce171b2ef
|
@ -229,7 +229,7 @@ int main(int argc, char *argv[])
|
||||||
share_relatif_cons.y) ;
|
share_relatif_cons.y) ;
|
||||||
//printf("[DEBUG] Vitesse %f Angle %f state %d\n",speed_pitch, angle,state_flying);
|
//printf("[DEBUG] Vitesse %f Angle %f state %d\n",speed_pitch, angle,state_flying);
|
||||||
}
|
}
|
||||||
i_consigne++;
|
++i_consigne ;
|
||||||
}
|
}
|
||||||
fclose(log);
|
fclose(log);
|
||||||
cmd_drone_landing();
|
cmd_drone_landing();
|
||||||
|
@ -307,7 +307,7 @@ void traficGPS(int gps) {
|
||||||
length=y-1;
|
length=y-1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
y++;
|
++y ;
|
||||||
}
|
}
|
||||||
//printf("\nTaille finale : %d\n", length);
|
//printf("\nTaille finale : %d\n", length);
|
||||||
|
|
||||||
|
@ -326,10 +326,10 @@ void traficGPS(int gps) {
|
||||||
y - offset_line) ;
|
y - offset_line) ;
|
||||||
data[ct_string][y-offset_line]=0;
|
data[ct_string][y-offset_line]=0;
|
||||||
}
|
}
|
||||||
ct_string++;
|
++ct_string ;
|
||||||
offset_line=y+1;
|
offset_line=y+1;
|
||||||
}
|
}
|
||||||
y++;
|
++y ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(ct_string==0 || offset_line==0))
|
if(!(ct_string==0 || offset_line==0))
|
||||||
|
@ -469,7 +469,7 @@ void* thread_control(void* NULL_value)
|
||||||
array_cons[num_point].lat = share_gps_cons.lat;
|
array_cons[num_point].lat = share_gps_cons.lat;
|
||||||
array_cons[num_point].lon = share_gps_cons.lon;
|
array_cons[num_point].lon = share_gps_cons.lon;
|
||||||
array_cons[num_point].alt = share_gps_cons.alt;
|
array_cons[num_point].alt = share_gps_cons.alt;
|
||||||
num_point++;
|
++num_point ;
|
||||||
printf("[Consigne %d point défini]\n", num_point);
|
printf("[Consigne %d point défini]\n", num_point);
|
||||||
}
|
}
|
||||||
else if (strcmp(cmd, "SendSetpoint")==0) {
|
else if (strcmp(cmd, "SendSetpoint")==0) {
|
||||||
|
@ -546,7 +546,7 @@ void parse_main_options(int argc, char **argv)
|
||||||
// Take the optind value:
|
// Take the optind value:
|
||||||
options.listening_port =
|
options.listening_port =
|
||||||
strtoul(argv[optind], NULL, 0) ;
|
strtoul(argv[optind], NULL, 0) ;
|
||||||
optind++ ;
|
++optind ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break ;
|
break ;
|
||||||
|
@ -854,7 +854,7 @@ void string2data(char* string_data)
|
||||||
break ;
|
break ;
|
||||||
}
|
}
|
||||||
sscanf(ptr, "%ld", ×tamp.tv_nsec) ;
|
sscanf(ptr, "%ld", ×tamp.tv_nsec) ;
|
||||||
onetime++;
|
++onetime ;
|
||||||
}
|
}
|
||||||
result results[10];
|
result results[10];
|
||||||
|
|
||||||
|
@ -959,11 +959,11 @@ void string2data(char* string_data)
|
||||||
results[count_algo].err = atof(ptr) ;
|
results[count_algo].err = atof(ptr) ;
|
||||||
|
|
||||||
|
|
||||||
count_algo++;
|
++count_algo ;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
count_algo++;
|
++count_algo ;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (count_print = 0 ; count_print < count_algo ; ++count_print)
|
for (count_print = 0 ; count_print < count_algo ; ++count_print)
|
||||||
|
@ -1201,7 +1201,7 @@ int cmd_drone_move(float speed_pitch, int angle)
|
||||||
sprintf(sendline, "AT*PCMD=%d,1,0,%d,0,%d\r",
|
sprintf(sendline, "AT*PCMD=%d,1,0,%d,0,%d\r",
|
||||||
i, *floatint_speed_pitch, *floatint_speed_yaw) ;
|
i, *floatint_speed_pitch, *floatint_speed_yaw) ;
|
||||||
//printf("%s\n", sendline);
|
//printf("%s\n", sendline);
|
||||||
i++;
|
++i ;
|
||||||
sendto(sockcmdfd,sendline,strlen(sendline),0,
|
sendto(sockcmdfd,sendline,strlen(sendline),0,
|
||||||
(struct sockaddr *)&servcmd,sizeof(servcmd));
|
(struct sockaddr *)&servcmd,sizeof(servcmd));
|
||||||
//printf("[ATPCMD] pitch : %f yaw : %f\n", speed_pitch, speed_yaw);
|
//printf("[ATPCMD] pitch : %f yaw : %f\n", speed_pitch, speed_yaw);
|
||||||
|
@ -1290,7 +1290,7 @@ void* drone_socket_watchdog(void* NULL_value)
|
||||||
strncat(sendline, LANDING, LENSTR);
|
strncat(sendline, LANDING, LENSTR);
|
||||||
strncat(sendline, "\r", LENSTR);
|
strncat(sendline, "\r", LENSTR);
|
||||||
}
|
}
|
||||||
i++;
|
++i ;
|
||||||
if(i>=101)
|
if(i>=101)
|
||||||
{
|
{
|
||||||
strncat(sendline, "AT*COMWDG=", LENSTR);
|
strncat(sendline, "AT*COMWDG=", LENSTR);
|
||||||
|
|
Loading…
Reference in New Issue