rticommunity / rticonnextdds-examples

This repository includes examples on how to use specific features of RTI Connext DDS.
Other
129 stars 140 forks source link

[BUG] flat_data_latency c++11 incorrect behavior #629

Open wjcoleman opened 1 year ago

wjcoleman commented 1 year ago

System information

What is the current behavior?

For _flat_datalatency c++11 example, the publisher incorrectly exits the publishing while loop before sending the final timestamp=0 sample to indicate to the subscriber app that the latency test is finished. This is applicable if using the either the --sample_count or --exec_time options for the publisher.

Steps to reproduce the issue

  1. Build the c++11 _flat_datalatency example.
  2. Start the subscriber app with: -m 3
  3. Start the publisher with: -m 3 -s 10
  4. Notice that after the publisher app stops publishing data it waits for the subscriber to exit. The subscriber will continue to print "Wait for ping: timeout" messages since it does not receive the final expected sample.

*Note this is applicable for each --mode option.

Expected behavior

Publisher app should send a final sample with timestamp=0, which the subscriber waits for to indicate it should exit.

Suggested solutions

For each occurrence of count < options.sample_count in _CameraImagepublisher.cxx, it should be replaced with: count <= options.sample_count. (for all 4 modes)

**unrelated: the help message for the subscriber says the short option for --display_sample is -d. This is incorrect, -d is for --domain. -ds the short option for --display_sample.

wjcoleman commented 1 year ago

Additionally, the --exec_time (short option -e) publisher option is not interpreted as seconds as the helptext and readme state, but rather microseconds. This should be either clarified or corrected in the application code.