#!/bin/bash echo "🔍 ROS Topic Monitor for QA_LLM_Module" echo "=====================================" # Check if ROS2 is running if ! command -v ros2 &> /dev/null; then echo "❌ ROS2 not found. Please source your ROS2 environment." exit 1 fi echo "📋 Active Topics:" ros2 topic list | grep -E "(instruction_topic|keywords_topic|tasks_topic|robovla)" || echo " No relevant topics found" echo "" echo "🤖 Active Nodes:" ros2 node list | grep robovla || echo " No robovla nodes found" echo "" echo "🎯 Topic Information:" for topic in "/instruction_topic" "/keywords_topic" "/tasks_topic"; do if ros2 topic list | grep -q "^${topic}$"; then echo " Topic: $topic" ros2 topic info $topic echo "" fi done echo "📊 Real-time Monitoring (Press Ctrl+C to stop):" echo "Monitoring key topics for messages..." # Monitor in background and display messages { ros2 topic echo /instruction_topic & PID1=$! ros2 topic echo /keywords_topic & PID2=$! ros2 topic echo /tasks_topic & PID3=$! # Wait for user interrupt trap "kill $PID1 $PID2 $PID3 2>/dev/null; exit" INT wait }