{"id":150,"date":"2020-02-19T21:06:55","date_gmt":"2020-02-19T21:06:55","guid":{"rendered":"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/?p=150"},"modified":"2020-10-10T02:24:04","modified_gmt":"2020-10-10T02:24:04","slug":"simulation-subsystem","status":"publish","type":"post","link":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/2020\/02\/19\/simulation-subsystem\/","title":{"rendered":"Simulation Subsystem"},"content":{"rendered":"<p style=\"text-align: left\"><span style=\"color: #000000\">The system needs to simulate the environment and external agent behaviors realistically. This<\/span><br \/><span style=\"color: #000000\">is an important requirement if the system needs to work in real-world scenarios. Therefore,<\/span><br \/><span style=\"color: #000000\">CARLA was the best choice, one of the most realistic simulators out there. Additionally, it also<\/span><br \/><span style=\"color: #000000\">has a good developer community for support.<\/span><\/p>\n<p style=\"text-align: left\"><span style=\"color: #000000\">CARLA can provide simulated sensor data streams of cameras, lidars, and radars. The sensors<\/span><br \/><span style=\"color: #000000\">can be virtually placed anywhere in the environment or agent. This sensor placement will be<\/span><br \/><span style=\"color: #000000\">made realistically which can be replicated in the real world later. Additionally, in order to<\/span><br \/><span style=\"color: #000000\">accelerate development, we plan on initially getting data abstractions like segmentation maps<\/span><br \/><span style=\"color: #000000\">and bounding boxes directly from the simulator.<\/span><\/p>\n<p style=\"text-align: left\"><span style=\"color: #000000\">There are two main inputs to this subsystem one from the user and one from the system. The<\/span><br \/><span style=\"color: #000000\">user inputs the types of behaviors of traffic that need to be generated. The simulation<\/span><br \/><span style=\"color: #000000\">subsystem must produce a diverse set of scenarios in order to ensure our RL agent doesn\u2019t<\/span><br \/><span style=\"color: #000000\">overfit to just a few scenarios. Furthermore, the system provides continuous trajectories<\/span><br \/><span style=\"color: #000000\">that need to be tracked by the agent. The input trajectory is tracked by the simulator and<\/span><br \/><span style=\"color: #000000\">updated sensor data streams produced from the updated environment will be sent to the next<\/span><br \/><span style=\"color: #000000\">phase.<\/span><\/p>\n<p style=\"text-align: left\"><span style=\"color: #000000\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-213\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/capture_scenefinal-300x225.png\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/capture_scenefinal-300x225.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/capture_scenefinal.png 400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/span><\/p>\n<p style=\"text-align: left\"><span style=\"color: #000000\">Figure: Camera Stream\u00a0in Carla Simulation environment<\/span><\/p>\n<p style=\"text-align: left\">\u00a0<\/p>\n<h2 style=\"text-align: left\"><span style=\"color: #000000\">Pedestrian Modelling<\/span><\/h2>\n<p style=\"text-align: left\"><span style=\"color: #000000\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-487 size-medium alignnone\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/pedestrian-300x272.png\" alt=\"\" width=\"300\" height=\"272\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/pedestrian-300x272.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/pedestrian-250x227.png 250w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/pedestrian-768x696.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/pedestrian.png 953w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/span><\/p>\n<p style=\"text-align: left\"><span style=\"color: #000000\">Figure: Modelling pedestrian crossing behaviour in CARLA<\/span><\/p>\n<p style=\"text-align: left\"><span style=\"color: #000000\">We are also utilizing CARLA to train pedestrian detection and avoidance to our RL agent. We spawn a pedestrian in simulation and train our agent to avoid colliding with it while it crosses the road.<\/span><\/p>\n<p style=\"text-align: left\">\u00a0<\/p>\n<h2 style=\"text-align: left\"><span style=\"font-size: 24px;color: #000000\">Improving Simulation Performance:<\/span><\/h2>\n<p style=\"text-align: left\"><span style=\"font-weight: 400;color: #000000\">The \u2018performance\u2019 of CARLA is defined as the maximum simulated frames per second (fps) that can be obtained from CARLA during training runs, while minimizing the impact on computing resources so they may be used by other processes. There are several ways CARLA\u2019s actual and perceived performance can be improved that are listed below.\u00a0<\/span><\/p>\n<ul style=\"text-align: left\">\n<li style=\"font-weight: 400\"><span style=\"color: #000000\"><span style=\"font-weight: 400\">Reducing graphics overhead (<\/span><b>No-rendering mode, graphics API<\/b><span style=\"font-weight: 400\">)<\/span><\/span>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"color: #000000\"><span style=\"font-weight: 400\">Take a look at the <\/span><a style=\"color: #000000\" href=\"https:\/\/carla.readthedocs.io\/en\/0.9.8\/adv_rendering_options\/\"><span style=\"font-weight: 400\">Rendering options<\/span><\/a><span style=\"font-weight: 400\">. Rendering only serves a visual purpose. We should be disabling it during training. It can be enabled either during carla initialization or during runtime with the config file<\/span><\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p style=\"text-align: left\"><span style=\"color: #000000\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-547\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/no-render-300x171.png\" alt=\"\" width=\"551\" height=\"314\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/no-render-300x171.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/no-render-1024x583.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/no-render-250x142.png 250w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/no-render-768x437.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-content\/uploads\/sites\/43\/2020\/02\/no-render.png 1244w\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" \/><\/span><\/p>\n<p style=\"text-align: left\"><span style=\"color: #000000\">Figure: Carla&#8217;s no render mode rendering only basic graphics.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;text-align: left\"><span style=\"font-weight: 400;color: #000000\">Graphics opengl vs Vulcan: Performance can also be increased by using open-gl mode rather than the vulcan graphics mode<\/span><\/li>\n<li><span style=\"color: #000000\">Hybrid Physics Mode:<\/span>\n<ul>\n<li style=\"font-weight: 400;text-align: left\"><span style=\"font-weight: 400;color: #000000\">Disable physics calculations of vehicles outside of a certain distance away from the vehicle<\/span><\/li>\n<li style=\"font-weight: 400;text-align: left\"><span style=\"font-weight: 400;color: #000000\">Faster computation of Traffic Manager<\/span><\/li>\n<li style=\"font-weight: 400;text-align: left\"><span style=\"font-weight: 400;color: #000000\">May be able to disable physics altogether, only rely on collisions<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The system needs to simulate the environment and external agent behaviors realistically. Thisis an important requirement if the system needs to work in real-world scenarios. Therefore,CARLA was the best choice, one of the most realistic simulators out there. Additionally, it alsohas a good developer community for support. CARLA can provide simulated sensor data streams of<br \/><a class=\"moretag\" href=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/2020\/02\/19\/simulation-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],"tags":[],"class_list":["post-150","post","type-post","status-publish","format-standard","hentry","category-implementation"],"_links":{"self":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/posts\/150","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=150"}],"version-history":[{"count":10,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":677,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/posts\/150\/revisions\/677"}],"wp:attachment":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamd\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}