Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T800
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vytor Calixto
T800
Commits
db860de7
Commit
db860de7
authored
9 years ago
by
Leandro Rodrigues
Browse files
Options
Downloads
Patches
Plain Diff
Alteracoes no main para gnuplot e arquivo de configuracao
parent
fa7786af
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
conf.plt
+20
-0
20 additions, 0 deletions
conf.plt
main.c
+3
-3
3 additions, 3 deletions
main.c
with
23 additions
and
3 deletions
conf.plt
0 → 100644
+
20
−
0
View file @
db860de7
set terminal png
set output 'simulation.png'
set xlabel "x/velocidade"
set autoscale
set ylabel "y/angulo de deslocamento"
set format y "%s"
set zlabel "Time"
set title "Simulation"
set key reverse Left outside
set grid
set style data linespoints
splot "graph" using 1:2:3 title "Posicao", \
"table" using 1:2:3 title "Angulo/Velocidade"
This diff is collapsed.
Click to expand it.
main.c
+
3
−
3
View file @
db860de7
...
...
@@ -47,7 +47,7 @@ double angleFromOrigin(int x, int y) {
double
angleFromPoint
(
int
ox
,
int
oy
,
int
x
,
int
y
)
{
//ox e oy são os pontos da nova referência
double
hip
=
distance
(
o
)
n
x
,
oy
,
x
,
y
);
double
hip
=
distance
(
ox
,
oy
,
x
,
y
);
return
acos
((
ox
-
x
)
/
hip
)
*
180
/
PI
;
}
...
...
@@ -96,13 +96,13 @@ 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
%f
\n
"
,
tuplas
[
i
].
x
,
tuplas
[
i
].
y
,
frame
,
angle
-
r
.
theta
);
fprintf
(
graph
,
"%d %d %d
\n
"
,
tuplas
[
i
].
x
,
tuplas
[
i
].
y
,
frame
);
// Gira o robô
r
.
theta
+=
turn
;
// calcula a velocidade para as rodas
distancia
=
distance
(
r
.
x
,
r
.
y
,
tuplas
[
i
].
x
,
tuplas
[
i
].
y
);
velocidade
=
velocity
(
distancia
,
tuplas
[
i
].
t
);
fprintf
(
graph
,
"%f
\n
"
,
velocidad
e
);
fprintf
(
out
,
"%f %f %d
\n
"
,
velocidade
,
r
.
theta
,
fram
e
);
moverRobo
(
&
r
,
tuplas
[
i
].
x
,
tuplas
[
i
].
y
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment