UBot Sensor Component
所有 uBot 传感器组件的基类。组件本身就是传感器坐标系;启动后按 Update Rate Hz 在 uBot 仿真时间上定时采样,每帧最多采样一次。
Get Dropped Sample Count
Section titled “Get Dropped Sample Count”Get Dropped Sample CountTarget is UBot Sensor ComponentTargetReturn Value
因为一帧跨过了多个采样时刻而跳过的采样次数。Start Sensor 时清零。
| 引脚 | 方向 | 类型 |
|---|---|---|
| Return Value | 输出 | Integer64 |
Get Latest Frame Header
Section titled “Get Latest Frame Header”Get Latest Frame HeaderTarget is UBot Sensor ComponentTargetReturn Value
返回最近一次采样的帧头。
| 引脚 | 方向 | 类型 |
|---|---|---|
| Return Value | 输出 | UBot Frame Header结构体 |
Is Sensor Model Visible in Game
Section titled “Is Sensor Model Visible in Game”Is Sensor Model Visible in GameTarget is UBot Sensor ComponentTargetReturn Value
返回游戏中是否显示传感器模型,等于 Hide Sensor Model in Game 取反。
| 引脚 | 方向 | 类型 |
|---|---|---|
| Return Value | 输出 | Boolean |
Sample Sensor
Section titled “Sample Sensor”Sample SensorTarget is UBot Sensor ComponentTargetReturn Value
立即采样一次,不要求传感器已经启动。本次样本为 Valid 时返回 true。
| 引脚 | 方向 | 类型 |
|---|---|---|
| Return Value | 输出 | Boolean |
Set Sensor Model Visible in Game
Section titled “Set Sensor Model Visible in Game”Set Sensor Model Visible in GameTarget is UBot Sensor ComponentTargetModel Visible
运行中显示或隐藏传感器模型。Model Visible 为 true 时显示。
| 引脚 | 方向 | 类型 | 默认值 |
|---|---|---|---|
Model VisiblebModelVisible | 输入 | Boolean | false |
Set Update Rate Hz
Section titled “Set Update Rate Hz”Set Update Rate HzTarget is UBot Sensor ComponentTargetNew Update Rate Hz0.0
修改采样频率,限制在 0.1–240 Hz。运行中的传感器不会重启,下一次采样时刻保持不变。
| 引脚 | 方向 | 类型 | 默认值 |
|---|---|---|---|
| New Update Rate Hz | 输入 | Float | 0.0 |
Start Sensor
Section titled “Start Sensor”Start SensorTarget is UBot Sensor ComponentTargetReturn Value
启动传感器:立即采样一次,之后按 Update Rate Hz 定时采样。Sensor Enabled 为 false 时返回 false。
| 引脚 | 方向 | 类型 |
|---|---|---|
| Return Value | 输出 | Boolean |
Stop Sensor
Section titled “Stop Sensor”Stop SensorTarget is UBot Sensor ComponentTarget
停止定时采样。手动调用 Sample Sensor 仍然可以采样。
在 Components 面板选中组件,在 Details 面板底部 Events 区点事件旁的 + 即可生成事件节点。
On Sensor Error
Section titled “On Sensor Error”On Sensor ErrorError Message
采样出错时触发,Error Message 说明原因,例如位姿传感器的参考组件无效。
| 引脚 | 方向 | 类型 |
|---|---|---|
| Error Message | 输出 | String |
On Sensor Sampled
Section titled “On Sensor Sampled”On Sensor SampledHeader
每次采样后触发,Header 是本次的帧头。每种传感器都有这个事件。
| 引脚 | 方向 | 类型 |
|---|---|---|
| Header | 输出 | UBot Frame Header结构体 |
On Sensor Started
Section titled “On Sensor Started”On Sensor Started
传感器成功启动时触发,在启动时的第一个样本之前。
On Sensor Stopped
Section titled “On Sensor Stopped”On Sensor Stopped
传感器从运行变为停止时触发,包括运行结束时的自动停止。
未特别标注的属性:蓝图里只读,Details 面板里可以编辑。
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
Auto StartbAutoStart · uBot Sensor | Boolean | true | 为 true 时在 BeginPlay 自动启动传感器。 |
Frame IdFrameId · uBot Sensor | String | "" | 写入帧头的坐标系名(TF frame id)。为空时用传感器标识;各传感器有自己的默认值。 |
Sensor EnabledbSensorEnabled · uBot Sensor | Boolean | true | 为 false 时无法启动;手动采样只得到 Disabled 帧头。 |
Sensor IdSensorId · uBot Sensor | String | "" | 写入帧头的传感器标识。为空时用组件名;各传感器有自己的默认值。 |
Update Rate HzUpdateRateHz · uBot Sensor | Float | 10.0 | 自动采样频率,单位 Hz。运行中修改请用 Set Update Rate Hz。范围 0.1 – 240.0 |
Debug VisualizationbDebugVisualization · uBot Sensor|Debug | Boolean | false | 为 true 时,运行中画出调试射线。只有激光雷达使用。 |
Hide Sensor Model in GamebHideSensorModelInGame · uBot Sensor|Model | Boolean | true | 为 true 时,游戏中隐藏传感器模型。运行中可用 Set Sensor Model Visible in Game 切换。 |
Noise EnabledbNoiseEnabled · uBot Sensor|Noise | Boolean | false | 噪声总开关。只对 IMU、里程计和 2D / 3D 激光雷达有效,位姿传感器和相机没有噪声。 |
Random SeedRandomSeed · uBot Sensor|Noise | Integer | 1337 | 噪声随机序列的种子。每次 Start Sensor 都用它重置随机序列。 |