diff --git a/confPos.plt b/confPos.plt index 65dd45720eb41979c5ebfc1ff212b669de5c6255..19ef03cd4479d15bde10fa6e739f74939016e6dd 100644 --- a/confPos.plt +++ b/confPos.plt @@ -1,13 +1,12 @@ set terminal png set output 'posicoes.png' -set xlabel "x" +set xlabel "Posicao" set autoscale -set ylabel "y" +set ylabel "Tempo" set format y "%s" -set zlabel "Time" set title "Simulacao de Posicoes" set key reverse Left outside @@ -15,5 +14,5 @@ set grid set style data linespoints -splot "graph" using 1:2:3 title "Posicao" +plot "graph" using 1:2 title "Posicao" diff --git a/main.c b/main.c index 0eb7f53d6dc7151d41d5ef87fcddd8692cb2955d..cdfbb02ecf65dd89496046b674364fd9aeb2f894 100644 --- a/main.c +++ b/main.c @@ -72,6 +72,7 @@ int main(int argc, char const *argv[]) { Tuple *tuplas; Robot r = {0, 0, 0}; FILE *graph = fopen("./graph", "w"); + fprintf(graph, "0 0 0\n"); FILE *velo = fopen("./velo", "w"); FILE *dir = fopen("./dir", "w"); if(graph == NULL || velo == NULL || dir == NULL) { @@ -103,7 +104,7 @@ int main(int argc, char const *argv[]) { double angle = angleFromPoint(r.x, r.y, tuplas[i].x, tuplas[i].y); double turn = angle - r.theta; // angulo para girar o robo //printf("DEBUG: %f %f\n", angle, r.theta); - fprintf(graph, "%d %d %d\n", tuplas[i].x, tuplas[i].y, frame); + fprintf(graph, "%d %d\n", tuplas[i].x, tuplas[i].y); // Gira o robĂ´ r.theta += turn; // calcula a velocidade para as rodas