Realistic Hardware Components Simulated for testing ROS diagnostics
- System: CPU (with usage spikes), Memory, Disk, Network, Thermal management
- Power: Battery with realistic discharge curves and health monitoring
- Motors: Wheel drives and arm joints with current/temperature/position feedback
- Sensors: Ultrasonic, Force/Torque, IMU with realistic noise and drift
- Perception: Camera (framerate issues), LiDAR (scan quality), GPS (satellite tracking)
Real-World Behavior:
- Components exhibit correlated behaviors (CPU temp rises with usage)
- Gradual degradation over time (battery discharge, component wear)
- Realistic fault injection (occasional sensor timeouts, motor overcurrent)
- Environmental effects (ambient temperature affects thermal management)
- Usage patterns (periodic CPU spikes, motor velocity changes)
hardware_diagnostics_simulator/
βββ hardware_diagnostics_simulator/
β βββ hardware_diagnostics_simulator.py # Main simulator node
βββ launch/
β βββ simulator.launch.py # Launch file
βββ resource/
β βββ hardware_diagnostics_simulator # Package resource
βββ package.xml # Package metadata
βββ setup.py # Python setup
βββ README.md # Documentation
Build and run:
cd ~/ros2_ws
colcon build --packages-select hardware_diagnostics_simulator
source install/setup.bash
ros2 launch hardware_diagnostics_simulator simulator.launch.pyView diagnostics:
# Graphical monitor
ros2 run rqt_robot_monitor rqt_robot_monitor
# Command line
ros2 topic echo /diagnosticsThe simulator publishes standard diagnostic_msgs/DiagnosticArray messages that any ROS2 diagnostics dashboard can consume. You'll get realistic data with:
- OK/WARN/ERROR/STALE status levels
- Detailed key-value pairs for each component
- Time-correlated behaviors (components that affect each other)
- Realistic failure modes (overheating, low battery, sensor timeouts)
This will give your diagnostics dashboard plenty of varied, realistic data to work with! The simulation runs continuously and evolves over time, so you can test both steady-state monitoring and failure scenario handling.