From 6f0e267d2bb5013a3907dd9a797e1fb77d163136 Mon Sep 17 00:00:00 2001 From: "takeshi.iwanari" Date: Mon, 15 Jan 2024 14:29:24 +0900 Subject: [PATCH 1/2] fix: support environment without std::input to stop recording Signed-off-by: takeshi.iwanari --- ros2caret/verb/record.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ros2caret/verb/record.py b/ros2caret/verb/record.py index 9860f98..7bbe126 100644 --- a/ros2caret/verb/record.py +++ b/ros2caret/verb/record.py @@ -27,6 +27,7 @@ from ros2caret.verb import VerbExtension from ros2caret.verb.caret_record_init import init +import time from tqdm import tqdm from tracetools_trace.tools import lttng, names, path @@ -219,7 +220,12 @@ def _run(): recordable_node_num = node.start(args.verbose, args.recording_frequency) while not node.started and recordable_node_num > 0: rclpy.spin_once(node) - input('press enter to stop...') + try: + input('press enter to stop...') + except EOFError: + print('\nstd::input is not supported in this system. press ctrl-c to stop...') + while True: + time.sleep(10) def _fini(): node.stop_progress() From e438198297abc30ed3c25fd88b33b65b010c892e Mon Sep 17 00:00:00 2001 From: "takeshi.iwanari" Date: Mon, 15 Jan 2024 15:07:25 +0900 Subject: [PATCH 2/2] fix flake8 Signed-off-by: takeshi.iwanari --- ros2caret/verb/record.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ros2caret/verb/record.py b/ros2caret/verb/record.py index 7bbe126..77761d5 100644 --- a/ros2caret/verb/record.py +++ b/ros2caret/verb/record.py @@ -15,6 +15,7 @@ import os import signal import subprocess +import time from typing import Optional @@ -27,7 +28,6 @@ from ros2caret.verb import VerbExtension from ros2caret.verb.caret_record_init import init -import time from tqdm import tqdm from tracetools_trace.tools import lttng, names, path