Skip to content

Commit 269db82

Browse files
committed
refactor(steami_config): rename accelerometer calibration key to reduce size
1 parent 76ce8b2 commit 269db82

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/steami_config/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ config.apply_accelerometer_calibration(imu)
150150
Data is stored as compact JSON to fit within 1 KB:
151151

152152
```json
153-
{"rev":3,"name":"STeaMi-01","tc":{"hts":{"g":1.0,"o":-0.5}},"cm":{"hx":12.3,"hy":-5.1,"hz":0.8,"sx":1.01,"sy":0.98,"sz":1.0},"cal_accel":{"ox":0.01,"oy":-0.02,"oz":0.03}}
153+
{"rev":3,"name":"STeaMi-01","tc":{"hts":{"g":1.0,"o":-0.5}},"cm":{"hx":12.3,"hy":-5.1,"hz":0.8,"sx":1.01,"sy":0.98,"sz":1.0},"ca":{"ox":0.01,"oy":-0.02,"oz":0.03}}
154154
```
155155

156156
| Key | Content |
@@ -163,8 +163,8 @@ Data is stored as compact JSON to fit within 1 KB:
163163
| `cm` | Magnetometer calibration dict |
164164
| `cm.hx/hy/hz` | Hard-iron offsets (X, Y, Z) |
165165
| `cm.sx/sy/sz` | Soft-iron scale factors (X, Y, Z) |
166-
| `cal_accel` | Accelerometer calibration dict |
167-
| `cal_accel.ox/oy/oz` | Bias offsets in g (X, Y, Z) |
166+
| `ca` | Accelerometer calibration dict |
167+
| `ca.ox/oy/oz` | Bias offsets in g (X, Y, Z) |
168168

169169
Sensor short keys: `hts` (HTS221), `mag` (LIS2MDL), `ism` (ISM330DL),
170170
`hid` (WSEN-HIDS), `pad` (WSEN-PADS).

lib/steami_config/steami_config/device.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def set_accelerometer_calibration(self, ox=0.0, oy=0.0, oz=0.0):
217217
oy: Y-axis offset
218218
oz: Z-axis offset
219219
"""
220-
self._data["cal_accel"] = {
220+
self._data["ca"] = {
221221
"ox": float(ox),
222222
"oy": float(oy),
223223
"oz": float(oz),
@@ -229,7 +229,7 @@ def get_accelerometer_calibration(self):
229229
Returns:
230230
dict with ox, oy, oz or None
231231
"""
232-
cal = self._data.get("cal_accel")
232+
cal = self._data.get("ca")
233233
if cal is None:
234234
return None
235235

0 commit comments

Comments
 (0)