Experiment: Varying the connection technique for PRMs
Experiment: Varying the connection technique for PRMs
This experiment is very similar to experiment 1, except that you will
choose another aspect of motion planning to study and report on. Specifically,
you will be focusing on the the effect of varying the number of neighbors during
the connection phase of planning.
This assignment is a bit more challenging than the previous assignments. It will
require you to reference the previous tutorial. If you additional help, ask other crash
course students, as well as your student mentor.
There are three questions that we aim to answer in this assignment:
What is the expense of varying the k value for the connector?
What is the benefit of varying the k value?
What is it like to solve a query in PPL?
Setting up the code
Change your directory to Examples. Remove MyCfgExamples.xml
(rm MyCfgExamples.xml) because we do not need to use it.
Instead, we will be using CfgExamples.xml directly. Other than these
items, the code should be set up and good to go.
Collecting the data
Now we have the code set up, so lets run the experiments and collect the data.
Firstly, lets update our code. change your directory to the src
directory of pmpl. Type git pull. If we have updates to any
.h or .cpp files recompile the code (with make pmpl).
Now move to the Examples directory. Open CfgExamples.xml in
vim.
The code is already set up to generate a map with 100 nodes. So lets go
ahead and collect our first data point. Change
k="10" to k="1" in the NeighborhoodFinders xml tag for the
BruteForceNF method labeled "BFNF".
Exit the editor. Type ../pmpl -f CfgExamples.xml. Save the map and
stat files under k1.map and k1.stat respectively (type
mv Basic.map k1.map and mv Basic.stat k1.stat).
Do the same for the following k values: 1, 2, 4, 8, 16, 32.
Adapt the format of the previous nodes.dat and cd.dat for the following metrics:
CD calls - cd.dat: see Total Cfg::isCollision() = [some number]
Edges - edges.dat: see Number of Edges: [some number]
CCs - ccs.dat: see There are [some number] connected components:
For example the cd.dat file for this experiment might look like:
k-Value
CD-calls
k=1
[number]
k=2
[number]
k=4
[number]
k=8
[number]
k=16
[number]
k=32
[number]
Now we need to adapt our GNUplot script from before by making the following changes:
First lets add a section for a third image. Copy lines 23-30 and paste at the bottom of the file (move cursor to line 23
[which is the second "set output..."] type 8yy which "yanks" 8 lines, type shift-g which moves the cursor to
the bottom of the file, and type p to paste.)
Now update all three set output lines to their respective output images, i.e., change nodes.eps to cd.eps, change cd.eps to
edges.eps, and cd.eps (the second one) to ccs.eps.
Update all three set title lines to represent good titles for the plots, e.g., Number of edges created with varying k values or something similar.
Update set xlabel "Sampler" to set xlabel "k-value"
Update set ylabel for the three plots, so should be CD calls, Number of Edges, and Number of CCs respectively.
Update ytics and yrange accordingly based upon your data for each plot.
Type gnuplot [my .gnu file] to make the images. Check them out with
gio open and make sure they look as you want them.
We have images for comparing connections, but lets take a look at solving a
query. Open CfgExamples.xml.
Find the line in the map evaluator section of the xml specifying how to run a
query (xml tag is Query).
Change < Solver mpStrategyLabel="PRM-build" / > to
< Solver mpStrategyLabel="PRM-query" / >, to tell BasicPRM which
evaluator to use.
Rerun pmpl and see that it solves the query, generates a different
map, stat, and this time a path file. Save all of these to query0.map,
query0.stat, and query0.path respectively.