diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d72e5a..08a76c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,15 +82,15 @@ jobs: run: sudo apt-get install -y libsdl2-dev - name: Build simulator run: make build_simulator + - name: Install pyflix requirements + run: sudo apt install -y python3-pip && pip3 install -r tools/requirements.txt - name: Run simulator env: GAZEBO_MODEL_PATH: ${{ github.workspace }}/gazebo/models GAZEBO_PLUGIN_PATH: ${{ github.workspace }}/gazebo/build run: | - OUT=$(timeout -k 10s 120s gzserver --verbose gazebo/flix.world 2>&1 | tee /dev/stderr) - if echo "$OUT" | grep -Pq "\[Err\](?! \[RenderEngine)"; then - exit 1 - fi + gzserver --verbose gazebo/flix.world & + timeout -k 10s 120s tools/example.py - uses: actions/upload-artifact@v7 with: name: gazebo-plugin-binary diff --git a/gazebo/Arduino.h b/gazebo/Arduino.h index 1d960a7..b3c66e9 100644 --- a/gazebo/Arduino.h +++ b/gazebo/Arduino.h @@ -138,6 +138,7 @@ public: int available() { // to implement for Windows, see https://stackoverflow.com/a/71992965/6850197 + if (!isatty(STDIN_FILENO)) return 0; struct pollfd pfd = { .fd = STDIN_FILENO, .events = POLLIN }; return poll(&pfd, 1, 0) > 0; } diff --git a/tools/requirements.txt b/tools/requirements.txt index 6b3338b..adff73d 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -1,3 +1,4 @@ +pymavlink docopt matplotlib mcap