Séparation data/scripts/résultats
This commit is contained in:
parent
0eb2389eef
commit
7355556ac8
19 changed files with 4982 additions and 1149 deletions
|
@ -1,46 +0,0 @@
|
||||||
"""
|
|
||||||
=========================
|
|
||||||
Simple animation examples
|
|
||||||
=========================
|
|
||||||
|
|
||||||
This example contains two animations. The first is a random walk plot. The
|
|
||||||
second is an image animation.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import numpy as np
|
|
||||||
import matplotlib.pyplot as plt
|
|
||||||
import matplotlib.animation as animation
|
|
||||||
|
|
||||||
|
|
||||||
def update_line(num, data, line):
|
|
||||||
line.set_data(data[..., :num])
|
|
||||||
return line,
|
|
||||||
|
|
||||||
fig1 = plt.figure()
|
|
||||||
|
|
||||||
data = np.random.rand(2, 25)
|
|
||||||
l, = plt.plot([], [], 'r-')
|
|
||||||
plt.xlim(0, 1)
|
|
||||||
plt.ylim(0, 1)
|
|
||||||
plt.xlabel('x')
|
|
||||||
plt.title('test')
|
|
||||||
line_ani = animation.FuncAnimation(fig1, update_line, 25, fargs=(data, l),
|
|
||||||
interval=50, blit=True)
|
|
||||||
|
|
||||||
# To save the animation, use the command: line_ani.save('lines.mp4')
|
|
||||||
|
|
||||||
fig2 = plt.figure()
|
|
||||||
|
|
||||||
x = np.arange(-9, 10)
|
|
||||||
y = np.arange(-9, 10).reshape(-1, 1)
|
|
||||||
base = np.hypot(x, y)
|
|
||||||
ims = []
|
|
||||||
for add in np.arange(15):
|
|
||||||
ims.append((plt.pcolor(x, y, base + add, norm=plt.Normalize(0, 30)),))
|
|
||||||
|
|
||||||
im_ani = animation.ArtistAnimation(fig2, ims, interval=50, repeat_delay=3000,
|
|
||||||
blit=True)
|
|
||||||
# To save this second animation with some metadata, use the following command:
|
|
||||||
# im_ani.save('im.mp4', metadata={'artist':'Guido'})
|
|
||||||
|
|
||||||
plt.show()
|
|
1088
utils/freq.eps
1088
utils/freq.eps
File diff suppressed because it is too large
Load diff
|
@ -2,7 +2,7 @@ using Statistics
|
||||||
using CSV
|
using CSV
|
||||||
|
|
||||||
|
|
||||||
file_measure = "walk.csv"
|
file_measure = joinpath(@__DIR__, "data", "walk.csv")
|
||||||
|
|
||||||
measure = CSV.read(file_measure, header=false) |> Matrix{Float64}
|
measure = CSV.read(file_measure, header=false) |> Matrix{Float64}
|
||||||
|
|
||||||
|
@ -15,5 +15,5 @@ print("Delta moyen :\t\t")
|
||||||
print(Statistics.mean(deltas))
|
print(Statistics.mean(deltas))
|
||||||
println(" s")
|
println(" s")
|
||||||
print("Écart type :\t\t")
|
print("Écart type :\t\t")
|
||||||
print((Statistics.std(deltas)))
|
print(Statistics.std(deltas))
|
||||||
println(" s");
|
println(" s");
|
||||||
|
|
|
@ -6,7 +6,6 @@ import time
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
#import rospy
|
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.option('--output', default="output.csv", help='Number of greetings.')
|
@click.option('--output', default="output.csv", help='Number of greetings.')
|
|
@ -2,8 +2,8 @@ using Plots
|
||||||
using CSV
|
using CSV
|
||||||
pyplot()
|
pyplot()
|
||||||
|
|
||||||
file_measure = "linear_x2.csv"
|
file_measure = joinpath(@__DIR__, "data", "linear_x2.csv")
|
||||||
file_input = "input_linear_x2.csv"
|
file_input = joinpath(@__DIR__, "data", "input_linear_x2.csv")
|
||||||
|
|
||||||
measure = CSV.read(file_measure, header=false) |> Matrix{Float64};
|
measure = CSV.read(file_measure, header=false) |> Matrix{Float64};
|
||||||
command = CSV.read(file_input, header=false) |> Matrix{Float64};
|
command = CSV.read(file_input, header=false) |> Matrix{Float64};
|
||||||
|
@ -22,14 +22,16 @@ end
|
||||||
plot(
|
plot(
|
||||||
measure[init_measure:end-end_measure,1],
|
measure[init_measure:end-end_measure,1],
|
||||||
measure[init_measure:end-end_measure,2],
|
measure[init_measure:end-end_measure,2],
|
||||||
title="plop",
|
title="Réponse indicielle de la boucle interne",
|
||||||
size=(1000, 600)
|
reuse=false,
|
||||||
|
size=(1000, 600),
|
||||||
|
label="mesure"
|
||||||
)
|
)
|
||||||
s = sum([x * (measure[init_command + i,1] - measure[init_command + i-1,1]) for (i,x) in enumerate(measure[init_measure:end-end_measure,2])]) / (measure[end-end_measure,1] - measure[init_measure,1])
|
|
||||||
plot!([measure[init_measure,1], measure[end-end_measure,1]], [s, s])
|
|
||||||
plot!(
|
plot!(
|
||||||
command[init_command:end,1],
|
command[init_command:end,1],
|
||||||
command[init_command:end,2]
|
command[init_command:end,2],
|
||||||
|
label="commande"
|
||||||
)
|
)
|
||||||
|
savefig(joinpath(@__DIR__, "results", "internal_tuns.eps"))
|
||||||
|
|
||||||
show()
|
show()
|
1370
utils/results/internal_tuns.eps
Normal file
1370
utils/results/internal_tuns.eps
Normal file
File diff suppressed because it is too large
Load diff
3595
utils/results/mesure_vitesse_big_quadra.eps
Normal file
3595
utils/results/mesure_vitesse_big_quadra.eps
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
%!PS-Adobe-3.0 EPSF-3.0
|
%!PS-Adobe-3.0 EPSF-3.0
|
||||||
%%Creator: matplotlib version 2.2.4, http://matplotlib.org/
|
%%Creator: matplotlib version 2.2.4, http://matplotlib.org/
|
||||||
%%CreationDate: Sun Jun 2 14:33:03 2019
|
%%CreationDate: Sun Jun 2 18:28:49 2019
|
||||||
%%Orientation: portrait
|
%%Orientation: portrait
|
||||||
%%BoundingBox: -54 180 666 612
|
%%BoundingBox: -54 180 666 612
|
||||||
%%EndComments
|
%%EndComments
|
|
@ -1,6 +1,6 @@
|
||||||
%!PS-Adobe-3.0 EPSF-3.0
|
%!PS-Adobe-3.0 EPSF-3.0
|
||||||
%%Creator: matplotlib version 2.2.4, http://matplotlib.org/
|
%%Creator: matplotlib version 2.2.4, http://matplotlib.org/
|
||||||
%%CreationDate: Sun Jun 2 14:33:02 2019
|
%%CreationDate: Sun Jun 2 18:28:49 2019
|
||||||
%%Orientation: portrait
|
%%Orientation: portrait
|
||||||
%%BoundingBox: -54 180 666 612
|
%%BoundingBox: -54 180 666 612
|
||||||
%%EndComments
|
%%EndComments
|
|
@ -5,11 +5,12 @@ using CSV
|
||||||
pyplot()
|
pyplot()
|
||||||
|
|
||||||
# Parameters
|
# Parameters
|
||||||
filename = "walk.csv" # input file
|
filename = joinpath(@__DIR__, "data", "walk.csv") # input file
|
||||||
h = 1/22 # sample time
|
h = 1/22 # sample time
|
||||||
orders = [
|
orders = [
|
||||||
(title="quadratique", order=2, sizes=5:2:11),
|
(title="quadratique", order=2, sizes=5:2:11),
|
||||||
(title="cubique", order=3, sizes=5:2:11)
|
(title="cubique", order=3, sizes=5:2:11),
|
||||||
|
(title="big_quadra", order=2, sizes=11:10:51)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,6 +63,6 @@ for order in orders
|
||||||
subplot=2
|
subplot=2
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
savefig(string("mesure_vitesse_", order.title, ".eps"))
|
savefig(joinpath(@__DIR__, "results", string("mesure_vitesse_", order.title, ".eps")))
|
||||||
end
|
end
|
||||||
show()
|
show()
|
Loading…
Add table
Reference in a new issue