Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default to synchronous #571

Merged
merged 4 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions rmw_fastrtps_shared_cpp/src/participant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}
}
Expand Down