mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-06-15 22:56:53 +00:00
Resolve "prettier plots"
This commit is contained in:
parent
cebccecf2b
commit
c73fc0fd7c
@ -20,7 +20,7 @@ build:
|
|||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
|
||||||
plots:
|
pythonplots:
|
||||||
# stage: build
|
# stage: build
|
||||||
image: python:3.9-buster
|
image: python:3.9-buster
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -32,11 +32,25 @@ plots:
|
|||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
|
||||||
|
juliaplots:
|
||||||
|
image: julia:1.7
|
||||||
|
dependencies:
|
||||||
|
- build
|
||||||
|
script:
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y unzip
|
||||||
|
- julia -e 'using Pkg; Pkg.activate("./juliaHelpers/"); Pkg.instantiate()'
|
||||||
|
- julia --project=./juliaHelpers ./juliaHelpers/simplot.jl
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
dependencies:
|
dependencies:
|
||||||
- build
|
- build
|
||||||
- plots
|
- pythonplots
|
||||||
|
- juliaplots
|
||||||
script:
|
script:
|
||||||
- ""
|
- ""
|
||||||
artifacts:
|
artifacts:
|
||||||
|
10
README.md
10
README.md
@ -29,8 +29,12 @@ Download the raw CSV: https://lander-team.gitlab.io/lander-cpp/simOut.csv
|
|||||||
|
|
||||||
Download Linux Binaries: https://lander-team.gitlab.io/lander-cpp/sim.out
|
Download Linux Binaries: https://lander-team.gitlab.io/lander-cpp/sim.out
|
||||||
|
|
||||||

|
### Plots
|
||||||
|
|
||||||

|
Click on the images for interactive versions.
|
||||||
|
|
||||||

|
<a href="https://lander-team.gitlab.io/lander-cpp/plot1.html" rel="Accel-Vel-ALt"></a>
|
||||||
|
|
||||||
|
<a href="https://lander-team.gitlab.io/lander-cpp/plot2.html" rel="Euler Angles vs Time"></a>
|
||||||
|
|
||||||
|
<a href="https://lander-team.gitlab.io/lander-cpp/plot3.html" rel="Servo Position vs Time"></a>
|
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
|
Loading…
x
Reference in New Issue
Block a user