跳转到内容

UBot ROSConventions Library

C++
UUBotROSConventionsLibrary
父类
UBlueprintFunctionLibrary
类型
函数库
模块
UBotROS · UBotROS 0.1.3
头文件
Source/UBotROS/Public/UBotROSConventionsLibrary.h

在蓝图里使用 ROS 专有的约定:相机光学系、builtin_interfaces/Time 的字段和 ROS 名字。对应 C++ 的 UBot::ROSConventions。ROS 用的 UE 与右手系轴向换算在 uBotCore 的坐标约定库里(类别 uBot|Conventions,节点 UE To Right-Handed …)。

纯函数 · UUBotROSConventionsLibrary.CameraLinkToOpticalRotation

相机光学系(z 向前、x 向右、y 向下)相对相机 link 系的旋转,ROS 约定。

引脚方向类型
Return Value输出Quat结构体

纯函数 · UUBotROSConventionsLibrary.GetOpticalFrameSuffix

接在相机 frame id 后面、组成光学系 frame id 的后缀 _optical。

引脚方向类型
Return Value输出String

纯函数 · UUBotROSConventionsLibrary.RosTimeToSeconds

把 builtin_interfaces/Time 的 sec 和 nanosec 换成秒。nanosec 为负数时按 0 处理。

引脚方向类型默认值
Sec输入Integer0
Nanosec输入Integer0
Return Value输出Float (double)

纯函数 · UUBotROSConventionsLibrary.SanitizeRosName

生成合法的 ROS 名字片段:只保留 A-Z、a-z、0-9 和下划线,连续下划线合并,首字符是数字时加前缀下划线,结果不会为空。

引脚方向类型
Name输入String
Return Value输出String

纯函数 · UUBotROSConventionsLibrary.SecondsToRosTime

把秒换成 builtin_interfaces/Time 的 sec 和 nanosec。负数或非有限值得到 (0, 0)。

引脚方向类型默认值
Seconds输入Float (double)0.0
Sec输出Integer
Nanosec输出Integer