if (FALSE) {
# Depending on the arguments, the following spatial data sets can be returned:
# lp the planned launching position of the UAV.
# wp waypoints inclusive all information
# oDEM the original (input) digital surface model (DSM)
# rDEM the resampled (used) DSM
# fp optimized footprints of the camera
# fA flight area with at least 2 overlaps
# rcA area covered by the RC according to the range and line of sight
# hm a heatmap abundance of pictures/pixel (VERY SLOW, only if heatMap = TRUE)
## for visualisation and vecDraw load mapview
require(mapview)
## (1) get example DEM data
demFn <- system.file("extdata", "mrbiko.tif", package = "uavRmp")
tutorial_flightArea <- system.file("extdata", "flightarea.kml", package = "uavRmp")
## (2) simple flight, 100 meters above ground
## assuming a flat topography,
fp <- makeAP(surveyArea = tutorial_flightArea,
demFn = demFn)
## (3) typical real case scenario (1)
## A flight altitudes BELOW 50 m is ambitious and risky
## You have to use a high quality high resulution DSM
## (here simulated with a standard DEM)
## (4) typical real case scenario (2)
## A flight altitudes BELOW 50 m is ambitious and risky
## You have to use a high quality high resulution DSM
## (here simulated with a standard DEM)
## This examples uses a flight planning from the QGroundcotrol Survey planning tool
## It also used the all calculations for camera flight speed etc.
## NOTE EXPERIMENTAL
demFn <- system.file("extdata", "mrbiko.tif", package = "uavRmp")
tutorial_flightArea <- system.file("extdata", "qgc_survey.plan", package = "uavRmp")
fp <- makeAP(surveyArea=tutorial_flightArea,
useMP = TRUE,
followSurface = TRUE,
demFn = demFn,
windCondition = 1,
uavType = "pixhawk",
followSurfaceRes = 5,
altFilter = .75)
## (5) typical real case scenario (3)
## This examples uses a flight planning from the QGroundcotrol Survey planning tool
## It also used the all calculations for camera flight speed etc.
## The flight plan is modyfied by splitting up the task according to 99 Waypoints
## and flight time and saved as litchi csv format
## NOTE EXPERIMENTAL tested with DJI mavic mini 2
demFn <- system.file("extdata", "mrbiko.tif", package = "uavRmp")
tutorial_flightArea <- system.file("extdata", "qgc_survey.plan", package = "uavRmp")
fp <- makeAP(surveyArea=tutorial_flightArea,
useMP = TRUE,
demFn = demFn,
maxFlightTime = 25,
uavType = "dji_csv")
## call a simple shiny interface
shiny::runApp(system.file("shiny/plan2litchi/", "app.R", package = "uavRmp"))
## (6) view results
mapview::mapview(fp$wp,cex=4, lwd=0.5)+
mapview::mapview(fp$lp,color = "red", lwd=1,cex=4)+
mapview::mapview(fp$fA,color="blue", alpha.regions = 0.1,lwd=0.5)+
mapview::mapview(fp$oDEM,col=terrain.colors(256))
## (6) digitize flight area using the small "onboard" tool vecDraw()
## save vectors as "kml" or "json" files
## provide full filename + extension!
vecDraw(preset="uav")
}
Run the code above in your browser using DataLab