pywayne-calibration-magnetometer-calibration

Sensor calibration toolkit with magnetometer calibration using close-form method. Use when calibrating IMU sensors (accelerometer, gyroscope, magnetometer) to compute soft-iron matrix and hard-iron offset for magnetometer correction. Requires sensor fusion with VQF for orientation estimation.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "pywayne-calibration-magnetometer-calibration" with this command: npx skills add wangyendt/magnetometer-calibration

Pywayne Calibration

pywayne.calibration.MagnetometerCalibrator provides magnetometer calibration using sensor data (accelerometer, gyroscope, magnetometer).

Quick Start

from pywayne.calibration import MagnetometerCalibrator
import numpy as np

# Sensor data: ts (N,), acc (N,3), gyro (N,3), mag (N,3)
calibrator = MagnetometerCalibrator(method='close_form')
Sm, h = calibrator.process(ts, acc, gyro, mag)

# Sm: Soft-iron matrix (3x3)
# h: Hard-iron offset vector (3,)

Input Data Format

Sensor data must be numpy arrays with matching sample counts:

ts   # (N,)     - Timestamps (seconds)
acc  # (N, 3)   - Accelerometer [ax, ay, az]
gyro # (N, 3)   - Gyroscope [gx, gy, gz]
mag  # (N, 3)   - Magnetometer [mx, my, mz]

Data requirements:

  • Sensor data should cover various orientations for effective calibration
  • Minimum data points required (exact number depends on calibration stability)
  • Arrays must be C-contiguous (auto-converted internally)

Calibration Parameters

process() returns:

ParameterShapeDescription
Sm(3, 3)Soft-iron matrix
h(3,)Hard-iron offset vector

Usage in Application

Apply calibration to raw magnetometer readings:

# Calibrated reading
m_calibrated = Sm @ (m_raw - h)

Temporal Calibration

Temporal calibration module exists but is reserved for future expansion. Currently no functionality is implemented.

Important Notes

  • Dependencies: Requires vqf (VQF quaternion filter) and qmt (quaternion math) modules
  • Method: Currently only supports close_form method
  • Orientation: Uses VQF for sensor fusion and orientation estimation during calibration
  • Output: Prints calibration parameters during processing

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Ai Competitor Analyzer

提供AI驱动的竞争对手分析,支持批量自动处理,提升企业和专业团队分析效率与专业度。

Registry SourceRecently Updated
General

Ai Data Visualization

提供自动化AI分析与多格式批量处理,显著提升数据可视化效率,节省成本,适用企业和个人用户。

Registry SourceRecently Updated
General

Ai Cost Optimizer

提供基于预算和任务需求的AI模型成本优化方案,计算节省并指导OpenClaw配置与模型切换策略。

Registry SourceRecently Updated