uBot Flight Controller
物理多旋翼的飞控。多旋翼每个物理步(或每隔 Controller Rate Divider 步)带着真值状态和当前控制模式的目标调用一次 Compute Motor Commands,并执行它返回的归一化电机指令。在 C++ 里继承并重写 _Implementation 函数即可换成自己的飞控;蓝图子类也能用,但以物理频率(默认 1 kHz)经蓝图虚拟机运行,需要调大 Controller Rate Divider。
Compute Motor Commands
Section titled “Compute Motor Commands”Compute Motor CommandsTarget is uBot Flight ControllerTargetStateSetpointDelta Seconds0.0Out Motor Commands
返回这一步的归一化电机指令(0 到 1,按电机顺序每个转子一个)。Delta Seconds 是到下次调用的时间,单位 s。
| 引脚 | 方向 | 类型 | 默认值 |
|---|---|---|---|
| State | 输入 | UBot Multirotor State结构体 | |
| Setpoint | 输入 | UBot Flight Setpoint结构体 | |
| Delta Seconds | 输入 | Float (double) | 0.0 |
| Out Motor Commands | 输出 | Float (double)数组 |
Reset Controller
Section titled “Reset Controller”Reset ControllerTarget is uBot Flight ControllerTargetStateAirframe
清空飞控的记忆(积分项和目标),并接收它要飞的机架。
| 引脚 | 方向 | 类型 |
|---|---|---|
| State | 输入 | UBot Multirotor State结构体 |
| Airframe | 输入 | UBot Multirotor Airframe结构体 |
Supports Control Mode
Section titled “Supports Control Mode”Supports Control ModeTarget is uBot Flight ControllerTargetModeVelocityReturn Value
这个飞控是否执行 Mode 的目标。电机模式不会到达飞控。
| 引脚 | 方向 | 类型 | 默认值 |
|---|---|---|---|
| Mode | 输入 | EUBot Flight Control Mode枚举 | Velocity |
| Return Value | 输出 | Boolean |