{"id":1599,"date":"2023-01-28T12:12:42","date_gmt":"2023-01-28T19:12:42","guid":{"rendered":"https:\/\/blogs.ubc.ca\/cogs300\/?page_id=1599"},"modified":"2024-01-29T20:26:59","modified_gmt":"2024-01-30T03:26:59","slug":"unity-lab-2-self-driving-car","status":"publish","type":"page","link":"https:\/\/blogs.ubc.ca\/cogs300\/unity-lab-2-self-driving-car\/","title":{"rendered":"Unity &#8211; Lab 2: Self Driving Car"},"content":{"rendered":"<h1><strong>Pre-Lab:<\/strong><\/h1>\n<p><strong>Please submit on Canvas <em>before\u00a0<\/em>the start of your lab<\/strong><\/p>\n<p>Download the code for the lab <a href=\"https:\/\/github.com\/COGS300\/lab2-self-driving\">here<\/a><\/p>\n<p><span class=\"TextRun SCXW132831850 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW132831850 BCX0\">Please <\/span><span class=\"NormalTextRun SCXW132831850 BCX0\">install<\/span> <\/span><a class=\"Hyperlink SCXW132831850 BCX0\" href=\"https:\/\/unity.com\/releases\/editor\/whats-new\/2020.3.40\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW132831850 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW132831850 BCX0\" data-ccp-charstyle=\"Hyperlink\">Unity version <\/span><span class=\"NormalTextRun SCXW132831850 BCX0\" data-ccp-charstyle=\"Hyperlink\">2020.3.40f1<\/span><\/span><\/a><span class=\"TextRun SCXW132831850 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW132831850 BCX0\"> for this lab<\/span><span class=\"NormalTextRun SCXW132831850 BCX0\"> using the Unity Hub button from the given link. <b>In the install settings make sure all checkboxes are left unchecked!<\/b><\/span><span class=\"NormalTextRun SCXW132831850 BCX0\">. This will be the version of Unity used in all future labs.<\/span> <\/span><span class=\"EOP SCXW132831850 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>Please also make sure that you are able to open the lab files.<\/p>\n<ol>\n<li><span class=\"TextRun SCXW6443448 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW6443448 BCX0\">In<\/span><span class=\"NormalTextRun SCXW6443448 BCX0\"> your own words, describe what a physical symbol system is. (50 words max)<\/span><\/span><span class=\"EOP SCXW6443448 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li>For each of the following code snippets, which function (1, 2, or 3) will be executed?\n<ol>\n<li><strong><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1604 alignnone\" src=\"https:\/\/blogs.ubc.ca\/cogs300\/files\/2023\/01\/Screen-Shot-2023-01-28-at-10.53.30-AM-300x290.png\" alt=\"\" width=\"241\" height=\"233\" srcset=\"https:\/\/blogs.ubc.ca\/cogs300\/files\/2023\/01\/Screen-Shot-2023-01-28-at-10.53.30-AM-300x290.png 300w, https:\/\/blogs.ubc.ca\/cogs300\/files\/2023\/01\/Screen-Shot-2023-01-28-at-10.53.30-AM.png 500w\" sizes=\"auto, (max-width: 241px) 100vw, 241px\" \/><\/strong><\/li>\n<li><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1605\" src=\"https:\/\/blogs.ubc.ca\/cogs300\/files\/2023\/01\/Screen-Shot-2023-01-28-at-10.52.51-AM-300x264.png\" alt=\"\" width=\"240\" height=\"211\" srcset=\"https:\/\/blogs.ubc.ca\/cogs300\/files\/2023\/01\/Screen-Shot-2023-01-28-at-10.52.51-AM-300x264.png 300w, https:\/\/blogs.ubc.ca\/cogs300\/files\/2023\/01\/Screen-Shot-2023-01-28-at-10.52.51-AM.png 548w\" sizes=\"auto, (max-width: 240px) 100vw, 240px\" \/><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h1><strong>Lab:<\/strong><\/h1>\n<p><span data-contrast=\"auto\">In this lab, you will be writing algorithms for two approaches using Physical Symbol Systems (PSS) for creating a \u201cself-driving\u201d vehicle. The first part will involve pre-planning the route as a list of instructions. The second will use sensors and logical statements to determine which direction for the vehicle to turn.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2>Part 1: Pre-planned movement<span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Open the lab and navigate to Scenes -&gt; Self Driving<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Select the car object and find the Car Control API script in the inspector<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Check the \u2018Planned\u2019 box, and uncheck the \u2018sensorLogic\u2019 box if needed<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Run your program to test everything is working. You should see your car move straight forward.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ol>\n<\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Open the \u2018Car Control API\u2019 script by right-clicking on the name and selecting \u2018edit script\u2019<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Find the PlannedMovement() function (line ~50)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Find the instructions list on line ~55 with the<strong> TODO<\/strong>: on the line above.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Each number in the list represents the direction the car should turn, where \u20131 is full left, 1 is full right, and 0 is straight. Decimal values between 0 and 1 up to two decimals are allowed. This list will be read and executed sequentially, with a half second for each instruction by default.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><b><span data-contrast=\"none\">Your task is to edit this list so that your car makes it to the green goal at the end of the path.<\/span><\/b><span data-contrast=\"auto\">\u00a0This may take some trial and error. <\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">When your car is able to reach the green goal, open the scene labelled \u2018Alternate Path\u2019<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Test your pre-planned movement algorithm on the new path. How well do your instructions perform on this path compared to the one you originally programmed the instructions?<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><strong>Make a copy of your list and edit it so that your car can reach the end of the alt path\u00a0<\/strong>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">You can comment out the old one by adding \u2018\/\/\u2019 to the beginning of that line.<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">When you are able to complete both paths, show your TA to get checked off<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ol>\n<h2>Part 2: Sensor Logic<\/h2>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Open the self-driving scene<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Select the car object and find the Car Control API script in the inspector<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Check the \u2018sensorLogic\u2019 box, and uncheck the \u2018Planned\u2019 box if needed<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Run your program to test everything is working. You should see your car move straight forward.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ol>\n<\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Open the \u2018Car Control API\u2019 script by right clicking on the name and selecting \u2018edit script\u2019<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Find the SensorLogicMovement() function (line ~90)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><b><span data-contrast=\"none\">Write an algorithm using the rightDist and leftDist variables to control movement<\/span><\/b><span data-contrast=\"auto\">. A good place to start is to keep the car in the center of the road by turning towards the side which is further away. You should be using if statements to control the movement.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">You may find that your car gets stuck on certain obstacles.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Use controlScript.SetTurn() to control the turning of your car (-1 is left, 1 is right, 0 is straight)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><strong>Add more sensors to your car and edit your algorithm<\/strong><span data-contrast=\"auto\"> to use them so that you can navigate any obstacles which the car got stuck on.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The Raycast() function takes in an angle and creates a distance sensor at that angle from the car. 0 is forward and 180 is backward. You can add more of them by calling the Raycast function and assigning the result to a float variable (just like rightDist and leftDist do)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ol>\n<\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Experiment with the angles, number of raycasts, and algorithm until your car is able to reach the end of the path.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Test your car on the \u2018alternative path\u2019 scene, and make any edits needed to have your car reach the end of that path as well<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:0,&quot;335559684&quot;:-1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769242&quot;:[65533,0],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;%1.&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">When your car can successfully navigate both paths, show your TA to get checked off.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ol>\n<h1><strong>Post-Lab:<\/strong><\/h1>\n<p><strong>(don&#8217;t forget to submit your code)<\/strong><\/p>\n<ol>\n<li>In each case for the pre-planned movement, and the sensor logic algorithms, how to they fit with the PSS approach to intelligence (symbols, expressions, processes, designation, etc)? (100w max)<\/li>\n<li><span class=\"TextRun SCXW227084953 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun CommentStart CommentHighlightPipeRest CommentHighlightRest SCXW227084953 BCX0\">What<\/span><span class=\"NormalTextRun CommentHighlightPipeRest SCXW227084953 BCX0\"> happens to the sensor logic algorithm as you added more sensors? How well would this scale if you had 100, or 1000 sensors?<\/span><span class=\"NormalTextRun SCXW227084953 BCX0\"> (50w max)<\/span><\/span><span class=\"EOP SCXW227084953 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span class=\"TextRun SCXW73456807 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun CommentHighlightRest SCXW73456807 BCX0\">How robust was each algorithm? <\/span><span class=\"NormalTextRun CommentStart CommentHighlightPipeRest CommentHighlightRest SCXW73456807 BCX0\">Recall that robustness is <\/span><span class=\"NormalTextRun CommentHighlightRest SCXW73456807 BCX0\">how well a system is able to perform in different scenarios.<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW73456807 BCX0\"> (100w max)<\/span><\/span><span class=\"EOP CommentHighlightPipeRest SCXW73456807 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ol>\n<p><b>Grading Scheme:\u00a0<\/b><\/p>\n<table style=\"font-weight: 400;\" data-tablestyle=\"MsoTableGrid\" data-tablelook=\"1696\" aria-rowcount=\"9\">\n<tbody>\n<tr aria-rowindex=\"1\">\n<td data-celllook=\"69905\"><b><span data-contrast=\"none\">Task (PP= Pre-Planned, SL = Sensor Logic)<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<td data-celllook=\"69905\"><b><span data-contrast=\"none\">Marks Awarded (2 total)<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"2\">\n<td data-celllook=\"69905\"><b><span data-contrast=\"none\">PP<\/span><\/b><span data-contrast=\"none\"> &#8211; Generate list of instructions<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<td data-celllook=\"69905\"><span data-contrast=\"none\">0.25<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"3\">\n<td data-celllook=\"69905\"><b><span data-contrast=\"none\">PP<\/span><\/b><span data-contrast=\"none\"> &#8211; able to make it to end of course<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<td data-celllook=\"69905\"><span data-contrast=\"none\">0.25<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"4\">\n<td data-celllook=\"69905\"><b><span data-contrast=\"none\">PP \u2013 <\/span><\/b><span data-contrast=\"none\">Able to make it to end of alt course<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<td data-celllook=\"69905\"><span data-contrast=\"none\">0.25<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"5\">\n<td data-celllook=\"69905\"><b><span data-contrast=\"none\">SL <\/span><\/b><span data-contrast=\"none\">&#8211; create basic algorithm (with help)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<td data-celllook=\"69905\"><span data-contrast=\"none\">0.25<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"6\">\n<td data-celllook=\"69905\"><b><span data-contrast=\"none\">SL <\/span><\/b><span data-contrast=\"none\">\u2013 Add more sensors, edit algorithm<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<td data-celllook=\"69905\"><span data-contrast=\"none\">0.25<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"7\">\n<td data-celllook=\"69905\"><b><span data-contrast=\"none\">SL <\/span><\/b><span data-contrast=\"none\">&#8211; able to make it to end of course<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<td data-celllook=\"69905\"><span data-contrast=\"none\">0.25<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"8\">\n<td data-celllook=\"69905\"><b><span data-contrast=\"none\">SL \u2013 <\/span><\/b><span data-contrast=\"none\">able to make it to end of alt course<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<td data-celllook=\"69905\"><span data-contrast=\"none\">0.25<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"9\">\n<td data-celllook=\"69905\"><span data-contrast=\"none\">Stay until end of lab, OR complete all other tasks<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<td data-celllook=\"69905\"><span data-contrast=\"none\">0.25<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559740&quot;:240}\">\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Pre-Lab: Please submit on Canvas before\u00a0the start of your lab Download the code for the lab here Please install Unity version 2020.3.40f1 for this lab using the Unity Hub button from the given link. In the install settings make sure all checkboxes are left unchecked!. This will be the version of Unity used in all [&hellip;]<\/p>\n","protected":false},"author":92052,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1599","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blogs.ubc.ca\/cogs300\/wp-json\/wp\/v2\/pages\/1599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.ubc.ca\/cogs300\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.ubc.ca\/cogs300\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.ubc.ca\/cogs300\/wp-json\/wp\/v2\/users\/92052"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ubc.ca\/cogs300\/wp-json\/wp\/v2\/comments?post=1599"}],"version-history":[{"count":11,"href":"https:\/\/blogs.ubc.ca\/cogs300\/wp-json\/wp\/v2\/pages\/1599\/revisions"}],"predecessor-version":[{"id":1727,"href":"https:\/\/blogs.ubc.ca\/cogs300\/wp-json\/wp\/v2\/pages\/1599\/revisions\/1727"}],"wp:attachment":[{"href":"https:\/\/blogs.ubc.ca\/cogs300\/wp-json\/wp\/v2\/media?parent=1599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}