File size: 1,155 Bytes
92ef79b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/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
}