{"id":5534,"date":"2021-04-26T00:06:31","date_gmt":"2021-04-25T22:06:31","guid":{"rendered":"https:\/\/blogs.mathworks.com\/student-lounge\/?p=5534"},"modified":"2025-02-20T14:12:11","modified_gmt":"2025-02-20T19:12:11","slug":"building-an-autonomous-vehicle-av-simulation-toolchain-with-simulink-roadrunner-and-nvidia-drive-sim","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/student-lounge\/2021\/04\/26\/building-an-autonomous-vehicle-av-simulation-toolchain-with-simulink-roadrunner-and-nvidia-drive-sim\/","title":{"rendered":"Building an Autonomous Vehicle (AV) Simulation Toolchain with Simulink, RoadRunner and NVIDIA DRIVE Sim"},"content":{"rendered":"<p>Today&#8217;s blog is written by MathWorks Product Marketing team: <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/4291457\">Avi Nehemiah<\/a>, <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/17221328\">Peter Fryscak<\/a> and <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/8068997\">Mike Sasena<\/a>.<\/p>\n<p><span data-contrast=\"auto\">This blog will provide an overview of how three of MathWorks\u2019 platforms\u00a0\u2014\u00a0 MATLAB, Simulink and\u00a0<\/span><span data-contrast=\"auto\">RoadRunner<\/span><span data-contrast=\"auto\">\u00a0\u2014 integrate with and support workflows for autonomous vehicle (AV) developers using\u00a0<\/span><a href=\"https:\/\/www.nvidia.com\/en-us\/self-driving-cars\/drive-constellation\/\"><span data-contrast=\"none\">NVIDIA DRIVE Sim<\/span><\/a><span data-contrast=\"auto\">, a platform for scalable, physically accurate, and diverse simulation.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-5538 size-large\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-1-3-MW-technologies-for-NVIDIA-1024x367.png\" alt=\"\" width=\"1024\" height=\"367\" \/><\/p>\n<p><span data-contrast=\"auto\">This\u00a0<\/span><span data-contrast=\"auto\">two-part<\/span><span data-contrast=\"auto\">\u00a0blog series covers the two ways MathWorks platforms support AV developers using NVIDIA DRIVE Sim<\/span><span data-contrast=\"auto\">\u00a0or deploying algorithms to\u00a0<\/span><span data-contrast=\"auto\">NVIDIA hardware.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri, Calibri_MSFontService, sans-serif\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Part 1 &#8211;\u00a0<\/span><span data-contrast=\"auto\">Integration with DRIVE Sim for e<\/span><span data-contrast=\"auto\">nvironment\u00a0<\/span><span data-contrast=\"auto\">m<\/span><span data-contrast=\"auto\">odeling<\/span><span data-contrast=\"auto\">\u00a0and vehicle dynamics<\/span><span data-contrast=\"auto\">:<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">H<\/span><span data-contrast=\"auto\">ow MathWorks tools integrate with DRIVE Sim to<\/span><span data-contrast=\"auto\">:<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\n<ol>\n<li data-leveltext=\"%1.\" data-font=\"Calibri, Calibri_MSFontService, sans-serif\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">D<\/span><span data-contrast=\"auto\">esign<\/span><span data-contrast=\"auto\">\u00a03D networks and scenes\u00a0<\/span><span data-contrast=\"auto\">for simulation using\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/products\/roadrunner.html\"><span data-contrast=\"none\">RoadRunner<\/span><\/a><span data-contrast=\"auto\">\u00a0and the\u00a0<\/span><span data-contrast=\"auto\">DRIVE\u202fSim\u202fconnector\u202fto\u202f<\/span><span data-contrast=\"auto\">RoadRunner<\/span><span data-contrast=\"auto\">\u202f<\/span><span data-contrast=\"auto\">to export simulation-ready environments\u00a0<\/span><span data-contrast=\"auto\">to<\/span><span data-contrast=\"auto\">\u202fOmniverse.\u202f<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"%1.\" data-font=\"Calibri, Calibri_MSFontService, sans-serif\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Couple<\/span><span data-contrast=\"auto\">\u00a0high-fidelity vehicle dynamics models<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">from\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/products\/vehicle-dynamics.html\"><span data-contrast=\"none\">Vehicle Dynamics\u00a0<\/span><span data-contrast=\"none\">Blockset<\/span><\/a><span data-contrast=\"auto\">\u00a0in<\/span><span data-contrast=\"auto\">\u00a0Simulink<\/span><span data-contrast=\"auto\">\u00a0with the DRIVE Sim ego-vehicle.<\/span><\/li>\n<\/ol>\n<\/li>\n<li><span data-contrast=\"auto\">Part 2 &#8211;\u00a0\u00a0<\/span><span data-contrast=\"auto\">Deploy algorithms to\u00a0<\/span><span data-contrast=\"auto\">DRIVE platforms:<\/span><span data-contrast=\"auto\">\u00a0 H<\/span><span data-contrast=\"auto\">ow to\u00a0<\/span><span data-contrast=\"auto\">g<\/span><span data-contrast=\"auto\">e<\/span><span data-contrast=\"auto\">nerate optimized CUDA code from MATLAB code and Simulink models<\/span><span data-contrast=\"auto\">\u00a0using\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/products\/vehicle-dynamics.html\"><span data-contrast=\"none\">GPU Coder<\/span><\/a><span data-contrast=\"auto\">\u00a0and\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/products\/embedded-coder.html\"><span data-contrast=\"none\">Embedded Coder<\/span><\/a><span data-contrast=\"auto\">\u00a0for deployment to NVIDIA\u00a0<\/span><span data-contrast=\"auto\">DRIVE\u00a0<\/span><span data-contrast=\"auto\">hardware.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ol>\n<h2 aria-level=\"2\"><span data-contrast=\"none\">Environment Modeling<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">AV developers need to develop realistic 3D environments to simulate and test\u00a0<\/span><span data-contrast=\"auto\">their perception, planning, and control algorithms.\u00a0<\/span><span data-contrast=\"auto\">One of the primary challenges they face is that real-world roads are complex, and it is extremely time consuming to create simulation-ready 3D scenes.\u00a0<\/span><span data-contrast=\"auto\">RoadRunner<\/span><span data-contrast=\"auto\">\u00a0is an interactive editor to design 3D scenes for simulating and testing automated driving systems. Developers can customize roadway scenes by creating region-specific road signs and markings, as well as insert signs, signals, guardrails, road damage, foliage, buildings, and other 3D models.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-5540 size-large\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-2-Complex-real-world-roads-1024x290.png\" alt=\"\" width=\"1024\" height=\"290\" \/><\/span><\/p>\n<p style=\"text-align: center;\"><i>Complex real-world road network (left)\u00a0<\/i><i>and simulation-ready environment in\u00a0<\/i><i>RoadRunner<\/i><i>\u00a0(right)<\/i><\/p>\n<p><span data-contrast=\"auto\">An AV developer can create the 3D environment below in under 30 minutes using the DRIVE Sim connector to\u00a0<\/span><span data-contrast=\"auto\">RoadRunner<\/span><span data-contrast=\"auto\">\u00a0to export it to\u00a0<\/span><a href=\"https:\/\/developer.nvidia.com\/nvidia-omniverse-platform\"><span data-contrast=\"auto\">NVIDIA<\/span><span data-contrast=\"none\">\u00a0Omniverse<\/span><\/a><span data-contrast=\"auto\">\u00a0for simulation or integration with other 3D production pipelines.\u00a0<\/span><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><\/p>\n<p style=\"text-align: center;\"><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-5542\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-3-3D-environment.png\" alt=\"\" width=\"500\" height=\"438\" \/><\/span><\/p>\n<p style=\"text-align: center;\"><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><i><span data-contrast=\"auto\">3D environment to be created in\u00a0<\/span><\/i><i><span data-contrast=\"auto\">RoadRunner<\/span><\/i><i><span data-contrast=\"auto\">\u00a0and exported to Omniverse using DRIVE Sim connector to\u00a0<\/span><\/i><i><span data-contrast=\"auto\">RoadRunner<\/span><\/i><i><span data-contrast=\"auto\">.<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The environment above can be divided into the following components:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Add<\/span><span data-contrast=\"auto\">\u00a0roads, lanes, and s<\/span><span data-contrast=\"auto\">idewalk<\/span><span data-contrast=\"auto\">s<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Create junctions<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Add junction markings and props<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">Place foliage<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">Let\u2019s start by creating the road network along with the relevant lane markings and sidewalks. To do this, the\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/roadrunner\/ref\/roadplantool.html\"><span data-contrast=\"none\">Road Plan Tool<\/span><\/a><span data-contrast=\"auto\">\u00a0in\u00a0<\/span><span data-contrast=\"auto\">RoadRunner<\/span><span data-contrast=\"auto\">\u00a0is used to create and layout roads. Then the\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/roadrunner\/ref\/lanetool.html\"><span data-contrast=\"none\">Lane Tool<\/span><\/a><span data-contrast=\"none\">\u00a0is used<\/span><span data-contrast=\"auto\">\u00a0to configure the different lanes and setup attributes of the road including direction of travel and lane type. In this\u00a0<\/span><span data-contrast=\"auto\">example,\u00a0 the<\/span><span data-contrast=\"auto\">\u00a0width of the lanes is\u00a0changed\u00a0and the sidewalk is removed from one side to match the aerial image.\u00a0 It\u2019s common for\u00a0<\/span><span data-contrast=\"auto\">RoadRunner<\/span><span data-contrast=\"auto\">\u00a0users to leverage aerial or lidar imagery of a scene to stencil over their road networks.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-5544 size-full\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-4-gif-1.gif\" alt=\"\" width=\"1920\" height=\"1080\" \/><\/span><\/p>\n<p><span data-contrast=\"auto\">Now that the road network is set up, the T-junction can then be created.\u00a0<\/span><span data-contrast=\"auto\">RoadRunner<\/span><span data-contrast=\"auto\">\u00a0automatically creates junctions when roads intersect; in this case, the T-junction is created using the\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/roadrunner\/ref\/customjunctiontool.html\"><span data-contrast=\"none\">Custom Junction Tool<\/span><\/a><span data-contrast=\"auto\">.\u00a0<\/span><span data-contrast=\"auto\">RoadRunner<\/span><span data-contrast=\"auto\">\u00a0includes a variety of\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/roadrunner\/ug\/choose-a-roadrunner-tool.html#mw_2dbf5cc0-22f7-4875-b2ef-67ce135ffed2\"><span data-contrast=\"none\">junction tools<\/span><\/a><span data-contrast=\"auto\">\u00a0to customize appearance and behavior in simulation.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-5546 size-full\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-5-gif-2-T-junction.gif\" alt=\"\" width=\"1920\" height=\"1080\" \/><\/span><\/p>\n<p><span data-contrast=\"auto\">Now the<\/span><span data-contrast=\"auto\">\u00a0junction with a stop sign<\/span><span data-contrast=\"auto\">\u00a0is updated<\/span><span data-contrast=\"auto\">\u00a0using the\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/roadrunner\/ref\/proppointtool.html\"><span data-contrast=\"none\">Prop Point Tool<\/span><\/a><span data-contrast=\"auto\">, the word \u2018Stop\u2019 painted onto the roadway using the\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/roadrunner\/ref\/markingpointtool.html\"><span data-contrast=\"none\">Marking Point Tool<\/span><\/a><span data-contrast=\"auto\">,\u00a0<\/span><span data-contrast=\"auto\">and a stop line<\/span><span data-contrast=\"auto\">\u00a0is<\/span><span data-contrast=\"auto\">\u00a0created with the\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/roadrunner\/ref\/markingcurvetool.html\"><span data-contrast=\"none\">Marking Curve Tool<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-5548 size-full\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-5-gif-3-T-juntion-with-stop-sign.gif\" alt=\"\" width=\"1920\" height=\"1080\" \/><\/span><\/p>\n<p><span data-contrast=\"auto\">With the road network and junction created<\/span><span data-contrast=\"auto\">,<\/span><span data-contrast=\"auto\">\u00a0some foliage<\/span><span data-contrast=\"auto\">\u00a0can be inserted<\/span><span data-contrast=\"auto\">\u00a0to model the environment more closely. The\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/products\/roadrunner-asset-library.html\"><span data-contrast=\"none\">RoadRunner<\/span><span data-contrast=\"none\">\u00a0Asset Library<\/span><\/a><span data-contrast=\"auto\">\u00a0provides a pre-built set of props\u00a0<\/span><span data-contrast=\"auto\">while<\/span><span data-contrast=\"auto\">\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/roadrunner\/ug\/create-import-and-modify-assets.html#mw_daa73365-7ff1-4a2e-8474-91ca6ad6bcbb\"><span data-contrast=\"none\">import assets<\/span><span data-contrast=\"none\">\u00a0can be<\/span><span data-contrast=\"none\">\u00a0created externally<\/span><\/a><span data-contrast=\"auto\">\u00a0into\u00a0<\/span><span data-contrast=\"auto\">RoadRunner<\/span><span data-contrast=\"auto\">.\u00a0 For this scene, a collection of objects\u00a0<\/span><span data-contrast=\"auto\">are<\/span><span data-contrast=\"auto\">\u00a0used\u00a0<\/span><span data-contrast=\"auto\">called a\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/roadrunner\/ref\/propsetassets.html\"><span data-contrast=\"none\">Prop Set<\/span><\/a><span data-contrast=\"auto\">.\u00a0<\/span><span data-contrast=\"auto\">\u00a0P<\/span><span data-contrast=\"auto\">rop sets<\/span><span data-contrast=\"auto\">\u00a0can be dragged<\/span><span data-contrast=\"auto\">\u00a0onto an existing prop polygon or the\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/roadrunner\/ref\/proppolygontool.html\"><span data-contrast=\"none\">Prop Polygon Tool<\/span><\/a><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">can be used\u00a0<\/span><span data-contrast=\"auto\">to fill a new area.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-5624 size-full\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/nvidiaGTC21blog04.gif\" alt=\"\" width=\"1920\" height=\"1080\" \/><\/p>\n<p><span data-contrast=\"auto\">Now with the 3D environment ready to go, the scene can be exported from\u00a0<\/span><span data-contrast=\"auto\">RoadRunner<\/span><span data-contrast=\"auto\">\u00a0to\u00a0<\/span><span data-contrast=\"auto\">Omniverse<\/span><span data-contrast=\"auto\">\u00a0using the\u00a0<\/span><span data-contrast=\"auto\">DRIVE<\/span><span data-contrast=\"auto\">\u00a0Sim connector to\u00a0<\/span><span data-contrast=\"auto\">RoadRunner<\/span><span data-contrast=\"auto\">. The example so far was based on a simple scene. Here are some images of the results from RoadRunner when modeling a more complex scene:\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"300\" height=\"157\" class=\"alignnone size-medium wp-image-5622\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/2021-04-29_22-52-13-300157-300x157.jpg\" alt=\"\" \/> <img decoding=\"async\" loading=\"lazy\" width=\"300\" height=\"157\" class=\"alignnone size-medium wp-image-5620\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/frame_11-300x157.jpg\" alt=\"\" \/>\u00a0<img decoding=\"async\" loading=\"lazy\" width=\"300\" height=\"157\" class=\"alignnone size-medium wp-image-5618\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/frame_07-300x157.jpg\" alt=\"\" \/><\/p>\n<p><span data-contrast=\"auto\">Here are the same images from DRIVE Sim after using the\u00a0DRIVE\u00a0Sim connector to\u00a0RoadRunner.\u00a0DRIVE Sim uses Omniverse RTX rendering for physics-based simulation of lights, materials and sensors based on real-time raytracing.<span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-5552 size-medium alignnone\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-7-intersection-with-building-300x170.png\" alt=\"\" width=\"300\" height=\"170\" \/>\u00a0<span data-contrast=\"none\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-5554 size-medium alignnone\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-8-intersection-at-crosswalk-300x170.png\" alt=\"\" width=\"300\" height=\"170\" \/>\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"wp-image-5596 size-medium alignnone\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Picture1-300x169.png\" alt=\"\" width=\"300\" height=\"169\" \/><\/span><\/p>\n<h2>Vehicle Dynamics<\/h2>\n<p><span data-contrast=\"auto\">In order to<\/span><span data-contrast=\"auto\">\u00a0perform vehicle level studies,\u00a0<\/span><span data-contrast=\"auto\">developers need to decide the<\/span><span data-contrast=\"auto\">\u00a0level of fidelity required for the vehicle model itself.\u00a0 In some cases, the vehicle model can be trivial.\u00a0 For example, traffic simulations often treat each vehicle as a simple mass moving through space along a specified trajectory.\u00a0 In cases such as emergency braking tests, however,\u00a0<\/span><span data-contrast=\"auto\">a<\/span><span data-contrast=\"auto\">\u00a0higher fidelity model of the vehicle<\/span><span data-contrast=\"auto\">\u00a0is needed<\/span><span data-contrast=\"auto\">.\u00a0 Vehicle Dynamics\u00a0<\/span><span data-contrast=\"auto\">Blockset<\/span><span data-contrast=\"auto\">\u00a0is a Simulink add-on product designed to help with these kinds of problems.\u00a0\u00a0<\/span><span data-contrast=\"auto\">Below are<\/span><span data-contrast=\"auto\">\u00a0a few examples of how this works.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Vehicle Dynamics\u00a0<\/span><span data-contrast=\"auto\">Blockset<\/span><span data-contrast=\"auto\">\u00a0comes with several pre-built reference applications that make it easier to get started.\u00a0 For example, the\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/vdynblks\/ug\/constant-radius.html\"><span data-contrast=\"none\">Constant Radius Maneuver<\/span><\/a><span data-contrast=\"auto\">\u00a0includes a vehicle model, complete with a driver, controllers, sensors, powertrain, wheels, brakes, steering,\u00a0<\/span><span data-contrast=\"auto\">suspension<\/span><span data-contrast=\"auto\">\u00a0and chassis.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<img decoding=\"async\" loading=\"lazy\" width=\"936\" height=\"460\" class=\"aligncenter size-full wp-image-5558\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-10-Diagram-with-car.png\" alt=\"\" \/><\/span><span data-contrast=\"auto\">These kinds of vehicle models can be quite detailed and can be parameterized to reflect\u00a0<\/span><span data-contrast=\"auto\">the<\/span><span data-contrast=\"auto\">\u00a0system of interest more accurately.\u00a0 For example, the\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/vdynblks\/ref\/mappedsiengine.html\"><span data-contrast=\"none\">Mapped SI Engine<\/span><\/a><span data-contrast=\"auto\">\u00a0model<\/span><span data-contrast=\"auto\">\u00a0can be used<\/span><span data-contrast=\"auto\">\u00a0below to calibrate\u00a0<\/span><span data-contrast=\"auto\">the<\/span><span data-contrast=\"auto\">\u00a0engine by importing test data.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<img decoding=\"async\" loading=\"lazy\" width=\"624\" height=\"468\" class=\"aligncenter size-full wp-image-5560\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-11-piston-and-torque-curve.png\" alt=\"\" \/><\/span><\/p>\n<p><span data-contrast=\"auto\">In a similar way,<\/span><span data-contrast=\"auto\">\u00a0developers can use<\/span><span data-contrast=\"auto\">\u00a0the\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/vdynblks\/ug\/kinematics-and-compliance-virtual-test-laboratory.html\"><span data-contrast=\"none\">Kinematics &amp; Compliance<\/span><\/a><span data-contrast=\"auto\">\u00a0reference application to\u00a0<\/span><span data-contrast=\"auto\">import\u00a0<\/span><span data-contrast=\"auto\">data from a suspension test or multibody dynamics simulation, fit a response surface model, and parameterize a\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/vdynblks\/ref\/independentsuspensionmapped.html\"><span data-contrast=\"none\">mapped suspension model<\/span><\/a><span data-contrast=\"auto\">\u00a0that closely mimics the real system\u2019s behavior.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<img decoding=\"async\" loading=\"lazy\" width=\"624\" height=\"352\" class=\"aligncenter size-full wp-image-5562\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-12-Suspention-Model.png\" alt=\"\" \/><\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Having parameterized the vehicle model, let\u2019s run some experiments to characterize its behavior.\u00a0 The Constant Radius reference application includes a\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/vdynblks\/ref\/referencegenerator.html\"><span data-contrast=\"none\">Reference Generator<\/span><\/a><span data-contrast=\"auto\">\u00a0which allows the developer to select from a list of pre-defined standardized tests such as a double lane change, or slowly increasing steer maneuver.\u00a0 This process starts with a constant radius test to assess the vehicle\u2019s ability to hold a fixed turn radius at the specified speed.\u00a0 By sweeping through higher and higher vehicle speeds, signals like vehicle speed, lateral acceleration and vehicle slip can be reviewed to determine if the vehicle met the system requirements.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<img decoding=\"async\" loading=\"lazy\" width=\"675\" height=\"643\" class=\"aligncenter size-full wp-image-5564\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-13-graphs-for-handling-maneuvers.png\" alt=\"\" \/><\/span><\/p>\n<p><span data-contrast=\"auto\">After testing a suite of handling maneuvers, the\u00a0<\/span><a href=\"https:\/\/www.mathworks.com\/help\/vdynblks\/ug\/braking-test.html\"><span data-contrast=\"none\">Braking Test Maneuver<\/span><\/a><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">can be run\u00a0<\/span><span data-contrast=\"auto\">to assess the vehicle\u2019s stop<\/span><span data-contrast=\"auto\">ping<\/span><span data-contrast=\"auto\">\u00a0distance from a specified initial speed.\u00a0 This reference application includes features like an ABS controller and a dialog to specify surface conditions for running a split-mu test.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"wp-image-5566 aligncenter\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-14-Block-Parameters.png\" alt=\"\" width=\"450\" height=\"358\" \/><\/span><\/p>\n<p><span data-contrast=\"auto\">With this braking test, results<\/span><span data-contrast=\"auto\">\u00a0can be compared<\/span><span data-contrast=\"auto\">\u00a0across different braking controllers and different conditions to assess the vehicle\u2019s performance.\u00a0 For example, the results below indicate that the ABS controller successfully prevents the rear wheels from locking up during the emergency braking event, thereby improving the stopping distance.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<img decoding=\"async\" loading=\"lazy\" width=\"624\" height=\"394\" class=\"aligncenter size-full wp-image-5568\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2021\/04\/Pic-15-ABS-graphs.png\" alt=\"\" \/><\/span><\/p>\n<p><span data-contrast=\"auto\">Because Vehicle Dynamics\u00a0<\/span><span data-contrast=\"auto\">Blockset<\/span><span data-contrast=\"auto\">\u00a0is built on Simulink, these kinds of simulations\u00a0<\/span><span data-contrast=\"auto\">can be run\u00a0<\/span><span data-contrast=\"auto\">on the NVDIA\u00a0<\/span><span data-contrast=\"auto\">DRIVE Sim<\/span><span data-contrast=\"auto\">\u00a0platform.\u00a0 This adds a whole new degree of\u00a0<\/span><span data-contrast=\"auto\">performance<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">and\u00a0<\/span><span data-contrast=\"auto\">flexibility, allowing\u00a0<\/span><span data-contrast=\"auto\">developers<\/span><span data-contrast=\"auto\">\u00a0to run studies much more efficiently<\/span><span data-contrast=\"auto\">\u00a0while\u00a0<\/span><span data-contrast=\"auto\">leverag<\/span><span data-contrast=\"auto\">ing<\/span><span data-contrast=\"auto\">\u00a0the\u00a0<\/span><span data-contrast=\"auto\">other capabilities available through<\/span><span data-contrast=\"auto\">\u00a0the\u00a0<\/span><span data-contrast=\"auto\">DRIVE Sim<\/span><span data-contrast=\"auto\">\u00a0ecosystem.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Check out the second part<\/span><span data-contrast=\"auto\">\u00a0of this series on deploying algorithms created in\u00a0<\/span><span data-contrast=\"auto\">MATLAB and Simulink to NVIDIA DRIVE platforms<\/span><span data-contrast=\"auto\">.\u00a0\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2021\/04\/DRIVESim_KV2.jpg\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div>\n<p>Today&#8217;s blog is written by MathWorks Product Marketing team: Avi Nehemiah, Peter Fryscak and Mike Sasena.<br \/>\nThis blog will provide an overview of how three of MathWorks\u2019 platforms\u00a0\u2014\u00a0 MATLAB,&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/student-lounge\/2021\/04\/26\/building-an-autonomous-vehicle-av-simulation-toolchain-with-simulink-roadrunner-and-nvidia-drive-sim\/\">read more >><\/a><\/p>\n","protected":false},"author":174,"featured_media":5574,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[287,8,12],"tags":[488,490,494,492],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/5534"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/users\/174"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/comments?post=5534"}],"version-history":[{"count":16,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/5534\/revisions"}],"predecessor-version":[{"id":11888,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/5534\/revisions\/11888"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/media\/5574"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/media?parent=5534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/categories?post=5534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/tags?post=5534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}