This repo contains labs used in DDS QuickStart training, C++11 version. Before any given lab can be compiled and run, rtiddsgen should be run on the *.idl file in each directory. When performing this step, be sure to set the following:
- Generation: Example Files = ""
- Generation: Type files = "update"
- Generation: Makefiles = "create"
- Language = "Modern C++ (C++ 11)"
- Create IDL, then generate code
$NDDSHOME/bin/rtiddsgen -language C++11 -create typefiles -create exampleFiles -create makefiles -platform x64Darwin17clang9.0 ./example.idl
- In the publisher's loop, change the generated code so that only non-keyed members are incrementally updated
- Give the sample members some values, just so we aren't writing empty data
- Speed up the writes on the publisher side by reducing the sleep from 1s to 500ms
- In the QoS XML:
- update publication_name and subscription_name with meaningful values (your name, etc.)
- replace the local schema URL with a remote one
- Rename
USER_QOS_PROFILES.xml
asMY_QOS_PROFILES.xml
- Use Admin Console to confirm that the DDS entity names created in ex01 are no longer present-- that is becuase the newly-named file is not loaded by default like
USER_QOS_PROFILES.xml
was.
- Use Admin Console to confirm that the DDS entity names created in ex01 are no longer present-- that is becuase the newly-named file is not loaded by default like
- rename the library to "MyLibrary" and profile to "MyProfile"
- remove
is_default_qos="true"
from MyProfile - change publisher and subscriber code to use custom qosProvider
- We can declare const strings in the IDL so that string literals do not have to be manually entered in source. Let's do that for:
- The Topic name
- The QoS library and profile
- The type support code now needs to be regenerated
- Generation: Example Files = ""
- Generation: Type files = "update"
- Generation: Makefiles = ""
- Language = "Modern C++ (C++ 11)"
- Update
example_publisher.cxx
andexample_subscriber.cxx
to use these constants.
- Set deadline to 1.0 sec. on DataReader
- Discuss why not working. (QoS mismatch)
- Add Reader listener callback to note Qos Error
- In C++98 documentation, search for DDS_QosPolicyId_t; here you can match "4" to "DDS_DEADLINE_QOS_POLICY_ID"
- Fix Writer to offer Deadline of 500ms
- Add an additional listener callback to handle missed deadlines
- remove
base_name="BuiltinQosLibExp::Generic.StrictReliable"
from QoS - Explicitly set reliability to RELIABLE_RELIABILITY_QOS in DatReader and DataWriter QoS.
- Slow down writer to 1HZ and confirm that data is received at this rate.
- Now set writer to wait for reliable acknowledgements.
- Discuss writer write speed-- why did the data transfer slow down?
- Speed up HB frequency in writer protocol to correct.
- Set Writer and Reader Durability to TRANSIENT_LOCAL_DURABILITY_QOS.
- Set History to KEEP_LAST_HISTORY_QOS, depth 10 on the DataReader.
- Set History to KEEP_LAST_HISTORY_QOS, depth 15 on the DataWriter.
- Start Writer first, let it run for 10s or so, then start the Reader app and discuss late joiner results.
- Modify subscriber code to add a cft
- add code to create the parameters and Filter
- set the filter name
- change the reader instantiation to use ContentFilteredTopic instead of normal topic
- open admin console to show that no new topic is shown, the filtering is logical but does not spawn a new entity