main content

dds blockset shapes demo -凯发k8网页登录

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.

import dds definitions

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 shapesexample.xml.

view and edit definitions

to view these dds definitions in the dds dictionary, open the dictionary and view the types, domains, and qos tabs.

open shapesexample.sldd

lib.png

view publisher and subscriber model construction

open_system('shapesdemo');

model.png

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.

  1. click the bus element in block and view the dds data type of the shape.

  2. click the take dds sample block that converts the dds data type to the simulink data type.

  3. examine the logic component of the application model. the logic component uses the simulink data types to compute the logic of the dds application.

  4. click the write dds sample block that converts the simulink data types to a dds data type.

  5. click the bus element out block and view the dds data type to send the shape position to the dds network.

also, note that root level output logging is unset for this model to use bus element out block with virtual bus representing the dds publisher.

config.png

view configured dds interface

in addition to the modeling of the shapes demo, you can view the imported dds interface configuration of the topics, datareaders, and datawriters for the model:

  1. open the code mappings editor. on the toolstrip, click code interface and select individual elements code mappings.

  2. to view the imported topics and datareaders, click on the inports tab.

  3. to view the imported topics and datawriters, click on the outports tab.

build and deploy the shapes demo

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.

related topics

external websites

    网站地图