Docs: the HMC5883L heading — ESPHome's atan2(-x, y) is −180..180, the node now adds 360 to the negatives (they arrived as 0 in its 0..360 encoding)

This commit is contained in:
randy committed 2026-11-30 18:42:50 +01:00
1 parent 190a8ad334
commit f65eb98d18
2 files changed
+6 -3

No files matched your search

+3 -1
View File
@@ -186,7 +186,9 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho
*** [x] The compass (HMC5883L on node 0x21, TPDO 0x221) as `imu.heading` + `mag.x/y/z` in
`can.json` — for orienting while standing; driving uses the GNSS course
*** [ ] Tilt compensation (pitch/roll from the IMU) and hard-/soft-iron calibration of the
heading — ESPHome's is a plain `atan2(y, x)`; in the node, like the levelling
heading — ESPHome's is a plain `atan2(-x, y)`; in the node, like the levelling
*** [x] The node sent the heading encoded 0..360 but ESPHome's is −180..180, negatives arrived
as 0 — fixed in the node (`x < 0 ? x + 360 : x` filter on `heading:`, 2026-11-30)
*** [ ] IMU every 100–200 ms (the node reads it every 5 s today) and levelling done by the
node itself, set by an SDO write from a button in `/can.html` — design in home-gitops
`docs/canopen-nodes.adoc` ("Nulovanie náklonu a rýchlosť IMU")
+3 -2
View File
@@ -253,8 +253,9 @@ same node) isn't in the firmware yet:
Speed's scale also converts km/h to m/s (`300 / 65534 / 3.6`). 0x221 is
the HMC5883L (TPDO 4 → `0x200 + node`): the field ±200 µT and ESPHome's
heading 0..360°, plain `atan2(y, x)` — no tilt compensation or hard-iron
calibration yet, so only roughly right standing level. The node
heading 0..360° (ESPHome's plain `atan2(-x, y)` is −180..180, the node
adds 360 to the negatives — a filter on `heading:`). No tilt compensation
or hard-iron calibration yet, so only roughly right standing level. The node
goes operational by itself, so no `nmt_start`.
=== Map data (one way)