A terminal-based system monitor for ROS2 environments with real-time system metrics, ROS node/topic monitoring, and TF frame tracking.
- Version 0.1 - Still has bugs and design flaws
- Verified to work running on Ubuntu 24.04
- Requires separate insteallation of python library textual
- ROS2 (Humble, Iron, or Jazzy)
- Python 3.8+
- Python library textual
You may find that pip install textual gives an error error: externally-managed-environment. I have found that if you can get around this with pip install textual --break-system-packages. NB: I am not positive how that works and can't guarantee that it is safe. It's worked for me and several otehrs.
Like many other ROS2 apps:
cd ros2_ws/src
git clone https://github.com/pitosalas/ros2sysmon.git
cd ~/your_ros2_workspace
source ~/your_ros2_workspace/setup.basj
colcon build --packages-select ros2sysmon
source install/setup.bash# Basic usage
ros2 run ros2sysmon ros2sysmon
# With options
ros2 run ros2sysmon ros2sysmon --config /path/to/config.yaml --refresh-rate 3.01- Topics + TF frames view2- ROS nodes + processes viewr- Manual refresh/collect datax/q- Exit
System metrics with ASCII progress bars:
- CPU/Memory/Disk usage with visual bars
- Load average, uptime, temperature
- Network latency to 8.8.8.8
- Mode 1: ROS Topics (Hz, Count) + TF Frames
- Mode 2: ROS Nodes + System Processes (filtered for ROS)
System alerts with timestamps for threshold violations.
- CPU:
psutil.cpu_percent(interval=0.1)- 100ms sampling - Memory:
psutil.virtual_memory().percent- available vs total - Disk:
psutil.disk_usage('/').percent- root filesystem usage - Temperature:
psutil.sensors_temperatures()- fromcoretemp/cpu_thermal - Load Average:
psutil.getloadavg()[0]- 1-minute load - Uptime:
time.time() - psutil.boot_time()formatted as HH:MM - Network Latency:
ping -c 1 -W 2 8.8.8.8parsed from output
- Nodes: Discovered via
ros2 node list(10s timeout) - Topics: Discovered via
ros2 topic list -t(5s timeout) - Topic Hz:
- Creates ROS2 subscribers for all available topics
- Collects message timestamps during windowed collection (default 3s)
- Calculates frequency as:
message_count / collection_window_duration - Shows 2 decimal precision
- TF Frames: Retrieved via
tf2_ros.Buffer.all_frames_as_yaml() - Processes: Filters system processes for ROS-related keywords
/cmd_vel,/twist: 10Hz/odom: 30Hz/scan, lidar topics: 10Hz/image*, camera topics: 30Hz/imu: 100Hz/tf: 100Hz
Default config: share/ros2sysmon/config/default_config.yaml
- system_metrics: 5.0s - CPU, memory, disk, temperature
- network_ping: 5.0s - Network latency checks
- ros_discovery: 10.0s - Node/topic discovery
- hz_collection_duration: 3.0s - Hz measurement window
- CPU: Warn 70%, Error 85%
- Memory: Warn 75%, Error 90%
- Disk: Warn 80%, Error 95%
- Temperature: Warn 70°C, Error 85°C
- Network: Warn 100ms, Error 500ms
- Textual framework for terminal UI
- Threading: Separate collectors for system, network, and ROS data
- SharedDataStore: Thread-safe data exchange
- Manual/Timed Collection: Configurable collection intervals
ROS2: rclpy, tf2_ros, rosidl_runtime_py
System: psutil, pyyaml, textual
Standard: subprocess, threading, dataclasses
MIT
