From 84c78681a20b946c4ef5f8f93e6eb71509949e96 Mon Sep 17 00:00:00 2001 From: Dylan Asmar Date: Mon, 29 Jan 2024 18:24:01 -0800 Subject: [PATCH 1/5] Updated TagPOMDP gallery example to use PGFPlotsX --- docs/src/gallery.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/src/gallery.md b/docs/src/gallery.md index f4b6ae6f..1678575d 100644 --- a/docs/src/gallery.md +++ b/docs/src/gallery.md @@ -229,7 +229,15 @@ The orange agent is the pursuer and the red agent is the evader. The pursuer mus ![TagPOMDPProblem](examples/TagPOMDP.gif) -```julia +```@setup TagPOMDP +using Pkg +Pkg.add("Plots") +Pkg.add("PGFPlotsX") +using Plots +pgfplotsx() +``` + +```@example TagPOMDP using POMDPs using TagPOMDPProblem using NativeSARSOP @@ -245,6 +253,12 @@ saved_gif = simulate(sim, pomdp, policy) println("gif saved to: $(saved_gif.filename)") ``` +```@setup TagPOMDP +using Pkg +Pkg.rm("Plots") +Pkg.rm("PGFPlotsX") +``` + !!! note This gif was **not** generated at documentation build time because of GR errors with Github Actions ([Plots.jl issue 4764](https://github.com/JuliaPlots/Plots.jl/issues/4764)). From c786c54d80a9f7ca3bfe65f5949b2f7917e24658 Mon Sep 17 00:00:00 2001 From: Dylan Asmar Date: Mon, 29 Jan 2024 18:56:45 -0800 Subject: [PATCH 2/5] Remove Tag note and added LaserTag example to gallery --- docs/src/gallery.md | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/docs/src/gallery.md b/docs/src/gallery.md index 1678575d..653e0b35 100644 --- a/docs/src/gallery.md +++ b/docs/src/gallery.md @@ -259,8 +259,45 @@ Pkg.rm("Plots") Pkg.rm("PGFPlotsX") ``` -!!! note - This gif was **not** generated at documentation build time because of GR errors with Github Actions ([Plots.jl issue 4764](https://github.com/JuliaPlots/Plots.jl/issues/4764)). +## [LaserTag](https://github.com/JuliaPOMDP/LaserTag.jl) + +LaserTag problem from A. Somani, N. Ye, D. Hsu, & W. Lee (2013). DESPOT : Online POMDP Planning with Regularization. Advances in Neural Information Processing Systems. This implementaiton has versions with continuous and discrete observations. + +![LaserTag](examples/LaserTag.gif) + +```@setup LaserTag +using Pkg +Pkg.add("TikzPictures") +Pkg.add(url="https://github.com/JuliaPOMDP/LaserTag.jl.git") +using TikzPictures +``` + +```@example LaserTag +using POMDPGifs +using QMDP +using Random +using ParticleFilters + +# If you don't have LaserTag installed, uncomment the following two lines +# using Pkg +# Pkg.add(url="https://github.com/JuliaPOMDP/LaserTag.jl.git") +using LaserTag + +rng = MersenneTwister(7) +pomdp = gen_lasertag(rng=rng, robot_position_known=true) +policy = solve(QMDPSolver(verbose=false), pomdp) +filter = SIRParticleFilter(pomdp, 10000, rng=rng) + +sim = GifSimulator(; filename="examples/LaserTag.gif", max_steps=50, rng=MersenneTwister(1), show_progress=false) +saved_gif = simulate(sim, pomdp, policy, filter) + +println("gif saved to: $(saved_gif.filename)") +``` + +```@setup LaserTag +Pkg.rm("LaserTag") +Pkg.rm("TikzPictures") +``` ## Adding New Gallery Examples To add new examples, please submit a pull request to the POMDPs.jl repository with changes made to the `gallery.md` file in `docs/src/`. Please include the creation of a gif in the code snippet. The gif should be generated during the creation of the documenation using `@eval` and saved in the `docs/src/examples/` directory. The gif should be named `problem_name.gif` where `problem_name` is the name of the problem. The gif can then be included using `![problem_name](examples/problem_name.gif)`. \ No newline at end of file From 7f3fc339d50922c5fcdc636ecc3aa5ca8a581dfa Mon Sep 17 00:00:00 2001 From: Dylan Asmar Date: Mon, 29 Jan 2024 19:18:57 -0800 Subject: [PATCH 3/5] updated using statements in gallery examples --- docs/src/gallery.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/src/gallery.md b/docs/src/gallery.md index 653e0b35..0af7be2f 100644 --- a/docs/src/gallery.md +++ b/docs/src/gallery.md @@ -15,11 +15,12 @@ Pkg.add(url="https://github.com/sisl/RoombaPOMDPs.git") using POMDPs using POMDPTools using POMDPGifs +using BasicPOMCP using Random using ParticleFilters using Cairo using LinearAlgebra -using BasicPOMCP + # If you don't have RoombaPOMDPs installed, uncomment the following two lines # using Pkg @@ -126,11 +127,12 @@ In this problem, the UAV must go from one corner to the other while avoiding a g ![DroneSurveillance](examples/DroneSurveillance.gif) ```@example -using DroneSurveillance using POMDPs -using NativeSARSOP +using POMDPTools using POMDPGifs +using NativeSARSOP using Random +using DroneSurveillance import Cairo, Fontconfig pomdp = DroneSurveillancePOMDP() @@ -152,8 +154,8 @@ An implementation of the classic Mountain Car RL problem using the QuickPOMDPs i using POMDPs using POMDPTools using POMDPGifs -using QuickPOMDPs using Random +using QuickPOMDPs using Compose import Cairo @@ -202,11 +204,12 @@ The robot must navigate and sample good rocks (green) and then arrive at an exit ```@example using POMDPs -using RockSample +using POMDPTools +using POMDPGifs using NativeSARSOP -using POMDPGifs -using Cairo using Random +using RockSample +using Cairo pomdp = RockSamplePOMDP(rocks_positions=[(2,3), (4,4), (4,2)], sensor_efficiency=20.0, @@ -239,10 +242,11 @@ pgfplotsx() ```@example TagPOMDP using POMDPs -using TagPOMDPProblem -using NativeSARSOP +using POMDPTools using POMDPGifs +using NativeSARSOP using Random +using TagPOMDPProblem pomdp = TagPOMDP() solver = SARSOPSolver(; max_time=20.0) @@ -269,14 +273,16 @@ LaserTag problem from A. Somani, N. Ye, D. Hsu, & W. Lee (2013). DESPOT : Onlin using Pkg Pkg.add("TikzPictures") Pkg.add(url="https://github.com/JuliaPOMDP/LaserTag.jl.git") -using TikzPictures ``` ```@example LaserTag +using POMDPs +using POMDPTools using POMDPGifs using QMDP using Random using ParticleFilters +using TikzPictures # If you don't have LaserTag installed, uncomment the following two lines # using Pkg From 93f25b99b70a223e63bc8f7aadb3897cc351d8fa Mon Sep 17 00:00:00 2001 From: Dylan Asmar Date: Mon, 29 Jan 2024 19:32:38 -0800 Subject: [PATCH 4/5] removed LaserTag example --- docs/src/gallery.md | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/docs/src/gallery.md b/docs/src/gallery.md index 0af7be2f..3483d703 100644 --- a/docs/src/gallery.md +++ b/docs/src/gallery.md @@ -263,47 +263,5 @@ Pkg.rm("Plots") Pkg.rm("PGFPlotsX") ``` -## [LaserTag](https://github.com/JuliaPOMDP/LaserTag.jl) - -LaserTag problem from A. Somani, N. Ye, D. Hsu, & W. Lee (2013). DESPOT : Online POMDP Planning with Regularization. Advances in Neural Information Processing Systems. This implementaiton has versions with continuous and discrete observations. - -![LaserTag](examples/LaserTag.gif) - -```@setup LaserTag -using Pkg -Pkg.add("TikzPictures") -Pkg.add(url="https://github.com/JuliaPOMDP/LaserTag.jl.git") -``` - -```@example LaserTag -using POMDPs -using POMDPTools -using POMDPGifs -using QMDP -using Random -using ParticleFilters -using TikzPictures - -# If you don't have LaserTag installed, uncomment the following two lines -# using Pkg -# Pkg.add(url="https://github.com/JuliaPOMDP/LaserTag.jl.git") -using LaserTag - -rng = MersenneTwister(7) -pomdp = gen_lasertag(rng=rng, robot_position_known=true) -policy = solve(QMDPSolver(verbose=false), pomdp) -filter = SIRParticleFilter(pomdp, 10000, rng=rng) - -sim = GifSimulator(; filename="examples/LaserTag.gif", max_steps=50, rng=MersenneTwister(1), show_progress=false) -saved_gif = simulate(sim, pomdp, policy, filter) - -println("gif saved to: $(saved_gif.filename)") -``` - -```@setup LaserTag -Pkg.rm("LaserTag") -Pkg.rm("TikzPictures") -``` - ## Adding New Gallery Examples To add new examples, please submit a pull request to the POMDPs.jl repository with changes made to the `gallery.md` file in `docs/src/`. Please include the creation of a gif in the code snippet. The gif should be generated during the creation of the documenation using `@eval` and saved in the `docs/src/examples/` directory. The gif should be named `problem_name.gif` where `problem_name` is the name of the problem. The gif can then be included using `![problem_name](examples/problem_name.gif)`. \ No newline at end of file From 3be7db7ba38cdeb6a92a0218523ba931b743e9e9 Mon Sep 17 00:00:00 2001 From: Dylan Asmar Date: Mon, 29 Jan 2024 20:21:55 -0800 Subject: [PATCH 5/5] back to GR but adding plots in setup --- docs/src/gallery.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/src/gallery.md b/docs/src/gallery.md index 3483d703..39997852 100644 --- a/docs/src/gallery.md +++ b/docs/src/gallery.md @@ -235,9 +235,7 @@ The orange agent is the pursuer and the red agent is the evader. The pursuer mus ```@setup TagPOMDP using Pkg Pkg.add("Plots") -Pkg.add("PGFPlotsX") using Plots -pgfplotsx() ``` ```@example TagPOMDP @@ -260,7 +258,6 @@ println("gif saved to: $(saved_gif.filename)") ```@setup TagPOMDP using Pkg Pkg.rm("Plots") -Pkg.rm("PGFPlotsX") ``` ## Adding New Gallery Examples