Skip to content

Commit

Permalink
style: ament_cpplint + ament_uncrustify
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanYuYuan committed Jan 22, 2025
1 parent 9f72ee8 commit c199a39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 7 additions & 4 deletions rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,19 @@ std::shared_ptr<PublisherData> PublisherData::make(
adv_pub_opts.publisher_detection = true;
}

if (adapted_qos_profile.durability == RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL
|| adapted_qos_profile.reliability == RMW_QOS_POLICY_RELIABILITY_RELIABLE) {
if (adapted_qos_profile.durability == RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL ||
adapted_qos_profile.reliability == RMW_QOS_POLICY_RELIABILITY_RELIABLE)
{
adv_pub_opts.cache = AdvancedPublisherOptions::CacheOptions::create_default();
adv_pub_opts.cache->max_samples = adapted_qos_profile.depth;
}

if (adapted_qos_profile.reliability == RMW_QOS_POLICY_RELIABILITY_RELIABLE) {
// Allow matching Subscribers to detect lost samples and ask for retransimission.
adv_pub_opts.sample_miss_detection = AdvancedPublisherOptions::SampleMissDetectionOptions::create_default();
// The period of publisher heartbeats in ms, used by ``AdvancedSubscriber`` with heartbeat-based recovery enabled for missed sample retransimission.
adv_pub_opts.sample_miss_detection =
AdvancedPublisherOptions::SampleMissDetectionOptions::create_default();
// The period of publisher heartbeats in ms, used by ``AdvancedSubscriber`` with
// heartbeat-based recovery enabled for missed sample retransimission.
adv_pub_opts.sample_miss_detection->heartbeat_period_ms = 1000;
}

Expand Down
7 changes: 4 additions & 3 deletions rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,15 @@ bool SubscriptionData::init()
// Enable detection of late joiner publishers and query for their historical data.
adv_sub_opts.history->detect_late_publishers = true;
adv_sub_opts.history->max_samples = entity_->topic_info()->qos_.depth;

}

if (entity_->topic_info()->qos_.reliability == RMW_QOS_POLICY_RELIABILITY_RELIABLE) {
// Retransmission of detected lost Samples. This requires publishers to enable caching and sample_miss_detection.
// Retransmission of detected lost Samples. This requires publishers to enable caching
// and sample_miss_detection.
adv_sub_opts.recovery = AdvancedSubscriberOptions::RecoveryOptions::create_default();
// Heartbeat-based last sample detection.
adv_sub_opts.recovery->last_sample_miss_detection = AdvancedSubscriberOptions::RecoveryOptions::Heartbeat{};
adv_sub_opts.recovery->last_sample_miss_detection =
AdvancedSubscriberOptions::RecoveryOptions::Heartbeat{};
}

std::weak_ptr<SubscriptionData> data_wp = shared_from_this();
Expand Down

0 comments on commit c199a39

Please sign in to comment.