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:

  1. 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.

  2. Collecting the data

    Now we have the code set up, so lets run the experiments and collect the data.

    1. 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).
    2. Now move to the Examples directory. Open CfgExamples.xml in vim.
    3. 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".
    4. 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).
    5. Do the same for the following k values: 1, 2, 4, 8, 16, 32.
    6. 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]
    7. Now we need to adapt our GNUplot script from before by making the following changes:
      1. 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.)
      2. 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.
      3. 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.
      4. Update set xlabel "Sampler" to set xlabel "k-value"
      5. Update set ylabel for the three plots, so should be CD calls, Number of Edges, and Number of CCs respectively.
      6. Update ytics and yrange accordingly based upon your data for each plot.
    8. Type gnuplot [my .gnu file] to make the images. Check them out with gio open and make sure they look as you want them.
    9. 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).
    10. Change < Solver mpStrategyLabel="PRM-build" / > to < Solver mpStrategyLabel="PRM-query" / >, to tell BasicPRM which evaluator to use.
    11. 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.