summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflu0r1ne <flu0r1ne@flu0r1ne.net>2021-09-26 16:27:51 -0500
committerflu0r1ne <flu0r1ne@flu0r1ne.net>2021-09-26 16:27:51 -0500
commit9285ee94806349f32fd4b9dba707ab5ffae7fa8b (patch)
treeb115f61616699b58be2cf6e5b4425f308d0d1fe2
downloadextra-ros-utils-9285ee94806349f32fd4b9dba707ab5ffae7fa8b.tar.xz
extra-ros-utils-9285ee94806349f32fd4b9dba707ab5ffae7fa8b.zip
Add script that auto update TF2 tree
-rwxr-xr-xtf2_watch.bash35
1 files changed, 35 insertions, 0 deletions
diff --git a/tf2_watch.bash b/tf2_watch.bash
new file mode 100755
index 0000000..02e2580
--- /dev/null
+++ b/tf2_watch.bash
@@ -0,0 +1,35 @@
+#!/bin/env bash
+
+TIME_BETWEEN_SAMPLES="$1"
+
+set -euo pipefail
+IFS=$'\n\t'
+
+if [ -z "${TIME_BETWEEN_SAMPLES}" ]; then
+ TIME_BETWEEN_SAMPLES="25"
+fi
+
+GENERATED="frames.pdf"
+
+cleanstop() {
+ rm -rf "./${GENERATED}"
+ pkill mupdf
+}
+
+trap "cleanstop" EXIT
+
+
+MU_LAUNCHED=""
+
+while : ; do
+ rosrun tf2_tools view_frames.py
+
+ if [ -z "${MU_LAUNCHED}" ]; then
+ mupdf "${GENERATED}" &
+ MU_LAUNCHED="y"
+ else
+ pkill -hup mupdf
+ fi
+
+ sleep "${TIME_BETWEEN_SAMPLES}"
+done