跳转到内容

uBot ROS Motor Command

C++
UUBotROSMotorCommandComponent
父类
uBot ROS Command Receiver UUBotROSCommandReceiverComponent
类型
组件 · 可在 Components 面板添加
模块
UBotROS · UBotROS 0.1.2
头文件
Source/UBotROS/Public/UBotROSMotorCommandComponent.h

接收 ROS 2 的 actuator_msgs/msg/Actuators,换算后交给实现了 UBot Motor Commandable 的目标(例如无人机的 uBot Multirotor Dynamics 组件)。话题是 /<namespace>/cmd_motors。velocity[](rad/s)有值时用它,否则用 normalized[](0 到 1);position[] 被忽略。长度与目标电机数不同的指令不会下发。需要 actuator_msgs 包(ros-humble-actuator-msgs)。

纯函数 · UUBotROSMotorCommandComponent.GetLastMotorCommand

最近一条有效的电机指令;收到第一条之前为空。

引脚方向类型
Return Value输出UBot Motor Command结构体

在 Components 面板选中组件,在 Details 面板底部 Events 区点事件旁的 + 即可生成事件节点。

事件 · UUBotROSMotorCommandComponent.OnMotorCommand

每条有效电机指令换算之后触发,有没有目标都触发。

引脚方向类型
Command输出UBot Motor Command结构体

来自 uBot ROS Command Receiver

节点
属性