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

Update to be compatible with new rmw_qos_profile_t #416

Merged
merged 1 commit into from
Apr 16, 2019
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
60 changes: 34 additions & 26 deletions rcl/test/rcl/test_get_actual_qos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,35 @@ TEST_P_RMW(TestGetActualQoS, test_publisher_get_qos_settings) {
rcl_reset_error();
}

static constexpr rmw_qos_profile_t non_default_qos_profile()
{
rmw_qos_profile_t profile = rmw_qos_profile_default;
profile.history = RMW_QOS_POLICY_HISTORY_KEEP_ALL;
profile.depth = 1000;
profile.reliability = RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT;
profile.durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL;
profile.liveliness = RMW_QOS_POLICY_LIVELINESS_AUTOMATIC;
profile.avoid_ros_namespace_conventions = true;
return profile;
}

static constexpr rmw_qos_profile_t expected_fastrtps_default_qos_profile()
{
rmw_qos_profile_t profile = rmw_qos_profile_default;
profile.depth = 1;
profile.durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL;
profile.liveliness = RMW_QOS_POLICY_LIVELINESS_AUTOMATIC;
return profile;
}

static constexpr rmw_qos_profile_t expected_system_default_qos_profile()
{
rmw_qos_profile_t profile = rmw_qos_profile_default;
profile.depth = 1;
profile.liveliness = RMW_QOS_POLICY_LIVELINESS_AUTOMATIC;
return profile;
}

std::vector<TestParameters>
get_parameters()
{
Expand All @@ -162,20 +191,8 @@ get_parameters()
Test with non-default settings.
*/
{
{
RMW_QOS_POLICY_HISTORY_KEEP_ALL,
1000,
RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT,
RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL,
true
},
{
RMW_QOS_POLICY_HISTORY_KEEP_ALL,
1000,
RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT,
RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL,
true
},
non_default_qos_profile(),
non_default_qos_profile(),
"publisher_non_default_qos"
}
});
Expand All @@ -185,12 +202,7 @@ get_parameters()
if (!rmw_implementation_str.compare("rmw_fastrtps_cpp") ||
!rmw_implementation_str.compare("rmw_fastrtps_dynamic_cpp"))
{
rmw_qos_profile_t expected_system_default_qos = {
RMW_QOS_POLICY_HISTORY_KEEP_LAST,
1,
RMW_QOS_POLICY_RELIABILITY_RELIABLE,
RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL,
false};
rmw_qos_profile_t expected_system_default_qos = expected_fastrtps_default_qos_profile();
parameters.push_back({
rmw_qos_profile_system_default,
expected_system_default_qos,
Expand All @@ -200,19 +212,15 @@ get_parameters()
!rmw_implementation_str.compare("rmw_connext_cpp") ||
!rmw_implementation_str.compare("rmw_connext_dynamic_cpp"))
{
rmw_qos_profile_t expected_system_default_qos = {
RMW_QOS_POLICY_HISTORY_KEEP_LAST,
1,
RMW_QOS_POLICY_RELIABILITY_RELIABLE,
RMW_QOS_POLICY_DURABILITY_VOLATILE,
false};
rmw_qos_profile_t expected_system_default_qos = expected_system_default_qos_profile();
parameters.push_back({
rmw_qos_profile_system_default,
expected_system_default_qos,
"publisher_system_default_qos"});
}
}
#endif

return parameters;
}

Expand Down
4 changes: 4 additions & 0 deletions rcl_action/include/rcl_action/default_qos.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ static const rmw_qos_profile_t rcl_action_qos_profile_status_default =
1,
RMW_QOS_POLICY_RELIABILITY_RELIABLE,
RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL,
RMW_QOS_DEADLINE_DEFAULT,
RMW_QOS_LIFESPAN_DEFAULT,
RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT,
RMW_QOS_LIVELINESS_LEASE_DURATION_DEFAULT,
false
};

Expand Down