Skip to content

Commit 088e296

Browse files
committed
more testing
1 parent 46b6edf commit 088e296

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

booster_sdk/src/dds/qos.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use rustdds::{
44
Duration, QosPolicies, QosPolicyBuilder,
5-
policy::{History, Reliability},
5+
policy::{Durability, History, Reliability},
66
};
77

88
pub fn qos_best_effort_keep_last(depth: i32) -> QosPolicies {
@@ -21,6 +21,16 @@ pub fn qos_reliable_keep_last(depth: i32) -> QosPolicies {
2121
.build()
2222
}
2323

24+
pub fn qos_reliable_transient_local_keep_last(depth: i32) -> QosPolicies {
25+
QosPolicyBuilder::new()
26+
.durability(Durability::TransientLocal)
27+
.reliability(Reliability::Reliable {
28+
max_blocking_time: Duration::from_millis(100),
29+
})
30+
.history(History::KeepLast { depth })
31+
.build()
32+
}
33+
2434
pub fn qos_reliable_keep_all() -> QosPolicies {
2535
QosPolicyBuilder::new()
2636
.reliability(Reliability::Reliable {

booster_sdk/src/dds/topics.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ use rustdds::{QosPolicies, Topic, TopicKind};
44

55
use crate::types::{DdsError, Result};
66

7-
use super::qos::{qos_best_effort_keep_last, qos_reliable_keep_all, qos_reliable_keep_last};
7+
use super::qos::{
8+
qos_best_effort_keep_last, qos_reliable_keep_all, qos_reliable_keep_last,
9+
qos_reliable_transient_local_keep_last,
10+
};
811

912
#[derive(Debug, Clone)]
1013
pub struct TopicSpec {
@@ -53,7 +56,7 @@ pub fn rpc_request_topic(service_topic: &str) -> TopicSpec {
5356
TopicSpec {
5457
name: format!("{service_topic}Req"),
5558
type_name: TYPE_RPC_REQ,
56-
qos: qos_best_effort_keep_last(10),
59+
qos: qos_reliable_keep_last(10),
5760
kind: TopicKind::NoKey,
5861
}
5962
}
@@ -62,7 +65,7 @@ pub fn rpc_response_topic(service_topic: &str) -> TopicSpec {
6265
TopicSpec {
6366
name: format!("{service_topic}Resp"),
6467
type_name: TYPE_RPC_RESP,
65-
qos: qos_reliable_keep_last(10),
68+
qos: qos_reliable_transient_local_keep_last(10),
6669
kind: TopicKind::NoKey,
6770
}
6871
}

0 commit comments

Comments
 (0)