Skip to content

Commit 526d6c3

Browse files
committed
When in CI, do not evaluate keyboard input
Github actions seem to send keyboard input to the program with a very high frequency.
1 parent 59a2396 commit 526d6c3

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ jobs:
9595
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
9696
- name: run examples
9797
run: ./run_examples.sh "192.168.56.101" 1
98+
env:
99+
URCL_EXAMPLES_IN_CI: 1
98100
- name: install gcovr
99101
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
100102
run: sudo apt-get install -y gcovr

examples/external_fts_through_rtde.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,19 @@ int main(int argc, char* argv[])
298298
// The RTDE thread sends the force-torque data to the robot and receives the wrench data from the
299299
// robot.
300300
std::thread rtde_thread(rtdeWorker, second_to_run);
301-
302301
// Modify the artificial force-torque input through keyboard input
303-
ftInputTui();
304-
305-
g_RUNNING = false;
302+
if (std::getenv("URCL_EXAMPLES_IN_CI") == nullptr)
303+
{
304+
ftInputTui();
305+
}
306+
else
307+
{
308+
// In CI mode, just keep the main thread alive while g_RUNNING is true
309+
while (g_RUNNING)
310+
{
311+
std::this_thread::sleep_for(std::chrono::milliseconds(100));
312+
}
313+
}
306314
if (rtde_thread.joinable())
307315
{
308316
rtde_thread.join();

0 commit comments

Comments
 (0)