Skip to content

Commit

Permalink
Be explicit about reliability in Lifespan demo, to depend less on def…
Browse files Browse the repository at this point in the history
…aults (#350)

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
  • Loading branch information
emersonknapp authored and jacobperron committed May 23, 2019
1 parent cee4332 commit bb5874e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions quality_of_service_demo/rclcpp/src/lifespan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ int main(int argc, char * argv[])

rclcpp::QoS qos_profile(history);
qos_profile
// Guaranteed delivery is needed to send messages to late-joining subscriptions.
.reliable()
// Store messages on the publisher so that they can be affected by Lifespan.
.transient_local()
.lifespan(lifespan_duration);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from rclpy.executors import SingleThreadedExecutor
from rclpy.qos import QoSDurabilityPolicy
from rclpy.qos import QoSProfile
from rclpy.qos import QoSReliabilityPolicy


def parse_args():
Expand Down Expand Up @@ -51,7 +52,10 @@ def main(args=None):

qos_profile = QoSProfile(
depth=parsed_args.history,
durability=QoSDurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL,
# Guaranteed delivery is needed to send messages to late-joining subscription.
reliability=QoSReliabilityPolicy.RELIABLE,
# Store messages on the publisher so that they can be affected by Lifespan.
durability=QoSDurabilityPolicy.TRANSIENT_LOCAL,
lifespan=lifespan)

listener = Listener(
Expand Down

0 comments on commit bb5874e

Please sign in to comment.