ui.R 10.6 KB
Newer Older
luroth's avatar
luroth committed
1
2
3
4
library(shinycssloaders)
library(leaflet)

# Default values
luroth's avatar
luroth committed
5
default_exposure_value <- 14
6
default_max_motion_blur <- 0.04
luroth's avatar
luroth committed
7
8
9
10
11
12
13
14
15
16
17
18
19
default_iso <- 4000
default_shutter_speed <- 16000
default_flight_height <- 30
default_mapping_area_x <- 36
default_mapping_area_y <- 40
default_side_lap <- 60
default_end_lap <- 80
default_no_gcp_x <- 6
default_no_gcp_y <- 3
default_flip_camera <- FALSE
default_plot_size_x <- 1.5
default_plot_size_y <- 2
default_position_precision <- 3
luroth's avatar
luroth committed
20

luroth's avatar
luroth committed
21
22
23
24
25
26
default_position_edge1_lat <- 47.450812627526901
default_position_edge1_long <- 8.682496912397921
default_position_edge2_lat <- 47.451039942926123
default_position_edge2_long <- 8.682089627868457
default_starting_point_lat <- 47.450163
default_starting_point_long <- 8.682736
luroth's avatar
luroth committed
27

luroth's avatar
luroth committed
28
aperture_values <- c(0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.6, 1.7, 1.8, 2, 2.2, 2.4, 2.5, 2.8, 3.2, 3.4, 4, 4.5, 4.8, 5, 5.7, 6.3, 6.7, 7.1, 8, 9, 9.5, 10.1, 11.3, 12.7, 13.5, 14.3, 16, 18, 19) 
luroth's avatar
luroth committed
29
names(aperture_values) <- paste0("f/", aperture_values)
luroth's avatar
luroth committed
30

