gisma / uavRmp

Unmanned Aerial Vehicle R based Mission Planner
https://gisma.github.io/uavRmp
GNU General Public License v3.0
22 stars 12 forks source link

Error message on tutorial code #9

Closed pascalfust closed 2 years ago

pascalfust commented 4 years ago

Hello, I was working through the examples in the vignettes to get an understanding of the functions of uavRmp. I was using the following code:

fa <- system.file("extdata", "flightarea.kml", package = "uavRmp")
fp<-makeAP(surveyArea=fa,
            maxSpeed =35,
            demFn = fn)

require(mapview)
 mapview(fp[[5]],color="red", alpha.regions =0.1,lwd=0.5)+
 mapview(fp[[1]],lwd=1,cex=4)+
 mapview(fp[[3]],color="red",cex=5)+
 mapview(fp[[4]],color="darkblue", alpha.regions =0.1,lwd=0.5)

The result was an error message " Error: NULL is not a directory! "

Most probably, it comes from fp[[3]], which was "NULL" Screenshot uavRmp sessionInfo uavRmp

gisma commented 4 years ago

@pascalfust Unfortunately the tutorial needs some updates. According to your example some things slightly have changed. I have changed some lines of code so pls install the actual version from github. Please try the following code: Actually your example missed to address the DEM data file and the setting of the picFootPrint switch. In addition the order of the returned list has changed so it is clearer to address the items by their names.

library(uavRmp)
remotes::install_github("r-spatial/link2GI",ref = "master")

fa <- system.file("extdata", "flightarea.kml", package = "uavRmp")
fn <- system.file("extdata", "mrbiko.tif", package = "uavRmp")

fp<-makeAP(surveyArea=fa,picFootprint = TRUE,
           maxSpeed =35 ,demFn = fn   ,dA = TRUE    )
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)+
 mapview::mapview(fp$fp)

Please note that the DJI part is not supported or checked and though not adapted for a long time - plus I do not know if the litchie workflow still works. So pls take care using the DJI settings!

About one month ago we decided to stop the support of DJI, because we use only Pixhawk drones for different reasons