Skip to content

Commit

Permalink
fix: support environment without std::input to stop recording (#164)
Browse files Browse the repository at this point in the history
* fix: support environment without std::input to stop recording

Signed-off-by: takeshi.iwanari <[email protected]>

* fix flake8

Signed-off-by: takeshi.iwanari <[email protected]>

---------

Signed-off-by: takeshi.iwanari <[email protected]>
  • Loading branch information
iwatake2222 authored Jan 15, 2024
1 parent 2c54408 commit 48c034f
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 48c034f

Please sign in to comment.