Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support environment without std::input to stop recording #164

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ros2caret/verb/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import os
import signal
import subprocess
import time

from typing import Optional

Expand Down Expand Up @@ -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()
Expand Down