{"id":1127,"date":"2024-05-21T09:46:23","date_gmt":"2024-05-21T13:46:23","guid":{"rendered":"https:\/\/blogs.mathworks.com\/autonomous-systems\/?p=1127"},"modified":"2024-05-21T09:46:23","modified_gmt":"2024-05-21T13:46:23","slug":"accelerating-the-path-to-production-for-your-autonomous-system-with-rti-connext-and-the-ros-toolbox","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/autonomous-systems\/2024\/05\/21\/accelerating-the-path-to-production-for-your-autonomous-system-with-rti-connext-and-the-ros-toolbox\/","title":{"rendered":"Accelerating the path to production for your autonomous system with RTI Connext and the ROS Toolbox"},"content":{"rendered":"<p>Our guest blogger is Akkshaj Singh, an Application Engineer at RTI with a focus on Commercial Markets and Security. He has a background in robotics and embedded systems and is excited to work at the forefront of enabling autonomy. He holds a BS in Electrical Engineering from the University of Washington, Seattle.<\/p>\n<hr \/>\n<p>ROS 2 is now ubiquitous for developers of robotics applications across industries. As robotic and autonomous systems move from prototyping towards production and real-world integration, there are more stringent requirements and more complex coding. Often, this includes the need to interface with non-ROS 2 systems.<\/p>\n<p>MathWorks\u2019 <a href=\"https:\/\/www.mathworks.com\/products\/ros.html\">ROS Toolbox<\/a> can complement your ROS 2 system with using the tools from MATLAB and Simulink, throughout all stages of the robotic and autonomous development lifecycle. From simulation to code generation to deploying real hardware, the ROS Toolbox can accelerate the development of a production-grade ROS 2 system.<\/p>\n<p>As you move towards commercial readiness, you can also leverage ROS 2\u2019s underlying Data Distribution Service<sup>TM<\/sup> (DDS<sup>TM<\/sup>) middleware to communicate with native DDS applications. Using a native DDS implementation such as <a href=\"https:\/\/www.mathworks.com\/products\/connections\/product_detail\/connext-dds.html\">RTI Connext\u00ae<\/a> provides better performance, allows you to make granular adjustments to Quality of Service (QoS) settings, and enables easy interoperability with non-ROS components. Connext also offers integrations with either <a href=\"https:\/\/www.rti.com\/developers\/case-code\/unity-gaming\">Unity<\/a> or <a href=\"https:\/\/www.rti.com\/developers\/rti-labs\/unreal-engine\">Unreal Engine<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"562\" height=\"422\" class=\"aligncenter size-full wp-image-1130\" src=\"http:\/\/blogs.mathworks.com\/autonomous-systems\/files\/2024\/05\/Connext_Databus.png\" alt=\"\" \/><\/p>\n<p>RTI has teamed with MathWorks to simplify ROS 2 and DDS interoperability. Developers can use the ROS 2 Middleware (RMW) for RTI Connext within the MathWorks ROS Toolbox, which runs Connext directly as the middleware for your robotic and autonomous system, enabling easy communication with native Connext or other native DDS applications. The MathWorks help page referenced below <a href=\"https:\/\/www.mathworks.com\/help\/ros\/ug\/switching-between-ros-middleware-implementations.html\">shows you how<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"624\" height=\"351\" class=\"aligncenter size-full wp-image-1133\" src=\"http:\/\/blogs.mathworks.com\/autonomous-systems\/files\/2024\/05\/RMW_ConnextDDS.png\" alt=\"\" \/><\/p>\n<p>For realistic simulations, it is desirable to use Connext alongside the ROS Toolbox to communicate with simulation engines like Unreal Engine.\u00a0 To do this, you can use the Unreal Engine Plugin for RTI Connext with ROS2 data types, which is described in detail <a href=\"https:\/\/www.rti.com\/developers\/rti-labs\/unreal-engine\">here<\/a>. The plugin will publish data from Unreal Engine using Connext, allowing ROS Toolbox to subscribe to it.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"624\" height=\"337\" class=\"aligncenter size-full wp-image-1145\" src=\"http:\/\/blogs.mathworks.com\/autonomous-systems\/files\/2024\/05\/Unreal_Engine.png\" alt=\"\" \/><\/p>\n<p>Once complete, the RTI Admin Console can be used to verify that the plugin is publishing correctly:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"551\" height=\"455\" class=\"aligncenter size-full wp-image-1136\" src=\"http:\/\/blogs.mathworks.com\/autonomous-systems\/files\/2024\/05\/RTI_Admin_Console.png\" alt=\"\" \/><\/p>\n<p>Then, the ROS Toolbox can subscribe to the data. Enter ros2 topic list, and you should see the \/topic_Point appear, indicating that the ROS Toolbox detects the data published by Unreal Engine.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"144\" height=\"81\" class=\"alignnone size-full wp-image-1139\" src=\"http:\/\/blogs.mathworks.com\/autonomous-systems\/files\/2024\/05\/Code_ros2_topic_list.png\" alt=\"\" \/><\/p>\n<p>To set up a node and a subscriber:<\/p>\n<p>&gt;&gt;unreal = ros2node (&#8220;\/unreal2matlab&#8221;)<\/p>\n<p>&gt;&gt;pointSub = ros2subscriber(unreal, &#8220;\/topic_Point&#8221;)<\/p>\n<p>&nbsp;<\/p>\n<p>Now, we can receive data:<\/p>\n<p>&gt;&gt;[scanData,status,statustext] = receive(pointSub,10);<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"420\" height=\"190\" class=\"alignnone size-full wp-image-1142\" src=\"http:\/\/blogs.mathworks.com\/autonomous-systems\/files\/2024\/05\/Code_topic_point.png\" alt=\"\" \/><\/p>\n<p>Combining DDS with the MathWorks ROS Toolbox will facilitate interoperability for your robotic and autonomous system. Modern complex autonomous systems have a strong need to interact with non-ROS components, whether it is simulation engines like Unreal Engine, running across different architectures or working with different communication protocols. Combining DDS with ROS Toolbox enables a more rapid prototype-to-production environment for your autonomous system by saving time and effort when working with different technologies. To learn more about RTI Connext and DDS solutions for complex robotic systems, please visit RTI\u00a0 <a href=\"https:\/\/community.rti.com\/ros\">here<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"http:\/\/blogs.mathworks.com\/autonomous-systems\/files\/2024\/05\/Connext_Databus.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>Our guest blogger is Akkshaj Singh, an Application Engineer at RTI with a focus on Commercial Markets and Security. He has a background in robotics and embedded systems and is excited to work at the&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/autonomous-systems\/2024\/05\/21\/accelerating-the-path-to-production-for-your-autonomous-system-with-rti-connext-and-the-ros-toolbox\/\">read more >><\/a><\/p>\n","protected":false},"author":191,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/autonomous-systems\/wp-json\/wp\/v2\/posts\/1127"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/autonomous-systems\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/autonomous-systems\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/autonomous-systems\/wp-json\/wp\/v2\/users\/191"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/autonomous-systems\/wp-json\/wp\/v2\/comments?post=1127"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/autonomous-systems\/wp-json\/wp\/v2\/posts\/1127\/revisions"}],"predecessor-version":[{"id":1148,"href":"https:\/\/blogs.mathworks.com\/autonomous-systems\/wp-json\/wp\/v2\/posts\/1127\/revisions\/1148"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/autonomous-systems\/wp-json\/wp\/v2\/media?parent=1127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/autonomous-systems\/wp-json\/wp\/v2\/categories?post=1127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/autonomous-systems\/wp-json\/wp\/v2\/tags?post=1127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}