luroth's avatar
luroth committed
31
ui_ <- fluidPage(
luroth's avatar
luroth committed
32
33
34
35
36
37
38
39
40
41
42
43
  shinyjs::useShinyjs(),
  
  titlePanel(windowTitle="PheonyFly Planning Tool",
    title=div(img(src="CSLogo_black_40.png"), HTML("Pheno<b>Fly Planning Tool</b>"))),
  
  sidebarLayout(
    
    sidebarPanel(
      tabsetPanel(id="config_tab",
        tabPanel("Sensor/Lens",
          h4("Sensor"),
          fluidRow(
luroth's avatar
luroth committed
44
45
            column(8, selectInput("sensor_and_lens_select", label=NA, choices=NA)),
            column(4, actionButton("sensor_and_lens_edit", "Save settings"))
luroth's avatar
luroth committed
46
47
          ),
          fluidRow(
luroth's avatar
luroth committed
48
49
            column(6, numericInput("d_sensor_x", "Sensor size, width (mm)", width = "100%", value=NA, step=0.1)),
            column(6, numericInput("d_sensor_y", "Sensor size, height (mm)", width = "100%", value=NA, step=0.1))
luroth's avatar
luroth committed
50
51
          ),
          fluidRow(
luroth's avatar
luroth committed
52
53
            column(6, numericInput("n_pix_x", "Number of recorded pixels in x (px)", width = "100%", value=NA, step=1)),
            column(6, numericInput("n_pix_y", "Number of recorded pixels in y (px)", width = "100%", value=NA, step=1))
luroth's avatar
luroth committed
54
          ),
luroth's avatar
luroth committed
55
          fluidRow(
56
57
58
59
60
61
            column(6, numericInput("t_max", "Max. shutter speed (1/s)", width = "100%", value=NA, step=1000)),
            column(6, numericInput("ISO_max", "Max. film speed (ISO)", width = "100%", value=NA, step=1000))
          ),
          fluidRow(
            column(6, numericInput("freq_max", "Max. recording freqency (1/s)", width = "100%", value=NA)),
            column(6, numericInput("flight_max", "Max. flight time (min)", width = "100%", value=NA))
luroth's avatar
luroth committed
62
63
          ),
          htmlOutput("d_pix_output"),
luroth's avatar
luroth committed
64
65
66
          hr(),
          h4("Lens"),
          fluidRow(
luroth's avatar
luroth committed
67
68
            column(6, numericInput("f", "Focal length (mm)", width = "100%", value=NA, step=1)),
            column(6, selectInput("aperture", "Aperture (f-number)", width = "100%", choices = aperture_values))
luroth's avatar
luroth committed
69
70
71
72
73
          )
        ),
        
        tabPanel("Imaging",
          h4("Resolution"),
luroth's avatar
luroth committed
74
75
76
77
78
          sliderInput("flight_height", "Flight height (m)", width = "100%", value = default_flight_height, min=2, max=100, animate = TRUE),
          fluidRow(
            column(9, numericInput("ground_sampling_distance", "Ground sampling distance nadir (mm)", width = "100%", value=NA, step=0.1)),
            column(3, checkboxInput("edit_ground_sampling_distance", "Edit"), style = "margin-top: 25px;")
          ),
luroth's avatar
luroth committed
79
80
81
82
83
          hr(),
          h4("Exposure"),
          sliderInput("exposure_value", "Exposure value (EV)", min = 1, max = 21, step = 1, value = default_exposure_value),
          hr(),
          fluidRow(
luroth's avatar
luroth committed
84
85
            column(6, selectInput("shutter_speed", "Shutter speed (s)", selected = default_shutter_speed, choices = default_shutter_speed, width = "100%")),
            column(6, numericInput("iso", "Film speed (ISO)", width = "100%", value = default_iso))
luroth's avatar
luroth committed
86
87
88
89
90
91
92
          )
          
        ),
        
        tabPanel("Mapping",
          h4("Mapping area"),
          fluidRow(
luroth's avatar
luroth committed
93
94
            column(6, numericInput("mapping_area_x", "Mapping area width (m)", width = "100%", value = default_mapping_area_x, step=1)),
            column(6, numericInput("mapping_area_y","Mapping area depth (m)", width = "100%", value = default_mapping_area_y, step=1))
luroth's avatar
luroth committed
95
96
          ),
          fluidRow(
luroth's avatar
luroth committed
97
98
            column(6, numericInput("plot_size_x", "Plot size width (m)", width = "100%", value = default_plot_size_x, step=0.1)),
            column(6, numericInput("plot_size_y","Plot size depth (m)", width = "100%", value = default_plot_size_y, step=0.1))
luroth's avatar
luroth committed
99
100
101
          ),
          hr(),
          h4("Flight path"),
luroth's avatar
luroth committed
102
          checkboxInput("edit_spacing", "metric"),
luroth's avatar
luroth committed
103
          fluidRow(
luroth's avatar
luroth committed
104
105
            column(6, numericInput("side_lap", "Side lap (%)", width = "100%", value = default_side_lap)),
            column(6, numericInput("end_lap", "End lap (%)", width = "100%", value = default_end_lap))
luroth's avatar
luroth committed
106
107
          ),
          fluidRow(
luroth's avatar
luroth committed
108
109
            column(6, numericInput("spacing_between_flight_lines", "Side lap (m)", width = "100%", value=NA)),
            column(6, numericInput("spacing_between_exposures", "End lap (m)", width = "100%", value=NA))
luroth's avatar
luroth committed
110
111
          ),
          fluidRow(
112
            column(6,radioButtons("flip_camera", "Camera heading", choiceNames=c("Narrow side in flight direction", "Wide side in flight direction"), choiceValues = c(FALSE, TRUE), selected = default_flip_camera)),
luroth's avatar
luroth committed
113
            column(6, numericInput("positioning_precision", "Positioning precision (m)", width = "100%", value = default_position_precision))
luroth's avatar
luroth committed
114
115
116
117
118
119
120
          ),
          sliderInput("motion_blur", "Maximal motion blur (px)", min = 0.01, max = 1, step = 0.01, value = default_max_motion_blur, width = "100%")
        ),
        
        tabPanel("GCPs",
          h4("Arrangement"),
          fluidRow(
luroth's avatar
luroth committed
121
122
            column(6, numericInput("gcp_n_in_x", "Number of GCP along mapping area width", width = "100%", value = default_no_gcp_x, step=1)),
            column(6, numericInput("gcp_n_in_y", "Number of GCP along mapping area depth", width = "100%", value = default_no_gcp_y, step=1))
luroth's avatar
luroth committed
123
          ),
luroth's avatar
luroth committed
124
          radioButtons(inline=TRUE, "gcp_arrangement_pattern", "Arrangement pattern",
luroth's avatar
luroth committed
125
126
127
128
129
130
131
                       choiceNames = list(
                         p("Squared", width="100px"),
                         p("Crosswise", width="100px")),
                       choiceValues = list(
                         "quad", "skip"
                       )),
          fluidRow(
luroth's avatar
luroth committed
132
133
            column(4, plotOutput("gcp_arrangement_quad", height = "50px", width = "100px")),
            column(4, plotOutput("gcp_arrangement_skip", height = "50px", width = "100px"))
luroth's avatar
luroth committed
134
135
136
137
138
139
          )
        ),
        
        tabPanel("Location",
                 h4("Mapping area"),
                 fluidRow(
luroth's avatar
luroth committed
140
141
                   column(6,numericInput("position_edge1_lat", "Field edge (Latitude)", width = "100%", value = default_position_edge1_lat)),
                   column(6, numericInput("position_edge1_long","Field edge (Longitude)", width = "100%", value = default_position_edge1_long))
luroth's avatar
luroth committed
142
143
                 ),
                 fluidRow(
luroth's avatar
luroth committed
144
145
                   column(6,numericInput("position_edge2_lat", "Flight direction (Latitude)", width = "100%", value = default_position_edge2_lat)),
                   column(6, numericInput("position_edge2_long","Flight direction (Longitude)", width = "100%", value = default_position_edge2_long))
luroth's avatar
luroth committed
146
147
148
                 ),                 
                 hr(),
                 fluidRow(
luroth's avatar
luroth committed
149
150
                   column(6,numericInput("position_start_lat", "Starting point (Latitude)", width = "100%", value = default_starting_point_lat)),
                   column(6, numericInput("position_start_long","Starting point (Longitude)", width = "100%", value = default_starting_point_long))
luroth's avatar
luroth committed
151
152
153
154
155
156
157
158
159
160
161
162
163
164
                 ) 
                 
        )
      ),
      hr(),
      img(src="ETHLogo_black_20.png"),
      div(HTML("<br />Group of crop science<br />Lukas Roth (lukas.roth@usys.ethz.ch)<br />(c) 2018"))
      
    ),
    
    mainPanel(
      tabsetPanel(id="results",
        tabPanel("Photographic properties",
          fluidRow(
luroth's avatar
luroth committed
165
166
167
168
            column(8, h4("Flight height dependency"), 
                   plotOutput("photographic_properties_plot", height = "600px"), 
                   downloadButton("download_photographic_properties_plot")),
            column(4, htmlOutput("photographic_properties_summary"))
luroth's avatar
luroth committed
169
170
171
172
173
174
175
176
          )
        
        ),
        tabPanel("Mapping properties",
          fluidRow(
            column(8,
                   h4("Mapping area"),
                   tabsetPanel(type="pills",
177
178
179
180
                     tabPanel("Schematic", 
                              plotOutput("plot_mapping_area", height = "600px"),
                              downloadButton("download_mapping_area_plot")
                      ),
luroth's avatar
luroth committed
181
182
183
                     tabPanel("Map", 
                      leafletOutput("waypoint_map", height = "600px"),
                      htmlOutput("waypoint_settings")),
luroth's avatar
luroth committed
184
185
186
                     tabPanel("GCP recovery frequency", plotOutput("plot_hits_gcp", height = "600px"))
                   )
            ),
luroth's avatar
luroth committed
187
            column(4, htmlOutput("mapping_summary"))
luroth's avatar
luroth committed
188
189
190
191
192
193
194
195
196
197
198
199
200
201
          )
        ),
        tabPanel("Viewing geometry",
                 fluidRow(
                   column(6, h4("Sensor viewing geometry"),
                          tabsetPanel(type="pills",
                                      tabPanel("Plot center recovery frequency", plotOutput("plot_recovery_frequency", height = "500px"))
                          )),
                   column(6, h4("Plot center viewing geometry"),
                          tabsetPanel(type="pills",
                                      tabPanel("Zenith angle", plotOutput("plot_viewing_geometry", height = "500px")),
                                      tabPanel("Sensor X axis", plotOutput("plot_viewing_geometry_x", height = "500px")),
                                      tabPanel("Sensor Y axis", plotOutput("plot_viewing_geometry_y", height = "500px"))
                          ))
luroth's avatar
luroth committed
202
                 )
luroth's avatar
luroth committed
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
           
        ),
        tabPanel("Mission briefing",
                 fluidRow(
                   column(5, 
                     h4("Camera settings"),
                     htmlOutput("camera_settings"),
                     h4("Flight/campaign settings"),
                     htmlOutput("campaign_settings"),
                     h4("Restrictions"),
                     htmlOutput("restrictions")
                   ),
                 column(7, leafletOutput("mission_waypoint_map", height=400),
                        div(downloadButton("download_waypoints", "Download waypoints as CSV"), HTML("(e.g. to import in Litchi)")),
                        div(downloadButton("download_kml", "Download mapping area as KML"), HTML("(e.g. to import in DJI GS Pro)"))
                )
           )
        )
      )
    )
  )
)