This example shows how to import, configure, and deploy the Shapes Demo provided by DDS vendors to introduce DDS concepts. In the demo there are various shapes - Circles, Squares, and Triangles - that you can subscribe to watch their location as they move around a canvas. In this version of the demo, DDS Blockset provides an application that subscribes to a Square and then publishes the location of a Circle.
To get started with the Shapes Demo, the DDS definitions of Domains, Topics, Types, and Quality of Service (QoS) have been imported from XML. To view the XML specifications, open
To view these DDS definitions in the DDS Dictionary, open the dictionary and view the Types, Domains, and QoS tabs.
In the Simulink model for the Shapes Demo, view how the DDS blocks, Take DDS Sample and Write DDS Sample, are used to subscribe to and publish the location of the shape.
Click the inport and view the DDS data type of the shape.
Click the Take DDS Sample block that converts the DDS data type to the Simulink data type.
Examine the logic component of the application model. The logic component uses the Simulink data types to compute the logic of the DDS application.
Click the Write DDS Sample block that converts the Simulink data types to a DDS data type.
Click the outport and view the DDS data type to send the shape position to the DDS network.
In addition to the modeling of the Shapes Demo, you can view the DDS interface configuration of the DataReaders and DataWriters for the model. This example uses the Reader/Writer XML path configuration mode to specify previously imported readers and writers to configure the interface.
Open the Code Mappings editor. On the toolstrip, click Code Interface and select Individual Elements Code Mappings.
On the Inports tab, view how the Configuration Mode is set to
Use Reader XML Path. This configuration sets the DataReader to the definition specified in the imported XML.
On the Outports tab, view how the Configuration Mode is set to
Use Writer XML Path. This configuration sets the DataWriter to the definition specified in the imported XML.
DDS Blockset enables out-of-the-box support for RTI and eProsima. To use this out-of-the-box support, build your application model and deploy your generated executable in your development environment. For this example, click Build to subscribe to a Square and publish the location of a Circle Topic.