ui.R 10.4 KB
Newer Older
luroth's avatar
luroth committed
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
library(shinycssloaders)
library(leaflet)

# Default values
default_sensor_size_x = 35.6
default_sensor_size_y = 23.8
default_sensor_effective_Mpixels = 24.2
default_sensor_recorded_pixels_x = 6000
default_sensor_recorded_pixels_y = 4000
default_exposure_value = 14
default_max_motion_blur = 0.02
default_lens_aperture = 6
default_circle_of_confusion = 0.010
default_iso = 4000
default_lens_focal_length = 55
default_max_shutter_speed = 30000
default_shutter_speed = 16000
default_gcp_diameter_coded = 0.15
default_gcp_diameter_noncoded = 0.2
default_flight_height = 28
default_distance_area_x = 36
default_distance_area_y = 40
default_side_lap = 75.24
default_end_lap = 94.48
default_no_gcp_x = 6
default_no_gcp_y = 3
default_flip_camera = TRUE
default_plot_size_x = 1.5
default_plot_size_y = 2
default_position_precision = 3

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


ui_ = fluidPage(
  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(
            column(8, selectInput("sensor_configs", label=NA, choices=NA)),
            column(4, actionButton("sensor_edit", "Change sensor"))
          ),
          fluidRow(
            column(6, textInput("sensor_size_x", "Sensor size, width (mm)", width = "100%", value = default_sensor_size_x)),
            column(6, textInput("sensor_size_y", "Sensor size, height (mm)", width = "100%", value = default_sensor_size_y))
          ),
          fluidRow(
            column(6, textInput("sensor_recorded_pixels_x", "Number of recorded pixels in x (px)", width = "100%", value = default_sensor_recorded_pixels_x)),
            column(6, textInput("sensor_recorded_pixels_y", "Number of recorded pixels in y (px)", width = "100%", value = default_sensor_recorded_pixels_y))
          ),
          htmlOutput("pixel_size"),
          hr(),
          h4("Lens"),
          fluidRow(
            column(6, textInput("lens_focal_length", "Focal length (mm)", width = "100%", value = default_lens_focal_length)),
            column(6, textInput("lens_aperture", "Aperture (f-number)", width = "100%", value = default_lens_aperture))
          )
        ),
        
        tabPanel("Imaging",
          h4("Resolution"),
          sliderInput("flight_height", "Flight height (m)", width = "100%", value = default_flight_height, min=2, max=150),
          textInput("ground_resolution_nadir", "Ground sampling distance nadir (mm)", width = "100%"),
          htmlOutput("field_of_view"),
          hr(),
          h4("Exposure"),
          sliderInput("exposure_value", "Exposure value (EV)", min = 1, max = 21, step = 1, value = default_exposure_value),
          hr(),
          fluidRow(
            column(6, textInput("shutter_speed", "Shutter speed (1/s)", value = default_shutter_speed, width = "100%")),
            column(6, textInput("sensor_iso", "Film speed (ISO)", width = "100%", value = default_iso))
          )
          
        ),
        
        tabPanel("Mapping",
          h4("Mapping area"),
          fluidRow(
            column(6,textInput("distance_area_x", "Mapping area width (m)", width = "100%", value = default_distance_area_x)),
            column(6, textInput("distance_area_y","Mapping area depth (m)", width = "100%", value = default_distance_area_y))
          ),
          fluidRow(
            column(6,textInput("plot_size_x", "Plot size width (m)", width = "100%", value = default_plot_size_x)),
            column(6, textInput("plot_size_y","Plot size depth (m)", width = "100%", value = default_plot_size_y))
          ),
          hr(),
          h4("Flight path"),
          
          fluidRow(
            column(6, textInput("spacing_between_flight_lines", "Percent side lap (%)", width = "100%", value = default_side_lap)),
            column(6, textInput("spacing_between_exposures", "Percent end lap (%)", width = "100%", value = default_end_lap))
          ),
          fluidRow(
            column(6, textInput("spacing_between_flight_lines_size", "Spacing between flight lines (m)", width = "100%")),
            column(6, textInput("spacing_between_exposures_size", "Spacing between exposure (m)", width = "100%"))
          ),
          fluidRow(
            column(6,radioButtons("flip_camera", "Camera heading", choiceNames=c("Wide side in flight direction", "Narrow side in flight direction"), choiceValues = c(FALSE, TRUE), selected = default_flip_camera)),
            column(6, textInput("position_precision", "Positioning precision (m)", width = "100%", value = default_position_precision))
          ),
          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(
            column(6, textInput("gcp_n_in_x", "Number of GCP along mapping area width", width = "100%", value = default_no_gcp_x)),
            column(6, textInput("gcp_n_in_y", "Number of GCP along mapping area depth", width = "100%", value = default_no_gcp_y))
          ),
          radioButtons(inline=TRUE, "gcp_design", "Arrangement pattern",
                       choiceNames = list(
                         p("Squared", width="100px"),
                         p("Crosswise", width="100px")),
                       choiceValues = list(
                         "quad", "skip"
                       )),
          fluidRow(
            column(4, plotOutput("gcp_design_quad", height = "50px", width = "100px")),
            column(4, plotOutput("gcp_design_skip", height = "50px", width = "100px"))
          ),   
          hr(),
          h4("Coded GCP"),
          fluidRow(
            column(6, textInput("gcp_diameter_coded", "Size coded GCP (diameter inner circle) (m)", width = "100%", value = default_gcp_diameter_coded)),
            column(6, textInput("gcp_diameter_noncoded", "Size non-coded GCP (total size) (m)", width = "100%", value = default_gcp_diameter_noncoded))
          )
        ),
        
        tabPanel("Location",
                 h4("Mapping area"),
                 fluidRow(
                   column(6,textInput("position_edge1_lat", "Field edge (Latitude)", width = "100%", value = default_position_edge1_lat)),
                   column(6, textInput("position_edge1_long","Field edge (Longitude)", width = "100%", value = default_position_edge1_long))
                 ),
                 fluidRow(
                   column(6,textInput("position_edge2_lat", "Flight direction (Latitude)", width = "100%", value = default_position_edge2_lat)),
                   column(6, textInput("position_edge2_long","Flight direction (Longitude)", width = "100%", value = default_position_edge2_long))
                 ),                 
                 hr(),
                 fluidRow(
                   column(6,textInput("position_start_lat", "Starting point (Latitude)", width = "100%", value = default_starting_point_lat)),
                   column(6, textInput("position_start_long","Starting point (Longitude)", width = "100%", value = default_starting_point_long))
                 ) 
                 
        )
      ),
      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(
170
            column(8, h4("Flight height dependency"), plotOutput("flight_height_v_IFOV", height = "600px"), downloadButton("download_photo_props"), htmlOutput("optics_legend")),
luroth's avatar
luroth committed
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
            column(4, htmlOutput("lens_angle_of_view"))
          )
        
        ),
        tabPanel("Mapping properties",
          fluidRow(
            column(8,
                   h4("Mapping area"),
                   tabsetPanel(type="pills",
                     tabPanel("Schematic", plotOutput("plot_field", height = "600px")),
                     tabPanel("Map", leafletOutput("waypoint_map", height = "600px"),
                     htmlOutput("waypoint_settings")),
                     tabPanel("GCP recovery frequency", plotOutput("plot_hits_gcp", height = "600px"))
                   )
            ),
            column(4, htmlOutput("campaign_summary"),
                   h4("GCP detection"),
                   htmlOutput("gcp_flight_heights"))
          )
        ),
        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"))
                          ))
                 ),
                 actionButton("calc_viewing_geometry", label="(Re)calculate viewing geometry")
           
        ),
        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)"))
                )
           )
        )
      )
    )
  )
)