From 247e0bcfca47f11a3ccf144858a2183ca7c70608 Mon Sep 17 00:00:00 2001
From: fherrero <fherrero@iri.upc.edu>
Date: Tue, 20 Dec 2022 10:23:52 +0100
Subject: [PATCH] Add twist_mux yaml files

---
 config/ana_mux_locks.yaml  | 20 ++++++++++++++++++++
 config/ana_mux_topics.yaml | 24 ++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 config/ana_mux_locks.yaml
 create mode 100644 config/ana_mux_topics.yaml

diff --git a/config/ana_mux_locks.yaml b/config/ana_mux_locks.yaml
new file mode 100644
index 0000000..224a7e8
--- /dev/null
+++ b/config/ana_mux_locks.yaml
@@ -0,0 +1,20 @@
+##########################################################
+### LOCKS
+##########################################################
+
+# Locks to stop the twist inputs.
+# For each lock:
+# - topic   : input topic that provides the lock; it must be of type std_msgs::Bool?!!!
+# - timeout : == 0.0 -> not used
+#              > 0.0 -> the lock is supposed to published at a certain frequency in order
+#                       to detect that the publisher is alive; the timeout in seconds allows
+#                       to detect that, and if the publisher dies we will enable the lock
+# - priority: priority in the range [0, 255], so all the topics with priority lower than it
+#             will be stopped/disabled
+
+locks:
+- name    : pause
+  topic   : pause_navigation
+  timeout : 0.0
+  # Same priority as joystick control, so it'll not block it.
+  priority: 100
diff --git a/config/ana_mux_topics.yaml b/config/ana_mux_topics.yaml
new file mode 100644
index 0000000..93a85bb
--- /dev/null
+++ b/config/ana_mux_topics.yaml
@@ -0,0 +1,24 @@
+##########################################################
+### TOPICS
+##########################################################
+
+# Input topics handled/muxed.
+# For each topic:
+# - name    : name identifier to select the topic
+# - topic   : input topic of geometry_msgs::Twist type
+# - timeout : timeout in seconds to start discarding old messages, and use 0.0 speed instead
+# - priority: priority in the range [0, 255]; the higher the more priority over other topics
+
+topics:
+- name    : default
+  topic   : /ana/default/cmd_vel
+  timeout : 0.1
+  priority: 0
+- name    : navigation
+  topic   : /ana/navigation/cmd_vel
+  timeout : 0.5
+  priority: 5
+- name    : teleop
+  topic   : /ana/teleop/cmd_vel
+  timeout : 0.1
+  priority: 10
-- 
GitLab