← 返回
效率工具 中文

Pywayne Ahrs Tools

Provides quaternion decomposition into Euler angles and roll/pitch compensation utilities for AHRS orientation handling with pywayne.ahrs.tools.
提供四元数分解为欧拉角及横滚/俯仰角补偿工具,用于通过 pywayne.ahrs.tools 处理 AHRS 姿态。
wangyendt
效率工具 clawhub v0.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 823
下载
💾 12
安装
1
版本
#latest

概述

Pywayne AHRS Tools

This module provides quaternion-based AHRS (Attitude and Heading Reference System) utilities.

Quick Start

from pywayne.ahrs.tools import quaternion_decompose, quaternion_roll_pitch_compensate
import numpy as np

# Quaternion decomposition
q = np.array([0.70710678, 0, 0, 0.707962])  # w, x, y, z
angle_all, angle_heading, angle_inclination = quaternion_decompose(q)

# Roll/pitch compensation
q_comp = quaternion_roll_pitch_compensate(q)

Quaternion Decomposition

from pywayne.ahrs.tools import quaternion_decompose
import numpy as np

# Input quaternion (w, x, y, z)
q = np.array([w, x, y, z])

# Decompose into angles
angle_all, angle_heading, angle_inclination = quaternion_decompose(q)

# angle_all: Rotation angles around all axes (vertical + horizontal)
# angle_heading: Angle around vertical axis (inclination)
# angle_inclination: Angle around horizontal axis (bank)

Roll/Pitch Compensation

from pywayne.ahrs.tools import quaternion_roll_pitch_compensate
import numpy as np

# Input quaternion (w, x, y, z)
q = np.array([0.989893, -0.099295, 0.024504, -0.098242])

# Compensate pitch and roll to zero
q_comp = quaternion_roll_pitch_compensate(q)

Requirements

  • numpy - Array operations
  • qmt - OpenCV's quaternion module for conversions

Notes

  • Decomposition returns both angles (in radians) and heading/inclination
  • angle_all is computed using 2*arccos/abs(quaternion_z)
  • angle_heading uses arctan2(np.abs(quaternion_xy))
  • angle_inclination uses 2*arcsin(np.abs(quaternion_xy))
  • Roll/pitch compensation sets pitch and roll of q_comp to zero by using inverse rotation

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-29 07:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Pywayne Lark Bot

wangyendt
飞书/Lark 机器人 API 封装,提供完整的飞书机器人交互功能。适用于需要发送文本、图片、音频、文件、帖子、交互式、分享等各类消息的场景。
★ 0 📥 1,261
productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 445 📥 226,292
productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,837