drone-rigide/utils/plot_internal_tun.jl
2019-06-02 19:09:55 +02:00

37 lines
843 B
Julia

using Plots
using CSV
pyplot()
file_measure = joinpath(@__DIR__, "data", "linear_x2.csv")
file_input = joinpath(@__DIR__, "data", "input_linear_x2.csv")
measure = CSV.read(file_measure, header=false) |> Matrix{Float64};
command = CSV.read(file_input, header=false) |> Matrix{Float64};
init_measure = 1
end_measure = 20
init_command = 30
for (i,t) in enumerate(measure[:,1])
global init_measure = i
if t >= command[init_command,1]
break
end
end
plot(
measure[init_measure:end-end_measure,1],
measure[init_measure:end-end_measure,2],
title="Réponse indicielle de la boucle interne",
reuse=false,
size=(1000, 600),
label="mesure"
)
plot!(
command[init_command:end,1],
command[init_command:end,2],
label="commande"
)
savefig(joinpath(@__DIR__, "results", "internal_tuns.eps"))
show()