forked from papalotis/ft-fsd-path-planning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstreamlit_main.py
68 lines (49 loc) · 1.67 KB
/
streamlit_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from pathlib import Path
import streamlit as st
from fsd_path_planning.demo.streamlit_demo.cone_matching import run as run_matching
from fsd_path_planning.demo.streamlit_demo.cone_sorting import run as run_sorting
from fsd_path_planning.demo.streamlit_demo.path_calculation import (
run as run_path_calculation,
)
st.set_page_config(page_title="FT Path Planning", page_icon="🏎️")
@st.cache # type: ignore
def load_ed_slides_as_bytes() -> bytes:
return Path("test.pdf").read_bytes()
def run_welcome() -> None:
st.markdown(
"""
# FaSTTUBe Formula Student Driverless Path Planning Algorithm
## Path Planning Demo
Welcome to the path planning app. The goal of this app is to visualize the algorithms
that are used in the 2021/22 formula student season by FaSTTUBe (Formula Student Team TU Berlin).
The path planning algorithm is split ito three parts:
- Cone Sorting
- Cone Matching
- Path Calculation
In the sidebar of the app you can select the algorithm you want to explore.
""".strip()
)
STRING_TO_FUNCTION = {
"Welcome": run_welcome,
"Sorting": run_sorting,
"Matching": run_matching,
"Path calculation": run_path_calculation,
}
with st.sidebar:
st.markdown("# Path Planning")
page_function = STRING_TO_FUNCTION[st.radio("Mode", STRING_TO_FUNCTION)]
st.markdown("---")
st.session_state.track_configuration = st.radio(
"Configuration",
(
"Straight",
"Simple Corner",
"Corner Missing Blue",
"Corner Missing Blue Alt",
"Hairpin",
"Hairpin Extreme",
# "FS Spain 19 Full",
# "Wrong sort",
),
)
page_function()