From 828237141de42b757037512167cd25c5d2ba108d Mon Sep 17 00:00:00 2001 From: Sangtaek Lee Date: Mon, 1 Apr 2024 20:02:36 +0000 Subject: [PATCH] add a parameter in python examples Signed-off-by: Sangtaek Lee --- .../rosbag2_examples_py/simple_bag_player.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rosbag2_examples/rosbag2_examples_py/rosbag2_examples_py/simple_bag_player.py b/rosbag2_examples/rosbag2_examples_py/rosbag2_examples_py/simple_bag_player.py index d4bac76bd..09b8146ed 100644 --- a/rosbag2_examples/rosbag2_examples_py/rosbag2_examples_py/simple_bag_player.py +++ b/rosbag2_examples/rosbag2_examples_py/rosbag2_examples_py/simple_bag_player.py @@ -34,7 +34,8 @@ def __init__(self, bag_filename): self.publisher = self.create_publisher(String, 'chatter', 10) # ignore timestamp and publish at a fixed rate (10 Hz). self.timer = self.create_timer(0.1, self.timer_callback) - self.message_needs_to_be_edit_before_send_ = True + self.declare_parameter("edit", False) + self.message_needs_to_be_edit_before_send_ = self.get_parameter("edit").get_parameter_value().bool_value def timer_callback(self): while self.reader.has_next():