drone-rigide/utils/plot_internal_tun.jl

38 lines
843 B
Julia
Raw Normal View History

2019-06-02 16:02:15 +00:00
using Plots
using CSV
pyplot()
2019-06-02 17:09:55 +00:00
file_measure = joinpath(@__DIR__, "data", "linear_x2.csv")
file_input = joinpath(@__DIR__, "data", "input_linear_x2.csv")
2019-06-02 16:02:15 +00:00
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],
2019-06-02 17:09:55 +00:00
title="Réponse indicielle de la boucle interne",
reuse=false,
size=(1000, 600),
label="mesure"
2019-06-02 16:02:15 +00:00
)
plot!(
command[init_command:end,1],
2019-06-02 17:09:55 +00:00
command[init_command:end,2],
label="commande"
2019-06-02 16:02:15 +00:00
)
2019-06-02 17:09:55 +00:00
savefig(joinpath(@__DIR__, "results", "internal_tuns.eps"))
2019-06-02 16:02:15 +00:00
show()