Crazyflie firmware(3)-State estimation

在Crazyflie上有两种类型的state estimators:

  • Complementary Filter
  • Extended Kalman Filter

Complementary Filter(CF)

CF最初的输入为IMU上的gyroscope(测量角速度)和accelerator, 后面增加了 Zranger deck(The Z-ranger deck v2 uses a laser sensor to measure the distance to the ground and adds the possibility to fly with precise height control)测量的ToF distance(Time-of-Flight)。滤波器的输出为Crazyflie的姿态角(roll, pitch, yaw)和高度(Z轴的Altitude)。滤波器的输出可以供controller用,也用于manual control(手动操控飞行)。如果你对具体的代码实现感兴趣,可以去参看firmware上的两个C文件:estimator_complementary.c 以及sensfusion6.c。该complementary filter 为Crazyflie firmware上默认的state estimator。下图给出了该滤波器的架构。

Schematic overview of inputs and outputs of the Complementary filter.

Extended Kalman Filter

该滤波器比默认的complementary filter更加复杂,因为它可以接受更多的sensor inputs,both internal与external sensors。具体详细关于EKF,可以参考ETH的课程

Schematic overview of inputs and outputs of the Extended Kalman Filter

我们偏爱Kalman filter in combination with several decks: FlowdeckLoco positioning deck and the lighthouse deck.如果你去看deck driver firmware的代码(例如this one),可以发现我们将KF设为了要求的state estimator,因为我们需要顾及position与velocity。需要指出的是,不同的传感器会有不同的测量精度。例如用Lighthouse deck (mm precision) 定位比loco positioning deck (cm precision)要准确的多。具体实现请参见C代码文件estimator_kalman.c 与kalman_core.c。另外,EKF有一个supervisor,用于在位置或者速度估计失控的情况下进行reset。

Leave a Comment