{"id":3432,"date":"2019-09-25T12:00:02","date_gmt":"2019-09-25T10:00:02","guid":{"rendered":"https:\/\/blogs.mathworks.com\/student-lounge\/?p=3432"},"modified":"2021-12-08T13:39:34","modified_gmt":"2021-12-08T18:39:34","slug":"robotics-r2019b","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/student-lounge\/2019\/09\/25\/robotics-r2019b\/","title":{"rendered":"What&#8217;s New in MATLAB R2019b for Robotics?"},"content":{"rendered":"<p>In MATLAB R2019b, there are major product updates and new toolboxes. You can look at the <a href=\"https:\/\/www.mathworks.com\/help\/relnotes\/\">release notes<\/a> for a complete list, but this blog has the capabilities I find most exciting and relevant to robotics and autonomous systems.<\/p>\n<h1><strong>Robot Simulation <\/strong><\/h1>\n<p><a href=\"https:\/\/www.mathworks.com\/products\/robotics.html\">Robotics System Toolbox<\/a> retains a collection of specialized modeling and simulation tools for different types of robots. It specifically focuses on providing low-fidelity robot models, where the low-level controls are representative of a realistic system, so you can quickly test higher-level algorithms for motion planning, task planning, and behavior. In addition, there are more detailed analysis tools that provide support for low-level control design workflows.<\/p>\n<h2>Manipulators<\/h2>\n<p>There is now a <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/ref\/loadrobot.html\">library of commercial robot models<\/a>, low-fidelity <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/ref\/jointspacemotionmodel.html\">joint-space<\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/ref\/taskspacemotionmodel.html\">task-space<\/a> motion models that capture the behavior of common closed-loop control strategies, and <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/collision-detection.html\">collision detection<\/a> between simple shapes or meshes. All of these integrate with the tools for kinematics and dynamics analysis and trajectory planning that already existed in previous releases of Robotics System Toolbox.<\/p>\n<p>Make sure to check out the new robot manipulator examples that range from <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/examples\/plan-and-execute-trajectory-kinova-gen3.html\">basic trajectory planning<\/a> to <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/examples\/pick-and-place-workflow-using-stateflow.html\">complete pick-and-place task planning<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"900\" height=\"350\" class=\"aligncenter size-full wp-image-3438\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2019\/09\/robotics_19b_pickplace.gif\" alt=\"\" \/><\/p>\n<h2>Ground Vehicles\/Mobile Robots<\/h2>\n<p>For mobile robots, there are new <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/examples\/simulate-different-kinematic-models-for-mobile-robots.html\">low-fidelity kinematic motion models<\/a> for different types of mobile platforms \u2013 most commonly differential drive and car-like vehicles. These models can connect with the sensor models and path planners included in Navigation Toolbox (see the next section for more detail) to prototype autonomous navigation algorithms. They can also be used to design model-based path planners and followers such as <a href=\"https:\/\/www.mathworks.com\/products\/mpc.html\">Model Predictive Control<\/a>.<\/p>\n<p>Make sure to check out the new warehouse robot examples that range from <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/examples\/plan-path-for-a-differential-drive-robot-in-simulink.html\">basic path planning for a single robot<\/a> to <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/examples\/control-and-simulate-multiple-warehouse-robots.html\">task planning and coordination for a swarm of robots<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"870\" height=\"230\" class=\"aligncenter size-full wp-image-3440\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2019\/09\/robotics_19b_warehouse.gif\" alt=\"\" \/><\/p>\n<h2>Gazebo Cosimulation<\/h2>\n<p>There is now a direct interface between Simulink and the <a href=\"http:\/\/gazebosim.org\/\">Gazebo simulator<\/a>.<\/p>\n<p>We have been able to connect to Gazebo through ROS in the past, but with a direct interface a Simulink model can now drive execution of the Gazebo world so the dynamics in both tools are always in sync. This will enable you to use Simulink for designing <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/examples\/control-a-differential-drive-robot-in-simulink-and-gazebo.html\">control algorithms<\/a> while <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/examples\/perform-co-simulation-between-simulink-and-gazebo.html\">getting synthetic sensor data<\/a> (such as images and lidar) from Gazebo.<\/p>\n<p>My personal favorite application of this technology is towards the training of reinforcement learning (RL) agents, which typically require the action at one time step to lead to an observation at the next time step. Below is my attempt at training a simulated <a href=\"https:\/\/www.kinovarobotics.com\/en\/products\/robotic-arms\/gen3-ultra-lightweight-robot\">Kinova Gen3 robot arm<\/a> to place its gripper near an object using the <a href=\"https:\/\/www.mathworks.com\/help\/reinforcement-learning\/ug\/ddpg-agents.html\">Deep Deterministic Policy Gradient (DDPG) algorithm<\/a>. With Gazebo as my environment, the observation input includes images from the arm-mounted camera so I can train agents based on <a href=\"https:\/\/www.mathworks.com\/discovery\/convolutional-neural-network-matlab.html\">convolutional neural networks (CNNs)<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"550\" height=\"250\" class=\"aligncenter size-full wp-image-3442\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2019\/09\/robotics_19b_gen3rl_small.gif\" alt=\"\" \/><\/p>\n<p>Learn more about Robotics System Toolbox below.<\/p>\n<p><div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"4110164366001\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div><\/p>\n<p>&nbsp;<\/p>\n<h1><strong>Navigation and Motion Planning<\/strong><\/h1>\n<p>The need for autonomous navigation technology exists across various types of platforms, whether they be mobile robots, manipulators, humanoids, self-driving cars, or any other autonomous vehicles (air, space, land, water, or otherwise).<\/p>\n<p><a href=\"https:\/\/www.mathworks.com\/products\/navigation.html\">Navigation Toolbox<\/a> contains a stack of algorithms that span the navigation workflow for any generic system. This workflow can roughly be broken down into <strong>localization and mapping<\/strong> (and the combined SLAM), <strong>path planning<\/strong>, and <strong>path following<\/strong> (which includes obstacle avoidance). The most significant updates for this release are in mapping and path planning, but I would encourage you to look through the <a href=\"https:\/\/www.mathworks.com\/help\/nav\/index.html\">Navigation Toolbox documentation page<\/a> so you can see all that is available.<\/p>\n<p>The major new mapping feature is <a href=\"https:\/\/www.mathworks.com\/help\/nav\/ug\/create-egocentric-occupancy-maps-using-range-sensors.html\"><em>egocentric occupancy maps<\/em><\/a>, also known as <em>local maps<\/em>. Egocentric maps are typically smaller regions (compared to the full global map) based around the robot coordinate frame. These maps are designed to efficiently move with the immediate surroundings of the robot. Whereas global maps are used for start-to-goal path planning, local maps are usually present in path following tasks such as path correction or obstacle avoidance.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"360\" class=\"aligncenter size-full wp-image-3450\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2019\/09\/robotics_19b_egomap.gif\" alt=\"\" \/><\/p>\n<p style=\"text-align: center;\"><em>[Left] A simulated robot following a path planned using a global occupancy map. [Right] Egocentric occupancy map created from the simulated lidar scans of the robot.<\/em><\/p>\n<p>There is also a new example on <a href=\"https:\/\/www.mathworks.com\/help\/nav\/ug\/perform-lidar-slam-using-3d-lidar-point-clouds.html\">3D SLAM using lidar point clouds<\/a> which shows how you can combine the 3D occupancy map and pose graph backends with the point cloud processing capabilities in MATLAB.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"960\" height=\"360\" class=\"aligncenter size-full wp-image-3452\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2019\/09\/robotics_19b_3dslam.gif\" alt=\"\" \/><\/p>\n<p>Navigation Toolbox contains sampling-based path planners such as <a href=\"https:\/\/www.mathworks.com\/help\/nav\/ref\/plannerhybridastar.html\">Hybrid A*<\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/nav\/ref\/plannerrrt.html\">Rapidly-Exploring Random Tree (RRT)<\/a>. Unlike the <a href=\"https:\/\/www.mathworks.com\/help\/robotics\/ug\/probabilistic-roadmaps-prm.html\">Probabilistic Roadmap (PRM)<\/a> planner that already existed in previous releases, these new planners are able to handle <em>nonholonomic constraints<\/em> \u2013 in simpler words, they can sample motions that are consistent with the constraints of real systems, such as minimum turning radius for a car-like robot, or collision-free configurations for a multi-link robot.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"397\" class=\"aligncenter size-large wp-image-3454\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2019\/09\/robotics_19b_pathplanners-1024x397.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: center;\"><em>[Left] Path planning with RRT* for a car-like vehicle with limited turning radius. [Right] Hybrid A* planning for a car-like vehicle for an autonomous parking maneuver<\/em><\/p>\n<p>An exciting thing (to me) about Navigation Toolbox is that its infrastructure for path planning has been designed with both beginners and developers in mind. While there will be some built-in utilities for common problems (like path planning for a 2D car-like vehicle), the entire set of state spaces, state validators, and planners is customizable. There are some examples included that demonstrate this, such as a <a href=\"https:\/\/www.mathworks.com\/help\/nav\/ug\/moving-furniture-in-a-cluttered-room-with-rrt.html\">variation of the famous \u201cPiano Mover\u2019s Problem\u201d<\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/nav\/ug\/motion-planning-with-rrt-for-manipulators.html\">collision-aware manipulator motion planning with RRT<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"850\" height=\"380\" class=\"aligncenter size-full wp-image-3456\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2019\/09\/robotics_19b_rrtmanip.gif\" alt=\"\" \/><\/p>\n<p>Learn more about Navigation Toolbox below.<\/p>\n<p><div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"6084960176001\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div><\/p>\n<h1><strong>ROS Connectivity<\/strong><\/h1>\n<p>Everything to do with ROS connectivity and node deployment is now packaged into the new <a href=\"https:\/\/www.mathworks.com\/products\/ros.html\">ROS Toolbox<\/a>.<\/p>\n<p>The major update is that <strong>ROS Toolbox supports both ROS and ROS 2!<\/strong> Since ROS 2 was designed to be supported on most popular operating systems, including Windows 10, OS X El Capitan, and Ubuntu 16.04 and 18.04, ROS Toolbox directly uses the native ROS 2 libraries in all these operating systems.<\/p>\n<p>You will see a few application examples included in ROS Toolbox, including the <a href=\"https:\/\/www.mathworks.com\/help\/ros\/ug\/ros-sign-following.html\">sign following robot<\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/ros\/ug\/ros-automated-valet.html\">automated parking valet<\/a>. Both examples have variations that demonstrate MATLAB and Simulink workflows with ROS and ROS 2.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"960\" height=\"540\" class=\"aligncenter size-full wp-image-3460\" src=\"https:\/\/blogs.mathworks.com\/racing-lounge\/files\/2019\/09\/robotics_19b_sign_following.gif\" alt=\"\" \/><\/p>\n<p>In the future, the plan is to keep up with the long-term support releases of ROS and ROS 2, as well as flesh out the available functionality in both MATLAB and Simulink centered development. This includes working with ROS bag logfiles, prototyping through desktop simulation, and finally generating distributed networks of standalone executable nodes, as is the common design paradigm of deployed ROS enabled systems.<\/p>\n<p>Learn more about ROS Toolbox below.<\/p>\n<p><div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"6076102138001\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div><\/p>\n<h1><strong>How to Learn More<\/strong><\/h1>\n<p>Now that we gave a brief introduction of some of the new capabilities, we hope you will see the full list of features in these new and updated toolboxes and try any relevant examples. To try out Gazebo cosimulation and ROS 2 connectivity, you can download our new <a href=\"https:\/\/www.mathworks.com\/support\/product\/robotics\/ros2-vm-installation-instructions.html\">virtual machine image<\/a> which has all these tools installed and configured.<\/p>\n<p>We would also be interested to hear from you.<\/p>\n<ul>\n<li>What robotics projects are you working on?<\/li>\n<li>Which new feature(s) are you most interested to try?<\/li>\n<li>Is anything still missing that could help you with your work?<\/li>\n<\/ul>\n<p>If you have any questions, you can always leave a comment or reach us at <a href=\"mailto:roboticsarena@mathworks.com\">roboticsarena@mathworks.com<\/a> or on <a href=\"https:\/\/www.facebook.com\/groups\/RoboticsArena\/\">Facebook<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"thumbnail thumbnail_asset asset_overlay video\"><a href=\"https:\/\/blogs.mathworks.com\/student-lounge\/2019\/09\/25\/robotics-r2019b\/?dir=autoplay\"><img decoding=\"async\" src=\"https:\/\/cf-images.us-east-1.prod.boltdns.net\/v1\/static\/62009828001\/9d61307b-f891-4850-ab1d-a68608808784\/3207956e-a891-4e53-89b5-08bb07e57ef8\/1280x720\/match\/image.jpg\" onError=\"this.style.display ='none';\"\/><\/p>\n<div class=\"overlay_container\">\n      <span class=\"icon-video icon_color_null\"><time class=\"video_length\">1:56<\/time><\/span>\n      <\/div>\n<p>      <\/a><\/div>\n<p>In MATLAB R2019b, there are major product updates and new toolboxes. You can look at the release notes for a complete list, but this blog has the capabilities I find most exciting and relevant to&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/student-lounge\/2019\/09\/25\/robotics-r2019b\/\">read more >><\/a><\/p>\n","protected":false},"author":155,"featured_media":3460,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,14,8],"tags":[96,340,308,338,94,24],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/3432"}],"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\/155"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/comments?post=3432"}],"version-history":[{"count":9,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/3432\/revisions"}],"predecessor-version":[{"id":7021,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/3432\/revisions\/7021"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/media\/3460"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/media?parent=3432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/categories?post=3432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/tags?post=3432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}