PageRenderTime 53ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/docs/5_custom_boards/index.html

https://github.com/kipr/kiss
HTML | 86 lines | 75 code | 11 blank | 0 comment | 0 complexity | 9540103b0a6ae080f1337ff4f098dadc MD5 | raw file
  1. <html>
  2. <head>
  3. <title>KISS IDE 5 Tutorial: Custom Boards</title>
  4. <link type="text/css" rel="stylesheet" href="../common/style.css" />
  5. </head>
  6. <body>
  7. <div class="main">
  8. <h1 class="center">KISS IDE 5 Tutorial: Custom Boards</h1>
  9. <p>
  10. The KISS 5 simulator allows the user to choose a background board from a built-in library or use a custom board built by the user and included in the user's project. To use one of the built-in boards, simply choose the Link Simulator as your project's target. When the simulator window comes up, click on the <tt>Set Default Board</tt> button in the upper right, and choose the board you wish. You can then reset the robot and run the project again directly from the simulator window using the <tt>Run</tt> button in the lower left of the simulator.
  11. </p>
  12. <p>
  13. In order to use your own board design, you need to create a board file and add that file to your project. Projects that contain a board file will use the board file contained in the project and will not access any of the built-in library boards.
  14. </p>
  15. <h2>Creating a Board File</h2>
  16. <p>
  17. To add a new board file to your project, add a new file to the project and use the <code>Simulator Board Files &rarr; Blank Board</code> template. Make sure to give the file a <code>.board</code> extension (or give no extension and KISS will add it for you). Note that a project cannot run if it only contains a board file; it also needs a program!
  18. </p>
  19. <h3>Board Commands</h3>
  20. <p>
  21. Each command for creating a board starts on its own line with the common word. The set of command words are:
  22. <ul>
  23. <li>set-units &lt;<i>in | cm</i> &gt;</li>
  24. <li>set-z &lt;<i>val</i>&gt;</li>
  25. <li>pen &lt;<i>color</i>&gt; &lt;<i>width</i>&gt;</li>
  26. <li>line &lt;<i>x<sub>1</sub></i>&gt; &lt;<i>y<sub>1</sub></i>&gt; &lt;<i>x<sub>2</sub></i>&gt; &lt;<i>y<sub>2</sub></i>&gt;</li>
  27. <li>tape &lt;<i>x<sub>1</sub></i>&gt; &lt;<i>y<sub>1</sub></i>&gt; &lt;<i>x<sub>2</sub></i>&gt; &lt;<i>y<sub>2</sub></i>&gt;</li>
  28. <li>dec-line &lt;<i>x<sub>1</sub></i>&gt; &lt;<i>y<sub>1</sub></i>&gt; &lt;<i>x<sub>2</sub></i>&gt; &lt;<i>y<sub>2</sub></i>&gt;</li>
  29. <li>brush &lt;<i>color</i>&gt;</li>
  30. <li>dec-rect &lt;<i>x<sub>1</sub></i>&gt; &lt;<i>y<sub>1</sub></i>&gt; &lt;<i>width</i>&gt; &lt;<i>height</i>&gt;</li>
  31. </ul>
  32. In addition, lines that begin with # are comments and are ignored when the board is loaded.
  33. </p>
  34. <h3>Example Board</h3>
  35. <p>
  36. To use inches as the unit and to create a white rectangle 100&times;100 inches as the background, we would use the following commands: </p>
  37. <pre>
  38. set-units in
  39. # This will be the bottom graphical layer
  40. set-z -1.0
  41. pen white 1
  42. brush white
  43. # background
  44. dec-rect 0 0 100 100
  45. </pre>
  46. <p>
  47. These commands will form a white rectangle with a white border (the pen draws the border while the brush fills the rectangle). Since z has been set at -1, anything at a greater level will be drawn on top.
  48. </p>
  49. <p>
  50. Next, we will draw some lines on the board. Lines are like PVC on a game board. They can be seen by range and touch sensors. Tape, on the other hand is visible only to downward looking reflectance sensors. Decorative lines and rectangles are visible to the user, but not to the robot. Note that the simulated robot can drive through all simulation objects - this makes it easier to test whether or not the robot is properly responding to sensor input. If we add the following commands to our file, we will have a V made out of PVC and a piece of tape running across the opening. We will also add a decorative line splitting the angle of the V, just to show that feature. All tape colors interact with the robot the same way, we will use red tape just to brighten up the board simulation.
  51. </p>
  52. <pre>
  53. #PVC V
  54. set-z 1.0
  55. pen gray 3
  56. line 20 20 50 80
  57. line 50 80 80 20
  58. #Tape across the V (note tape is placed under the PVC but above background)
  59. set-z 0
  60. pen red 4
  61. tape 20 20 80 20
  62. #The next line is visible only to user.
  63. #The light blue color is defined using RGB in hex
  64. pen #8080FF 1
  65. dec-line 50 80 50 20
  66. </pre>
  67. <img class="center fill" src="demo_board.png"></img>
  68. <h2>Need Help?</h2>
  69. <p>
  70. If you have any questions or need assistance, you can call KIPR at 405-579-4609 (M-F, 8:30 a.m. - 5:00 p.m. CST) or email <a href="mailto:support@kipr.org">KIPR support</a>.
  71. </p>
  72. </div>
  73. <p class="center">Copyright &copy; 2014 KISS Institute for Practical Robotics</p>
  74. </body>
  75. </html>