{"id":414,"date":"2020-05-07T20:56:20","date_gmt":"2020-05-07T20:56:20","guid":{"rendered":"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/?p=414"},"modified":"2020-12-19T03:28:22","modified_gmt":"2020-12-19T03:28:22","slug":"behavior-planning-subsystem","status":"publish","type":"post","link":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/2020\/05\/07\/behavior-planning-subsystem\/","title":{"rendered":"Behavior Planner"},"content":{"rendered":"<p><span style=\"color: #000000\">The behavior planner is a high-level level planner making decisions which are then further decomposed to low-level trajectories by a low-level planner and executed by the control system of the vehicle. In our case the behavior planner would issue high-level commands like accelerate, decelerate, lane change, maintain a constant speed.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><span style=\"color: #000000\">The behavior planner is modeled as an RL (Reinforcement learning) agent, a DQN (Deep Q Network) is used in this case. This planner is trained over numerous episodes of varied types of the scenario it is meant to work in. For example, a lane change agent is trained to perform lane changes in varied traffic densities and varied NPC (Non-player characters) velocities.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><span style=\"color: #000000\">The behavior planner takes a state vector representation as the input. The state vector representation which was used was a concatenation of the ego vehicle state and five closest NPC states into a single vector. The state contains the pose and velocity of the vehicle. The NPC states are represented in a coordinate frame relative to the ego vehicle.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><span style=\"color: #000000\">During the design of the behavior planner, several alternatives were considered for the state representation and the neural network architectures. After testing out the results of the system, we finalized on the system described above. The following design options were considered for the behavior planner-<\/span><\/p>\n<p><span style=\"color: #000000\">For the state vector,<\/span><\/p>\n<ol>\n<li><span style=\"color: #000000\">NPC states represented in the global coordinate frame.<\/span><\/li>\n<li><span style=\"color: #000000\">NPC states represented in a frame relative to the ego vehicle.<\/span><\/li>\n<\/ol>\n<p><span style=\"color: #000000\">For the neural network,<\/span><\/p>\n<ol>\n<li><span style=\"color: #000000\">A set of fully connected layers, without ant state embedding.<\/span><\/li>\n<li><span style=\"color: #000000\">A set of shareable layers, to produce a state embedding, followed by a set of fully connected layers.<\/span><\/li>\n<\/ol>\n<p><span style=\"color: #000000\">Based on multiple experiment results, we decided that for the state vector we chose option \u20182\u2019 and for the neural network we chose option \u20182\u2019.<\/span><\/p>\n<div id=\"attachment_421\" style=\"width: 678px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-421\" class=\"wp-image-421 size-full\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/05\/NeuralNet.png\" alt=\"\" width=\"668\" height=\"300\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/05\/NeuralNet.png 668w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/05\/NeuralNet-250x112.png 250w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/05\/NeuralNet-300x135.png 300w\" sizes=\"auto, (max-width: 668px) 100vw, 668px\" \/><p id=\"caption-attachment-421\" class=\"wp-caption-text\"><\/span> <span style=\"color: #000000\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Network Architecture of the Behavior Planner<\/span><\/p><\/div>\n<p><span style=\"color: #000000\">In the above figure, the neural network architecture used to implement the behavior planner is shown. The network has two parts in it- a set of shared layers which compute activations on each pair of NPC and ego vehicle state and a set of fully connected layers which finally produce the q-values for each action which can be taken.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><span style=\"color: #000000\">In the first part of the network, the fact that the decisions which need to be taken are somehow related to the interaction of the NPCs with the ego vehicle is taken leverage of. Therefore, the first part of the network computes activations by considering pairs of ego vehicle and NPC states and then taking a max pool on these activations. This final sixty-four length vector can be considered as a state embedding for the deep Q network. The second part of the network is a set of layers with ReLU activations and a final layer with Tanh activation. The output of the network is taken as the q-values of the MDP being modeled by the network.<\/span><\/p>\n<p><span style=\"color: #000000\">With the same algorithm, we have updated the neural network structures for the tasks we are undertaking, namely:<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000\">Lane changing<\/span><\/li>\n<li><span style=\"color: #000000\">Lane Following<\/span><\/li>\n<li><span style=\"color: #000000\">Intersection negotiation<\/span><\/li>\n<\/ul>\n\n\n<p><strong><span style=\"text-decoration: underline\"><span class=\"has-inline-color has-black-color\">Network Structure for Lane Changing:<\/span><\/span><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"531\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/network_for_lane_changing-1024x531.png\" alt=\"\" class=\"wp-image-559\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/network_for_lane_changing-1024x531.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/network_for_lane_changing-300x155.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/network_for_lane_changing-250x130.png 250w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/network_for_lane_changing-768x398.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/network_for_lane_changing-1536x796.png 1536w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/network_for_lane_changing-2048x1061.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong><span style=\"text-decoration: underline\"><span class=\"has-inline-color has-black-color\">Network Structure for Lane Following:<\/span><\/span><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"519\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/lane-following-1024x519.png\" alt=\"\" class=\"wp-image-560\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/lane-following-1024x519.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/lane-following-300x152.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/lane-following-250x127.png 250w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/lane-following-768x389.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/lane-following-1536x778.png 1536w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/lane-following-2048x1038.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><span style=\"text-decoration: underline\"><strong><span class=\"has-inline-color has-black-color\">Network Structure for Go-Straight<\/span><\/strong><\/span><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"483\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/go_straight-1024x483.png\" alt=\"\" class=\"wp-image-561\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/go_straight-1024x483.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/go_straight-300x142.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/go_straight-250x118.png 250w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/go_straight-768x362.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/go_straight-1536x725.png 1536w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/go_straight-2048x966.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong><span style=\"text-decoration: underline\"><span class=\"has-inline-color has-black-color\">Network Structure for Turning Left<\/span><\/span><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"487\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turning-left-1024x487.png\" alt=\"\" class=\"wp-image-564\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turning-left-1024x487.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turning-left-300x143.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turning-left-250x119.png 250w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turning-left-768x365.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turning-left-1536x730.png 1536w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turning-left-2048x974.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong><span style=\"text-decoration: underline\"><span class=\"has-inline-color has-black-color\">Network Structure for Turning Right<\/span><\/span><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turn-right-1024x480.png\" alt=\"\" class=\"wp-image-565\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turn-right-1024x480.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turn-right-300x141.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turn-right-250x117.png 250w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turn-right-768x360.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turn-right-1536x720.png 1536w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/10\/turn-right-2048x960.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The behavior planner is a high-level level planner making decisions which are then further decomposed to low-level trajectories by a low-level planner and executed by the control system of the vehicle. In our case the behavior planner would issue high-level commands like accelerate, decelerate, lane change, maintain a constant speed. \u00a0 The behavior planner is<br \/><a class=\"moretag\" href=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/2020\/05\/07\/behavior-planning-subsystem\/\">+ Read More<\/a><\/p>\n","protected":false},"author":196,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,1],"tags":[],"class_list":["post-414","post","type-post","status-publish","format-standard","hentry","category-implementation","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/posts\/414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/users\/196"}],"replies":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/comments?post=414"}],"version-history":[{"count":7,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/posts\/414\/revisions"}],"predecessor-version":[{"id":672,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/posts\/414\/revisions\/672"}],"wp:attachment":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/media?parent=414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/categories?post=414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/tags?post=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}