Skip to content
Snippets Groups Projects
Commit eb7dffb7 authored by Leandro Rodrigues's avatar Leandro Rodrigues
Browse files

Fix confPo

parent d52ee92b
No related branches found
No related tags found
No related merge requests found
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"
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment