feat(jetson): CPU/GPU thermal monitor — sysfs + /saltybot/thermal JSON (Issue #205) #209

Merged
sl-jetson merged 1 commits from sl-jetson/issue-205-thermal into main 2026-03-02 11:39:03 -05:00
Collaborator

Summary

New saltybot_thermal ROS2 package with a single thermal_node:

  • Reads all /sys/class/thermal/thermal_zone* sysfs entries (millidegrees → °C)
  • Publishes /saltybot/thermal (std_msgs/String JSON) at 1 Hz
  • JSON schema: {ts, zones:[{zone, index, temp_c}], max_temp_c, warn, throttled}
  • Logs WARN at ≥ 75 °C, ERROR at ≥ 85 °C (configurable)
  • thermal_root param allows offline sysfs override for tests

Parameters

Parameter Default Description
publish_rate_hz 1.0 Publish rate
warn_temp_c 75.0 WARN log threshold (°C)
throttle_temp_c 85.0 ERROR + throttled=true threshold (°C)
thermal_root /sys/class/thermal Sysfs root (override for tests)

Test plan

  • 50/50 tests passing (test_thermal.py)
  • read_thermal_zones() tested with fake sysfs (tmp_path fixtures)
  • millidegrees → °C conversion
  • Zone sorting by index, cooling_device entries skipped
  • Missing temp file skipped gracefully, missing type file falls back to dir name
  • Threshold logic: warn ≥75°C, throttle ≥85°C, max_temp drives status
  • JSON payload serializable, all required fields present
  • package.xml, setup.py, thermal_params.yaml validated

Closes #205

🤖 Generated with Claude Code

## Summary New `saltybot_thermal` ROS2 package with a single `thermal_node`: - Reads all `/sys/class/thermal/thermal_zone*` sysfs entries (millidegrees → °C) - Publishes `/saltybot/thermal` (`std_msgs/String` JSON) at 1 Hz - JSON schema: `{ts, zones:[{zone, index, temp_c}], max_temp_c, warn, throttled}` - Logs `WARN` at ≥ 75 °C, `ERROR` at ≥ 85 °C (configurable) - `thermal_root` param allows offline sysfs override for tests ## Parameters | Parameter | Default | Description | |-----------|---------|-------------| | `publish_rate_hz` | `1.0` | Publish rate | | `warn_temp_c` | `75.0` | WARN log threshold (°C) | | `throttle_temp_c` | `85.0` | ERROR + `throttled=true` threshold (°C) | | `thermal_root` | `/sys/class/thermal` | Sysfs root (override for tests) | ## Test plan - [x] 50/50 tests passing (`test_thermal.py`) - [x] `read_thermal_zones()` tested with fake sysfs (tmp_path fixtures) - [x] millidegrees → °C conversion - [x] Zone sorting by index, cooling_device entries skipped - [x] Missing temp file skipped gracefully, missing type file falls back to dir name - [x] Threshold logic: warn ≥75°C, throttle ≥85°C, max_temp drives status - [x] JSON payload serializable, all required fields present - [x] `package.xml`, `setup.py`, `thermal_params.yaml` validated Closes #205 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sl-webui added 1 commit 2026-03-02 11:21:38 -05:00
New saltybot_thermal package with thermal_node: reads all
/sys/class/thermal/thermal_zone* sysfs entries (millidegrees→°C),
publishes /saltybot/thermal JSON at 1 Hz with zones[], max_temp_c,
warn, and throttled flags. Logs ROS2 WARN at ≥75°C, ERROR at ≥85°C.
thermal_root param allows sysfs override for offline testing.
50/50 tests passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sl-jetson merged commit 03e7995e66 into main 2026-03-02 11:39:03 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seb/saltylab-firmware#209
No description provided.