logo资料库

OpenDDS最新版开发者手册.pdf

第1页 / 共177页
第2页 / 共177页
第3页 / 共177页
第4页 / 共177页
第5页 / 共177页
第6页 / 共177页
第7页 / 共177页
第8页 / 共177页
资料共177页,剩余部分请下载后查看
Chapter 1 Introduction
1.1. DCPS Overview
1.1.1 Basic Concepts
1.1.1.1 Domain
1.1.1.2 DomainParticipant
1.1.1.3 Topic
1.1.1.4 DataWriter
1.1.1.5 Publisher
1.1.1.6 Subscriber
1.1.1.7 DataReader
1.1.2 Built-In Topics
1.1.3 Quality of Service Policies
1.1.4 Listeners
1.1.5 Conditions
1.2 OpenDDS Implementation
1.2.1 Compliance
1.2.1.1 DDS Compliance
1.2.1.2 DDSI-RTPS Compliance
OpenDDS RTPS Implementation Notes
1.2.2 Extensions to the DDS Specification
1.2.3 OpenDDS Architecture
1.2.3.1 Design Philosophy
1.2.3.2 Extensible Transport Framework (ETF)
1.2.3.3 DDS Discovery
Centralized Discovery with DCPSInfoRepo
Peer-to-Peer Discovery with RTPS
1.2.3.4 Threading
1.2.3.5 Configuration
1.3 Installation
1.3.1 Building With a Feature Enabled or Disabled
1.3.2 Disabling the Building of Built-In Topic Support
1.3.3 Disabling the Building of Compliance Profile Features
1.3.3.1 Content-Subscription Profile
1.3.3.2 Persistence Profile
1.3.3.3 Ownership Profile
1.3.3.4 Object Model Profile
Chapter 2 Getting Started
2.1 Using DCPS
2.1.1 Defining the Data Types
2.1.2 Processing the IDL
2.1.3 A Simple Message Publisher
2.1.3.1 Initializing the Participant
2.1.3.2 Registering the Data Type and Creating a Topic
2.1.3.3 Creating a Publisher
2.1.3.4 Creating a DataWriter and Waiting for the Subscriber
2.1.3.5 Sample Publication
2.1.4 Setting up the Subscriber
2.1.4.1 Initializing the Participant
2.1.4.2 Registering the Data Type and Creating a Topic
2.1.4.3 Creating the subscriber
2.1.4.4 Creating a DataReader and Listener
2.1.5 The Data Reader Listener Implementation
2.1.6 Cleaning up in OpenDDS Clients
2.1.7 Running the Example
2.1.8 Running Our Example with RTPS
2.2 Data Handling Optimizations
2.2.1 Registering and Using Instances in the Publisher
2.2.2 Reading Multiple Samples
2.2.3 Zero-Copy Read
Chapter 3 Quality of Service
3.1 Introduction
3.2 QoS Policies
3.2.1 Default QoS Policy Values
3.2.2 LIVELINESS
3.2.3 RELIABILITY
3.2.4 HISTORY
3.2.5 DURABILITY
3.2.6 DURABILITY_SERVICE
3.2.7 RESOURCE_LIMITS
3.2.8 PARTITION
3.2.9 DEADLINE
3.2.10 LIFESPAN
3.2.11 USER_DATA
3.2.12 TOPIC_DATA
3.2.13 GROUP_DATA
3.2.14 TRANSPORT_PRIORITY
3.2.15 LATENCY_BUDGET
3.2.16 ENTITY_FACTORY
3.2.17 PRESENTATION
3.2.18 DESTINATION_ORDER
3.2.19 WRITER_DATA_LIFECYCLE
3.2.20 READER_DATA_LIFECYCLE
3.2.21 TIME_BASED_FILTER
3.2.22 OWNERSHIP
3.2.23 OWNERSHIP_STRENGTH
3.3 Policy Example
Chapter 4 Conditions and Listeners
4.1 Introduction
4.2 Communication Status Types
4.2.1 Topic Status Types
4.2.1.1 Inconsistent Topic Status
4.2.2 Subscriber Status Types
4.2.2.1 Data On Readers Status
4.2.3 Data Reader Status Types
4.2.3.1 Sample Rejected Status
4.2.3.2 Liveliness Changed Status
4.2.3.3 Requested Deadline Missed Status
4.2.3.4 Requested Incompatible QoS Status
4.2.3.5 Data Available Status
4.2.3.6 Sample Lost Status
4.2.3.7 Subscription Matched Status
4.2.4 Data Writer Status Types
4.2.4.1 Liveliness Lost Status
4.2.4.2 Offered Deadline Missed Status
4.2.4.3 Offered Incompatible QoS Status
4.2.4.4 Publication Matched Status
4.3 Listeners
4.3.1 Topic Listener
4.3.2 Data Writer Listener
4.3.3 Publisher Listener
4.3.4 Data Reader Listener
4.3.5 Subscriber Listener
4.3.6 Domain Participant Listener
4.4 Conditions
4.4.1 Status Condition
4.4.1.1 Status Condition Example
4.4.2 Additional Condition Types
4.4.2.1 Read Conditions
4.4.2.2 Query Conditions
4.4.2.3 Guard Conditions
Chapter 5 Content-Subscription Profile
5.1 Introduction
5.2 Content-Filtered Topic
5.2.1 Filter Expressions
5.2.2 Content-Filtered Topic Example
5.3 Query Condition
5.3.1 Query Expressions
5.3.2 Query Condition Example
5.4 Multi Topic
5.4.1 Topic Expressions
5.4.2 Usage Notes
5.4.2.1 Join Keys and DCPS Data Keys
5.4.2.2 How Resulting Samples are Constructed
5.4.2.3 Use with Subscriber Listeners
5.4.3 Multi Topic Example
5.4.3.1 IDL and Topic Expression
5.4.3.2 Creating the Multi Topic Data Reader
5.4.3.3 Reading Data with the Multi Topic Data Reader
Chapter 6 Built-In Topics
6.1 Introduction
6.2 Built-In Topics for DCPSInfoRepo Configuration
6.3 DCPSParticipant Topic
6.4 DCPSTopic Topic
6.5 DCPSPublication Topic
6.6 DCPSSubscription Topic
6.7 Built-In Topic Subscription Example
Chapter 7 Run-time Configuration
7.1 Configuration Approach
7.2 Common Configuration Options
7.3 Discovery Configuration
7.3.1 Domain Configuration
7.3.2 Configuring Applications for DCPSInfoRepo
7.3.2.1 Configuring for Multiple DCPSInfoRepo Instances
7.3.3 Configuring for DDSI-RTPS Discovery
7.3.4 Configuring for Static Discovery
7.4 Transport Configuration
7.4.1 Overview
7.4.1.1 Transport Concepts
7.4.1.2 How OpenDDS Selects a Transport
7.4.2 Configuration File Examples
7.4.2.1 Single Transport Configuration
7.4.2.2 Using Mixed Transports
7.4.2.3 Using Multiple Configurations
7.4.3 Transport Registry Example
7.4.4 Transport Configuration Options
7.4.5 Transport Instance Options
7.4.5.1 Configuration Options Common to All Transports
7.4.5.2 TCP/IP Transport Configuration Options
TCP/IP Reconnection Options
7.4.5.3 UDP/IP Transport Configuration Options
7.4.5.4 IP Multicast Transport Configuration Options
7.4.5.5 RTPS_UDP Transport Configuration Options
7.4.5.6 Shared-Memory Transport Configuration Options
7.5 Logging
7.5.1 DCPS Layer Logging
7.5.2 Transport Layer Logging
Chapter 8 opendds_idl Options
8.1 opendds_idl Command Line Options
Chapter 9 The DCPS Information Repository
9.1 DCPS Information Repository Options
9.2 Repository Federation
9.2.1 Federation Management
9.2.2 Federation Example
9.2.2.1 Configuring the Federation Example
9.2.2.2 Running the Federation Example
Chapter 10 Java Bindings
10.1 Introduction
10.2 IDL and Code Generation
10.3 Setting up an OpenDDS Java Project
10.4 A Simple Message Publisher
10.4.1 Initializing the Participant
10.4.2 Registering the Data Type and Creating a Topic
10.4.3 Creating a Publisher
10.4.4 Creating a DataWriter and Registering an Instance
10.5 Setting up the Subscriber
10.5.1 Creating a Subscriber
10.5.2 Creating a DataReader and Listener
10.6 The DataReader Listener Implementation
10.7 Cleaning up OpenDDS Java Clients
10.8 Configuring the Example
10.9 Running the Example
10.10 Java Message Service (JMS) Support
Chapter 11 Modeling SDK
11.1 Overview
11.1.1 Model Capture
11.1.2 Code Generation
11.1.3 Programming
11.2 Installation and Getting Started
11.2.1 Prerequisites
11.2.2 Installation
11.2.3 Getting Started
11.3 Developing Applications
11.3.1 Modeling Support Library
11.3.1.1 The Application Class
11.3.1.2 The Service Class
11.3.2 Generated Code
11.3.2.1 The DCPS Model Class
11.3.2.2 The Traits Class
11.3.2.3 The Service Typedef
11.3.2.4 Data Library Generated Code
11.3.2.5 QoS Policy Library Generated Code
11.3.3 Application Code Requirements
11.3.3.1 Required headers
11.3.3.2 Exception Handling
11.3.3.3 Instantiation
11.3.3.4 Publisher Code
11.3.3.5 Subscriber Code
11.3.3.6 MPC Projects
11.3.3.7 Dependencies Between Models
Chapter 12 Recorder and Replayer
12.1 Overview
12.2 API Structure
12.3 Usage Model
12.4 QoS Processing
12.4.1 Durability details
Chapter 13 Safety Profile
13.1 Overview
13.2 Safety Profile Subset of OpenDDS
13.3 Safety Profile Configurations of ACE
13.4 Run-time Configurable Options
13.5 Running ACE and OpenDDS Tests
13.6 Using the Memory Pool in Applications
OpenDDS Developer's Guide OpenDDS Version 3.13 Supported by Object Computing, Inc. (OCI) http://www.opendds.org .com jectcomputing http://www.ob
Table of Contents Preface..............................................................................................................................vi Chapter 1 Introduction....................................................................................................1 DCPS Overview..............................................................................................................2 Basic Concepts..........................................................................................................2 Built-In Topics...........................................................................................................3 Quality of Service Policies.........................................................................................4 Listeners....................................................................................................................4 Conditions.................................................................................................................4 OpenDDS Implementation.............................................................................................4 Compliance................................................................................................................4 Extensions to the DDS Specifcation.........................................................................6 OpenDDS Architecture..............................................................................................6 Installation...................................................................................................................10 Building With a Feature Enabled or Disabled.........................................................10 Disabling the Building of Built-In Topic Support.....................................................11 Disabling the Building of Compliance Profle Features...........................................11 Chapter 2 Getting Started..............................................................................................13 Using DCPS.................................................................................................................13 Defning the Data Types..........................................................................................13 Processing the IDL..................................................................................................14 A Simple Message Publisher...................................................................................15 O p e n D D S D e v e l o p e r ’ s G u i d e i
Setting up the Subscriber.......................................................................................18 The Data Reader Listener Implementation.............................................................20 Cleaning up in OpenDDS Clients............................................................................21 Running the Example..............................................................................................22 Running Our Example with RTPS............................................................................23 Data Handling Optimizations.......................................................................................24 Registering and Using Instances in the Publisher..................................................24 Reading Multiple Samples......................................................................................24 Zero-Copy Read.......................................................................................................25 Chapter 3 Quality of Service..........................................................................................27 Introduction.................................................................................................................27 QoS Policies.................................................................................................................27 Default QoS Policy Values.......................................................................................28 LIVELINESS............................................................................................................31 RELIABILITY...........................................................................................................32 HISTORY.................................................................................................................33 DURABILITY............................................................................................................34 DURABILITY_SERVICE...........................................................................................34 RESOURCE_LIMITS................................................................................................35 PARTITION..............................................................................................................35 DEADLINE..............................................................................................................36 LIFESPAN...............................................................................................................36 USER_DATA............................................................................................................37 TOPIC_DATA...........................................................................................................37 GROUP_DATA.........................................................................................................37 TRANSPORT_PRIORITY..........................................................................................38 LATENCY_BUDGET.................................................................................................39 ENTITY_FACTORY..................................................................................................40 PRESENTATION.....................................................................................................41 DESTINATION_ORDER...........................................................................................42 WRITER_DATA_LIFECYCLE....................................................................................42 READER_DATA_LIFECYCLE...................................................................................43 TIME_BASED_FILTER.............................................................................................43 OWNERSHIP...........................................................................................................44 OWNERSHIP_STRENGTH......................................................................................44 i i O p e n D D S D e v e l o p e r ’ s G u i d e
Policy Example.............................................................................................................44 Chapter 4 Conditions and Listeners...............................................................................47 Introduction.................................................................................................................47 Communication Status Types......................................................................................48 Topic Status Types..................................................................................................48 Subscriber Status Types..........................................................................................48 Data Reader Status Types.......................................................................................48 Data Writer Status Types........................................................................................51 Listeners......................................................................................................................52 Topic Listener.........................................................................................................53 Data Writer Listener...............................................................................................53 Publisher Listener...................................................................................................53 Data Reader Listener..............................................................................................53 Subscriber Listener.................................................................................................53 Domain Participant Listener...................................................................................54 Conditions....................................................................................................................54 Status Condition......................................................................................................54 Additional Condition Types.....................................................................................55 Chapter 5 Content-Subscription Profle.........................................................................57 Introduction.................................................................................................................57 Content-Filtered Topic.................................................................................................58 Filter Expressions...................................................................................................58 Content-Filtered Topic Example..............................................................................59 Query Condition...........................................................................................................59 Query Expressions...................................................................................................60 Query Condition Example.......................................................................................60 Multi Topic...................................................................................................................61 Topic Expressions...................................................................................................61 Usage Notes............................................................................................................62 Multi Topic Example...............................................................................................64 Chapter 6 Built-In Topics...............................................................................................67 Introduction.................................................................................................................67 Built-In Topics for DCPSInfoRepo Confguration.........................................................67 DCPSParticipant Topic................................................................................................68 DCPSTopic Topic.........................................................................................................68 O p e n D D S D e v e l o p e r ’ s G u i d e i i i
DCPSPublication Topic................................................................................................69 DCPSSubscription Topic..............................................................................................69 Built-In Topic Subscription Example...........................................................................69 Chapter 7 Run-time Confguration.................................................................................71 Confguration Approach...............................................................................................71 Common Confguration Options...................................................................................73 Discovery Confguration..............................................................................................78 Domain Confguration.............................................................................................78 Confguring Applications for DCPSInfoRepo...........................................................80 Confguring for DDSI-RTPS Discovery....................................................................84 Confguring for Static Discovery.............................................................................87 Transport Confguration..............................................................................................91 Overview.................................................................................................................91 Confguration File Examples...................................................................................92 Transport Registry Example....................................................................................94 Transport Confguration Options............................................................................95 Transport Instance Options.....................................................................................96 Logging......................................................................................................................106 DCPS Layer Logging.............................................................................................106 Transport Layer Logging.......................................................................................106 Chapter 8 opendds_idl Options....................................................................................109 opendds_idl Command Line Options..........................................................................109 Chapter 9 The DCPS Information Repository..............................................................111 DCPS Information Repository Options.......................................................................111 Repository Federation...............................................................................................113 Federation Management.......................................................................................114 Federation Example..............................................................................................116 Chapter 10 Java Bindings.............................................................................................119 Introduction...............................................................................................................119 IDL and Code Generation..........................................................................................119 Setting up an OpenDDS Java Project.........................................................................120 A Simple Message Publisher......................................................................................122 Initializing the Participant.....................................................................................122 Registering the Data Type and Creating a Topic..................................................123 Creating a Publisher..............................................................................................123 i v O p e n D D S D e v e l o p e r ’ s G u i d e
Creating a DataWriter and Registering an Instance.............................................123 Setting up the Subscriber..........................................................................................124 Creating a Subscriber...........................................................................................124 Creating a DataReader and Listener.....................................................................124 The DataReader Listener Implementation.................................................................125 Cleaning up OpenDDS Java Clients...........................................................................126 Confguring the Example...........................................................................................126 Running the Example.................................................................................................126 Java Message Service (JMS) Support........................................................................127 Chapter 11 Modeling SDK............................................................................................129 Overview....................................................................................................................129 Model Capture.......................................................................................................129 Code Generation...................................................................................................131 Programming.........................................................................................................131 Installation and Getting Started................................................................................131 Prerequisites.........................................................................................................131 Installation............................................................................................................131 Getting Started......................................................................................................132 Developing Applications............................................................................................132 Modeling Support Library.....................................................................................133 Generated Code.....................................................................................................133 Application Code Requirements............................................................................135 Chapter 12 Recorder and Replayer..............................................................................141 Overview....................................................................................................................141 API Structure.............................................................................................................141 Usage Model..............................................................................................................142 QoS Processing..........................................................................................................143 Durability details...................................................................................................143 Chapter 13 Safety Profle.............................................................................................145 Overview....................................................................................................................145 Safety Profle Subset of OpenDDS.............................................................................145 Safety Profle Confgurations of ACE.........................................................................146 Run-time Confgurable Options.................................................................................146 Running ACE and OpenDDS Tests.............................................................................146 Using the Memory Pool in Applications.....................................................................147 O p e n D D S D e v e l o p e r ’ s G u i d e v
Preface What Is OpenDDS? OpenDDS is an open source implementation of a group of related Object Management Group (OMG) specifcations. 1) Data Distribution Service (DDS) for Real-Time Systems v1.4 (OMG Document formal/2015-04-10). This specifcation details the core functionality implemented by OpenDDS for real-time publish and subscribe applications and is described throughout this document. 2) The Real-time Publish-Subscribe Wire Protocol DDS Interoperability Wire Protocol Specifcation (DDSI-RTPS) v2.2 (OMG Document formal/2014-09-01). This specifcation describes the primary requirements for interoperability between industry DDS implementations. This is not the only protocol for which a specifcations exists, however, it is the protocol used for interoperability testing among DDS implementations. 3) DDS Security v1.1 (OMG Document formal/2018-04-01) extends DDS with capabilities for authentication and encryption. OpenDDS’s support for the DDS Security specifcation is described in a separate document, UUsing DDS Security in OpenDDS.i OpenDDS is sponsored by Object Computing, Inc. (OCI) and is available via http://www.opendds.org/. v i O p e n D D S D e v e l o p e r ’ s G u i d e
Licensing Terms OpenDDS is made available under the open source software model. The source code may be freely downloaded and is open for inspection, review, comment, and improvement. Copies may be freely installed across all your systems and those of your customers. There is no charge for development or run-time licenses. The source code is designed to be compiled, and used, across a wide variety of hardware and operating systems architectures. You may modify it for your own needs, within the terms of the license agreements. You must not copyright OpenDDS software. For details of the licensing terms, see the fle named LICENSE that is included in the OpenDDS source code distribution or visit http://www.opendds.org/ license.html. OpenDDS also utilizes other open source software products, including MPC (Make Project Creator), ACE (the ADAPTIVE Communication Environment), and TAO (The ACE ORB). More information about these products is available from OCI’s web site at . .com/products jectcomputing http://www.ob OpenDDS is open source and the development team welcomes contributions of code, tests, and ideas. Active participation by users ensures a robust implementation. Contact OCI if you are interested in contributing to the development of OpenDDS. Please note that any code that is contributed to and becomes part of the OpenDDS open source code base is subject to the same licensing terms as the rest of the OpenDDS code base. About This Guide This Developer’s Guide corresponds to OpenDDS version 3.13. This guide is primarily focused on the specifcs of using and confguring OpenDDS to build distributed, publish- subscribe applications. While it does give a general overview of the OMG Data Distribution Service, this guide is not intended to provide comprehensive coverage of the specifcation. The intent of this guide is to help you become profcient with OpenDDS as quickly as possible. Highlights of the 3.13 Release Additions: • Includes a beta implementation of the OMG DDS Security 1.1 specifcation • Monitor library can be enabled with -DCPSMonitor 1 or ini fle • Updated Wireshark dissector now supports Wireshark version 2.x • MultiTopic: use Topic's QoS when creating constituent data readers Fixes: O p e n D D S D e v e l o p e r ’ s G u i d e v i i
分享到:
收藏