强大的六轴姿态航向参考系统 | 基于 Madgwick 融合算法与扩展卡尔曼滤波器
Robust 6-Axis Attitude and Heading Reference System | Madgwick Fusion & Extended Kalman Filter
基于 Sebastian Madgwick 博士论文,实现稳定可靠的四元数姿态估计
Based on Sebastian Madgwick's PhD thesis, stable quaternion-based attitude estimation
6状态 EKF,估计四元数和陀螺仪偏置,自适应滤波
6-state EKF estimates quaternion and gyro bias with adaptive filtering
检测高加速度事件,快速恢复姿态,适应机器人对抗场景
Detects high-acceleration events, rapid attitude recovery for robot competitions
检测并补偿线性加速度干扰,提高动态环境下精度
Detects and compensates linear acceleration interference in dynamic environments
估计垂直方向的位移和速度,适用于船舶、平台稳定
Estimates vertical displacement and velocity for ship/platform stabilization
实时分析加速度计和陀螺仪噪声特性,动态调整滤波参数
Real-time noise analysis of IMU sensors, dynamic filter parameter adjustment
系统实时检测设备的三种运动状态:静止(STATIC)、稳定(STABLE)、动态(DYNAMIC),并根据状态自适应调整滤波器参数。
The system detects three motion states in real-time: STATIC, STABLE, and DYNAMIC, adaptively adjusting filter parameters based on the detected state.
| 状态 | State | 描述 | Description | Acc Weight |
|---|---|---|---|---|
STATIC |
完全静止 | Completely still | 80-100% | |
STABLE |
轻微运动 | Slight motion | 40-60% | |
DYNAMIC |
剧烈运动 | Intense motion | 10-30% |
检测机器人碰撞、跌落等高加速度事件,快速恢复姿态估计。适用于 RoboMaster 等对抗性机器人比赛。
Detects high-acceleration events like robot collisions and falls, rapidly recovering attitude estimation. Ideal for competitive robot competitions like RoboMaster.
| Parameter | 默认值 | Default | 描述 | Description |
|---|---|---|---|---|
impactAccThreshold |
0.5g | 加速度变化阈值 | Acceleration change threshold | |
impactGyroThreshold |
100°/s | 角速度变化阈值 | Gyro rate change threshold | |
impactRecoveryDuration |
0.5s | 恢复时间 | Recovery duration | |
accWeightImpact |
5% | 冲击时加速度权重 | Accel weight during impact |
通过高频滤波和偏置估计,实时估计设备在垂直方向的位移和速度。广泛应用于船舶稳定、平台姿态控制。
Real-time estimation of vertical displacement and velocity using high-pass filtering and bias estimation. Widely used in ship stabilization and platform attitude control.
// 获取浮沉估计结果 float heavePos = sys.heavePosition; // 垂直位移 (m) float heaveVel = sys.heaveVelocity; // 垂直速度 (m/s) // 初始化时设置截止频率 Tactical_Init(&sys, 100.0f, 0.1f); // ↑ 采样率 ↑ 浮沉截止频率
实时统计加速度计和陀螺仪的噪声特性(均值、方差),动态调整 EKF 的过程噪声和观测噪声参数,实现最优滤波效果。
Real-time statistics of IMU noise characteristics (mean, variance), dynamically adjusting EKF process and observation noise parameters for optimal filtering.
| Field | 描述 | Description |
|---|---|---|
accNoise |
加速度计噪声估计 | Accelerometer noise estimate |
gyroNoise |
陀螺仪噪声估计 | Gyroscope noise estimate |
accMagVar |
加速度模值方差 | Acceleration magnitude variance |
gyroMagVar |
陀螺仪模值方差 | Gyroscope magnitude variance |
// EKF Version - Recommended for high precision #include "Tactical_Fusion.h" TacticalSystem sys; void main() { // Initialize: 100Hz sample rate, 0.1Hz heave cutoff Tactical_Init(&sys, 100.0f, 0.1f); while (1) { // Gyroscope data: deg/s FusionVector gyro = {gx, gy, gz}; // Accelerometer data: g FusionVector acc = {ax, ay, az}; // Update attitude estimation Tactical_Update(&sys, gyro, acc); // Get quaternion FusionQuaternion q = sys.quaternion; // Get Euler angles FusionEuler euler = FusionQuaternionToEuler(q); // Get heave (vertical motion) float heave = sys.heavePosition; } }
东北大学 T-DT Lab 用于 2024 赛季超级对抗赛
T-DT Lab, NEU - Super Challenge 2024 Season
四轴/六轴飞行器的实时姿态估计
Real-time attitude estimation for quadcopters
低延迟头部姿态捕捉
Low-latency head tracking
浮沉估计用于船舶姿态控制
Heave estimation for ship motion control