diff --git a/README.md b/README.md index b00f5bb54..54a7e3e8d 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ This entails that any blocking call occurring during the write operation would b It is important to note that this mode typically yields higher throughput rates at lower latencies, since the notification and context switching between threads is not present. * `AUTO`: let Fast DDS select the publication mode. This implies using the publication mode set in the XML file or, failing that, the default value set in Fast DDS (which currently is set to `SYNCHRONOUS`). -If `RMW_FASTRTPS_PUBLICATION_MODE` is not set, then both `rmw_fastrtps_cpp` and `rmw_fastrtps_dynamic_cpp` behave as if it were set to `ASYNCHRONOUS`. +If `RMW_FASTRTPS_PUBLICATION_MODE` is not set, then both `rmw_fastrtps_cpp` and `rmw_fastrtps_dynamic_cpp` behave as if it were set to `SYNCHRONOUS`. ### Full QoS configuration diff --git a/rmw_fastrtps_shared_cpp/src/participant.cpp b/rmw_fastrtps_shared_cpp/src/participant.cpp index ae23f79f2..1c9ee267a 100644 --- a/rmw_fastrtps_shared_cpp/src/participant.cpp +++ b/rmw_fastrtps_shared_cpp/src/participant.cpp @@ -189,7 +189,7 @@ rmw_fastrtps_shared_cpp::create_participant( domainParticipantQos.name(enclave); bool leave_middleware_default_qos = false; - publishing_mode_t publishing_mode = publishing_mode_t::ASYNCHRONOUS; + publishing_mode_t publishing_mode = publishing_mode_t::SYNCHRONOUS; const char * env_value; const char * error_str; error_str = rcutils_get_env("RMW_FASTRTPS_USE_QOS_FROM_XML", &env_value); @@ -207,16 +207,17 @@ rmw_fastrtps_shared_cpp::create_participant( return nullptr; } if (env_value != nullptr) { - // Synchronous publishing if (strcmp(env_value, "SYNCHRONOUS") == 0) { publishing_mode = publishing_mode_t::SYNCHRONOUS; + } else if (strcmp(env_value, "ASYNCHRONOUS") == 0) { + publishing_mode = publishing_mode_t::ASYNCHRONOUS; } else if (strcmp(env_value, "AUTO") == 0) { publishing_mode = publishing_mode_t::AUTO; - } else if (strcmp(env_value, "ASYNCHRONOUS") != 0 && strcmp(env_value, "") != 0) { + } else if (strcmp(env_value, "") != 0) { RCUTILS_LOG_WARN_NAMED( "rmw_fastrtps_shared_cpp", "Value %s unknown for environment variable RMW_FASTRTPS_PUBLICATION_MODE" - ". Using default ASYNCHRONOUS publishing mode.", env_value); + ". Using default SYNCHRONOUS publishing mode.", env_value); } } }