Skip to content

Commit

Permalink
add ArenaCaesarExt and test plotPointCloud (#119)
Browse files Browse the repository at this point in the history
* add ArenaCaesarExt and test plotPointCloud

* bug fix on test plotPointCloud

* missing extra dep LasIO for testing

* missing extra dep Downloads for test

* Add Caesar and LasIO compat

* Update Project.toml compat

---------

Co-authored-by: Johannes Terblanche <[email protected]>
  • Loading branch information
dehann and Affie authored Feb 21, 2024
1 parent 2aea25b commit 4faa319
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 2 deletions.
15 changes: 14 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,24 @@ RoME = "91fb55c2-4c03-5a59-ba21-f4ea956187b8"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b"

[weakdeps]
Caesar = "62eebf14-49bc-5f46-9df9-f7b7ef379406"

[extensions]
ArenaCaesarExt = "Caesar"

[compat]
Aqua = "0.8"
Caesar = "0.16"
ColorSchemes = "3"
Colors = "0.12"
DelimitedFiles = "1"
DistributedFactorGraphs = "0.23"
DocStringExtensions = "0.9"
Downloads = "1"
GLMakie = "0.9"
GeometryBasics = "0.4"
LasIO = "0.3"
Manifolds = "0.9"
Pkg = "1"
ProgressMeter = "1"
Expand All @@ -36,7 +46,10 @@ julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
LasIO = "570499db-eae3-5eb6-bdd5-a5326f375e68"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "Test"]
test = ["Aqua", "Caesar", "Downloads", "DelimitedFiles", "LasIO", "Test"]
18 changes: 18 additions & 0 deletions ext/ArenaCaesarExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module ArenaCaesarExt

@info "Loading ArenaCaesarExt"

using GLMakie
using ColorSchemes
using TensorCast

using Caesar
import Caesar._PCL as _PCL

using Arena
import Arena: plotPointCloud


include("services/PlotPointCloudMap.jl")

end
3 changes: 3 additions & 0 deletions ext/Prototypes.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


function plotPointCloud end
File renamed without changes.
4 changes: 3 additions & 1 deletion src/Arena.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ using DocStringExtensions
# a lot of legacy code has been moved to the attic

# include("Exports.jl")
# include("services/PlotPointCloudMap.jl")
# include("services/PlotBoundingBox.jl")
include("services/PlotFeatureTracks.jl")
include("services/PlotHistogramGrid.jl")

# support weakdeps exports
include("../ext/Prototypes.jl")

end # module
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ using Aqua
# include("testBasicAnimations.jl")

end


## ==========================================================
## test ArenaCaesarExt

using Caesar

include("testPlotPointCloud.jl")
42 changes: 42 additions & 0 deletions test/testPlotPointCloud.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

using Arena
using Caesar
using Downloads
using DelimitedFiles
using LasIO
using Test

##

function downloadTestData(datafile, url)
if 0 === Base.filesize(datafile)
Base.mkpath(dirname(datafile))
@info "Downloading $url"
Downloads.download(url, datafile)
end
return datafile
end

testdatafolder = joinpath(tempdir(), "caesar", "testdata") # "/tmp/caesar/testdata/"

lidar_terr1_file = joinpath(testdatafolder,"lidar","simpleICP","terrestrial_lidar1.xyz")
if !isfile(lidar_terr1_file)
lidar_terr1_url = "https://github.com/JuliaRobotics/CaesarTestData.jl/raw/main/data/lidar/simpleICP/terrestrial_lidar1.xyz"
downloadTestData(lidar_terr1_file,lidar_terr1_url)
end

# load the data to memory
X_fix = readdlm(lidar_terr1_file, Float32)
# convert data to PCL types
pc_fix = Caesar._PCL.PointCloud(X_fix);


##
@testset "test plotPointCloud" begin
##

pl = Arena.plotPointCloud(pc_fix);

##
end
##

0 comments on commit 4faa319

Please sign in to comment.