mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-07-23 22:51:26 +00:00
Resolve "prettier plots"
This commit is contained in:
1033
juliaHelpers/Manifest.toml
Normal file
1033
juliaHelpers/Manifest.toml
Normal file
File diff suppressed because it is too large
Load Diff
5
juliaHelpers/Project.toml
Normal file
5
juliaHelpers/Project.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
[deps]
|
||||
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
|
||||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
|
||||
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
|
||||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
45
juliaHelpers/simplot.jl
Normal file
45
juliaHelpers/simplot.jl
Normal file
@@ -0,0 +1,45 @@
|
||||
using Plots
|
||||
using CSV
|
||||
using DataFrames
|
||||
|
||||
theme(:juno)
|
||||
plotlyjs()
|
||||
|
||||
|
||||
df = CSV.File("./public/simOut.csv") |> DataFrame
|
||||
# df = CSV.File("./simOut.csv") |> DataFrame
|
||||
|
||||
|
||||
println(describe(df))
|
||||
|
||||
p1 = let
|
||||
a = plot(df.t, [df.ax df.ay df.az], labels = ["ẍ" "ÿ" "z̈"], title = "Acceleration", ylabel = "m/s^2")
|
||||
|
||||
v = plot(df.t, df.vx .* df.vx .+ df.vy .* df.vy .+ df.vz .* df.vz .|> sqrt, labels = "Total Velocity", title = "Total Velocity", ylabel = "m/s", linecolor = "orchid")
|
||||
|
||||
x = plot(df.t, df.z, labels = "Altitude", title = "Altitude", ylabel = "m", xlabel = "time (ms)", linecolor = "chartreuse")
|
||||
|
||||
|
||||
plot(a, v, x, layout = (3, 1), legend = :outertopright)
|
||||
end
|
||||
|
||||
|
||||
p2 = let
|
||||
ypr = plot(df.t, [df.yaw df.pitch df.roll], label = ["Yaw" "Pitch" "Roll"], ylabel = "Euler Angles (degree)", title = "Vehicle Deflection")
|
||||
|
||||
ω = plot(df.t, [df.yawdot df.pitchdot df.rolldot], label = ["ÿ" "p̈" "r̈"], ylabel = "Angular Velocity (deg/s)", title = "Vehicle Deflection", xlabel = "time (ms)")
|
||||
|
||||
plot(ypr, ω, layout = (2, 1))
|
||||
end
|
||||
|
||||
p3 = plot(df.t, [df.Servo1 df.Servo2] .* (π / 180), label = ["Yaw" "Pitch"], ylabel = "Servo Position (degree)", xlabel = "time (ms)", title = "Servo Positions")
|
||||
|
||||
|
||||
global i = 1
|
||||
theme(:ggplot2)
|
||||
for p in [p1 p2 p3]
|
||||
savefig(p, "./public/plot$i.svg")
|
||||
savefig(p, "./public/plot$i.html")
|
||||
savefig(p, "./public/plot$i.png")
|
||||
global i = i + 1
|
||||
end
|
Reference in New Issue
Block a user