数据结构
共用数据结构
Section titled “共用数据结构”AbcType
Section titled “AbcType”using AbcType = double;AbcErrorCode
Section titled “AbcErrorCode”| 枚举量 | 值 | 说明 | |
|---|---|---|---|
| 0 | 成功 | |
| -1 | 未知错误 | 通用错误(-1~-49) |
| -2 | 超时 | |
| -3 | 无效句柄 | |
| -4 | 无效状态 | |
| -5 | 未初始化 | |
| -6 | 未实现的功能 | |
| -7 | 无效参数 | |
| -50 | 参数错误 | 参数错误(-50~-99) |
| -51 | 参数取值超出范围 | |
| -100 | 机械臂通用错误 | 机械臂错误(-100~-199) |
| -101 | 控制器返回 false,传递参数错误或机械臂状态发生错误 | |
| -102 | 数据发送失败,通信过程中出现问题 | |
| -103 | 数据接收失败,通信过程中出现问题或者控制器超时没有返回 | |
| -104 | 返回值解析失败,接收到的数据格式不正确或不完整 | |
| -105 | 当前到位设备校验失败,即当前到位设备不为关节 | |
| -106 | 超时未接收到返回 | |
| -107 | 机械臂运动超出范围 | |
| -200 | 躯干通用错误 | 躯干错误(-200~-219) |
| -201 | 躯干 CAN 总线错误 | |
| -202 | 躯干执行器错误 | |
| -206 | 超时未接收到返回 | |
| -207 | 躯干运动超出范围 | |
| -220 | 头部通用错误 | 头部错误(-220~-229) |
| -221 | 头部 CAN 总线错误 | |
| -222 | 头部执行器错误 | |
| -226 | 超时未接收到返回 | |
| -227 | 头部运动超出范围 | |
| -300 | 传感器通用错误 | 传感器错误(-300~-399) |
| -301 | 传感器未连接 | |
| -302 | 传感器数据错误 | |
| -400 | 底盘通用错误 | 底盘错误(-400~-499) |
| -401 | 底盘初始化错误 | |
| -402 | 底盘超时未接收到返回 | |
| -900 | 算法通用错误 | 算法错误(-900~-999) |
| -901 | 算法未收敛 | |
| -902 | 算法近似解 | |
AbcPose
Section titled “AbcPose”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
position | AbcPosition | XYZ 坐标 |
quaternion | AbcQuat | 四元数 |
AbcPosition
Section titled “AbcPosition”| 结构体成员 | 数据类型 | 说明 |
x | AbcType | XYZ 坐标值,单位为米。 |
y | ||
z |
AbcQuat
Section titled “AbcQuat”| 结构体成员 | 数据类型 | 说明 |
w | AbcType | 四元数 |
x | ||
y | ||
z |
AbcPoseVelocity
Section titled “AbcPoseVelocity”| 结构体成员 | 数据类型 | 说明 |
x | AbcType | 笛卡尔空间速度 |
y | ||
z | ||
wx | ||
wy | ||
wz |
ArmType
Section titled “ArmType”| 枚举量 | 值 | 说明 |
RM65_B | 0 | 机械臂型号 |
RM65_6FB | 1 | |
RM65_6F | 2 | |
RM75_B | 3 | |
RM75_6FB | 4 | |
RM75_6F | 5 | |
ZM73L_6F | 6 | |
ZM73R_6F | 7 |
RobotType
Section titled “RobotType”| 枚举量 | 值 | 说明 |
AlphaBot1s | 1 | 机器人型号 |
AlphaBot2 | 2 | |
AlphaBot1s_HuiKe | 3 |
AbcTorsoPose4D
Section titled “AbcTorsoPose4D”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
height | AbcType | 垂直高度,单位为米(m)。 |
forward | AbcType | 前后方向位移,单位为米(m)。 |
pitch | AbcType | 俯仰角,单位为弧度(rad)。 |
yaw | AbcType | 腰部旋转角,单位为弧度(rad)。 |
机械臂相关的数据结构
Section titled “机械臂相关的数据结构”AbcArmCurrentStatus
Section titled “AbcArmCurrentStatus”| 枚举量 | 说明 |
|---|---|
ARM_IDLE | 使能但空闲状态 |
ARM_MOVE | 运动中状态 |
ARM_MOVE_THROUGH_JOINT | 角度透传状态 |
ARM_MOVE_THROUGH_POSE | 位姿透传状态 |
ARM_MOVE_THROUGH_FORCE_POSE | 力控透传状态 |
ARM_MOVE_THROUGH_CURRENT | 电流环透传状态 |
ARM_STOP | 急停状态 |
ARM_SLOW_STOP | 缓停状态 |
ARM_PAUSE | 暂停状态 |
ARM_CURRENT_DRAG | 电流环拖动状态 |
ARM_SENSOR_DRAG | 六维力拖动状态 |
ARM_TECH_DEMONSTRATION | 示教状态 |
AbcJointState
Section titled “AbcJointState”关节状态结构体包含以下成员。如果关节数量小于 MAX_ARM_DOF,则多余的数据为 0。
| 结构体成员 | 数据类型 | 说明 |
joints | array<AbcType, MAX_ARM_DOF> | 当前各关节角度,单位为 rad(弧度)。 |
joint_position | 当前各关节角度,单位为 °(度)。 | |
joint_speed | 当前各关节速度,单位为 RPM(转/分)。 | |
joint_current | 当前各关节电流,单位为 mA(毫安)。 | |
joint_temperature | 当前各关节温度,单位为 °C(摄氏度)。 | |
joint_voltage | 当前各关节电压,单位为 V(伏特)。 | |
joint_err_code | array<uint16_t, MAX_ARM_DOF> | 当前各关节错误码。 |
joint_en_flag | array<bool, MAX_ARM_DOF> | 当前各关节使能标志位。 - true 为上使能。- false 为掉使能。 |
AbcArmForceSensor
Section titled “AbcArmForceSensor”力传感器
| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
force | AbcType[6] | 当前力传感器原始数据,单位为 0.001N 或 0.001N·m。 |
zero_force | AbcType[6] | 当前力传感器系统外受力数据,单位为 0.001N 或 0.001N·m。 |
coordinate | int | 系统外受力数据的坐标系。 - 0:传感器坐标系。- 1:当前工作坐标系。- 2:当前工具坐标系。 |
AbcArmRealtimeState
Section titled “AbcArmRealtimeState”实时回调机械臂信息
| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
name | char[64] | 机械臂名称 |
timestamp | std::chrono::system_clock::time_point | 状态时间戳 |
joint_status | AbcJointState | 关节状态 |
pose | AbcPose | 机械臂当前位姿 |
force_sensor | AbcArmForceSensor | 力传感器状态 |
arm_current_status | AbcArmCurrentStatus | 机械臂状态 |
gripper_state | AbcGripperState | 夹爪状态 |
ee_pose | AbcPose | 末端位姿 |
PeripheralReadWriteParams
Section titled “PeripheralReadWriteParams”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
port | int | 通信端口。 - 0:控制器 RS485 端口。- 1:末端接口板 RS485 接口。- 3:控制器 Modbus TCP 设备。 |
address | int | 数据起始地址 |
device | int | 外设设备地址 |
num | int | 数据的数量 |
UdpCustomConfig
Section titled “UdpCustomConfig”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
joint_speed | int | 关节速度。 |
lift_state | int | 升降关节信息。 - 1:上报。- 0:关闭上报。- -1:不设置,保持之前的状态。 |
expand_state | int | 扩展关节信息(升降关节和扩展关节为二选一,优先显示升降关节)。 - 1:上报。- 0:关闭上报。- -1:不设置,保持之前的状态。 |
hand_state | int | 灵巧手状态。 - 1:上报。- 0:关闭上报。- -1:不设置,保持之前的状态。 |
arm_current_status | int | 机械臂当前状态。 - 1:上报。- 0:关闭上报。- -1:不设置,保持之前的状态。 |
aloha_state | int | AlphaBot 主臂状态。 - 1:上报。- 0:关闭上报。- -1:不设置,保持之前的状态。 |
RealtimePushConfig
Section titled “RealtimePushConfig”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
cycle | int | 广播周期,值为 5ms 的倍数。 |
enable | bool | 使能,是否主动上报。 |
port | int | 广播的端口号。 |
force_coordinate | int | 系统外受力数据的坐标系。 - -1:不支持力传感器。- 0:传感器坐标系。- 1:当前工作坐标系。- 2:当前工具坐标系。 |
ip | char[28] | 自定义的上报目标 IP 地址。 |
custom_config | UdpCustomConfig | 自定义项内容。 |
ArmFactoryParam
Section titled “ArmFactoryParam”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
arm_type | string | 机械臂厂商。 |
arm_name | string | 机械臂名称,例如 "left_arm"。 |
ip | string | TCP IP 地址。 |
udp_ip | string | UDP IP 地址。 |
port | int | TCP 端口号。 |
udp_port | int | UDP 端口号。 |
udp_cycle | int | UDP 周期,以 udp_cycle * 5 毫秒为周期。 |
enable_gripper | bool | 夹爪状态。 |
MAX_ARM_DOF
Section titled “MAX_ARM_DOF”const size_t MAX_ARM_DOF = 7;AbcArmRealtimeStateCallback
Section titled “AbcArmRealtimeStateCallback”using AbcArmRealtimeStateCallback = std::function<void(std::shared_ptr<const AbcArmRealtimeState>)>;底盘相关的数据结构
Section titled “底盘相关的数据结构”ChassisFactoryParam
Section titled “ChassisFactoryParam”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
chassis_type | string | 底盘厂商。 |
chassis_name | string | 底盘名称,例如 "chassis"。 |
ip | string | IP 地址,例如 "127.0.0.1"。 |
port | int | 端口号,例如 54051。 |
ChassisPose2D
Section titled “ChassisPose2D”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
theta | float | 朝向 |
x | float | X 轴坐标值 |
y | float | Y 轴坐标值 |
ChassisPoseSpeed
Section titled “ChassisPoseSpeed”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
map_id | uint32_t | 当前地图 ID |
mileage | uint32_t | 累计里程数 |
robot_id | uint32_t | 底盘 ID |
pose | ChassisPose2D | 2D 位姿 |
twist | ChassisTwist | 速度 |
ChassisPoint32
Section titled “ChassisPoint32”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
x | float | X 轴坐标值 |
y | float | Y 轴坐标值 |
z | float | Z 轴坐标值 |
ChassisTwist
Section titled “ChassisTwist”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
angular | float | 角速度 |
linear | float | 线速度 |
ChassisTransformStamped
Section titled “ChassisTransformStamped”| 结构体成员 | 数据类型 | 说明 |
frame_id | string | 父坐标系 |
secs | int32_t | 秒 |
nsecs | uint32_t | 纳秒 |
child_frame_id | string | 子坐标系 |
t_x | double | XYZ 坐标值 |
t_y | double | |
t_z | double | |
r_x | double | 四元数 |
r_y | double | |
r_z | double | |
r_w | double |
ChassisBattery
Section titled “ChassisBattery”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
charge_state | ChargeState | 充电状态 |
robot_id | uint32_t | 底盘 ID |
power | uint32_t | 电量百分比,取值范围为 0~100。 - 100:全满。- 0:无电量。 |
health | uint32_t | 电池健康(充满容量/设计容量) |
charge_cycle | uint32_t | 循环次数 |
battery_cycle | uint32_t | 电池寿命 |
temp_max | uint32_t | 电池温度(最高温度) |
success | bool | 请求是否成功。 - true:成功响应请求。- false:未成功处理请求。 |
msg | string | 应答消息描述,通常用于请求未能处理时的原因描述。 |
ChassisBattery::ChargeState
Section titled “ChassisBattery::ChargeState”| 枚举量 | 值 | 说明 |
|---|---|---|
kChargeStateUndefined | 0 | 未定义 |
kNot | 1 | 未充电 |
kManual | 2 | 手动充电中 |
kAuto | 3 | 自动充电中 |
ChassisOperationState
Section titled “ChassisOperationState”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
robot_id | uint32_t | 底盘 ID |
nav | NavState | 底盘导航相关位信息 |
robot | RobotBit | 底盘位信息 |
success | bool | 请求是否成功。 - true:成功响应请求。- false:未成功处理请求。 |
msg | string | 应答消息描述,通常用于请求未能处理时的原因描述。 |
ChassisOperationState::NavState
Section titled “ChassisOperationState::NavState”| 枚举量 | 值 | 说明 |
|---|---|---|
kNavBitUndefined | 0 | 未定义 |
kNarrow | 1 | 狭窄通道 |
kGuide | 2 | 引导到达 |
kInaLift | 3 | 乘梯中 |
kImpede | 4 | 阻碍 |
kQRCode | 5 | 二维码 |
kStage | 6 | 分段到达 |
ChassisOperationState::RobotBit
Section titled “ChassisOperationState::RobotBit”| 枚举量 | 值 | 说明 |
|---|---|---|
kRobotBitUndefined | 0 | 未定义 |
kTaskable | 1 | 可接任务 |
ChassisState
Section titled “ChassisState”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
robot_id | uint32_t | 底盘 ID |
state | State | 底盘自动模式状态 |
success | bool | 请求是否成功。 - true:成功响应请求。- false:未成功处理请求。 |
msg | string | 应答消息描述,通常用于请求未能处理时的原因描述。 |
ChassisState::State
Section titled “ChassisState::State”| 枚举量 | 值 | 说明 |
|---|---|---|
kStateUndefined | 0 | 未定义 |
kUninit | 1 | 未初始化 |
kIdle | 2 | 空闲 |
kParking | 3 | 泊车中 |
kTask | 4 | 任务中 |
kWarning | 5 | 警告 |
kFault | 6 | 异常 |
kFollowing | 7 | 跟随中 |
kCharging | 8 | 充电中 |
kMapping | 9 | 构图中 |
ChassisStatusCode
Section titled “ChassisStatusCode”单个状态码信息
| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
robot_id | uint32_t | 底盘 ID |
code | uint64_t | 状态码 |
time | uint64_t | 时间 |
status_msg | string | 描述 |
robot_task_id | int64_t | 任务 ID |
state | RobotState | 自动模式状态 |
type | ActionType | 动作类型 |
level | Level | 等级 |
success | bool | 请求是否成功。 - true:成功响应请求。- false:未成功处理请求。 |
msg | string | 应答消息描述,通常用于请求未能处理时的原因描述。 |
ChassisStatusCode::RobotState
Section titled “ChassisStatusCode::RobotState”| 枚举量 | 值 | 说明 |
|---|---|---|
rs_kStateUndefined | 0 | 未定义 |
rs_kUninit | 1 | 未初始化 |
rs_kIdle | 2 | 空闲 |
rs_kParking | 3 | 泊车中 |
rs_kTask | 4 | 任务中 |
rs_kWarning | 5 | 警告 |
rs_kFault | 6 | 异常 |
rs_kFollowing | 7 | 跟随中 |
rs_kCharging | 8 | 充电中 |
rs_kMapping | 9 | 构图中 |
ChassisStatusCode::ActionType
Section titled “ChassisStatusCode::ActionType”动作类型
| 枚举量 | 值 | 说明 |
|---|---|---|
at_kTypeUndefined | 0 | 未定义 |
at_kNav | 1 | 导航 |
at_kStepCtrl | 2 | 单步控制 |
at_kSecondposEnter | 3 | 二次定位进入 |
at_kSecondposQuit | 4 | 二次定位退出 |
at_kCarry | 5 | 搬运动作 |
at_kWait | 6 | 等待 |
at_kCharge | 7 | 充电 |
ChassisStatusCode::Level
Section titled “ChassisStatusCode::Level”| 枚举量 | 值 | 说明 |
|---|---|---|
l_kNormal | 0 | 正常 |
l_kTips | 1 | 提示 |
l_kWarn | 2 | 警告 |
l_kFault | 3 | 故障 |
ChassisHardwareState
Section titled “ChassisHardwareState”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
robot_id | uint32_t | 底盘 ID |
lidars | vector<HardwareState_State> | repeated 激光雷达 2 |
cameras | vector<HardwareState_State> | repeated 摄像头 2 |
success | bool | 请求是否成功。 - true:成功响应请求。- false:未成功处理请求。 |
msg | string | 应答消息描述,通常用于请求未能处理时的原因描述。 |
ChassisHardwareState::HardwareState_State
Section titled “ChassisHardwareState::HardwareState_State”硬件状态类型
| 枚举量 | 值 | 说明 |
|---|---|---|
kNormal | 0 | 正常 |
kInfo | 1 | 提示 |
kWarn | 16 | 警告 |
kFatal | 17 | 故障 |
ChassisTaskResponse
Section titled “ChassisTaskResponse”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
task_state | TaskState | 任务状态 |
current_pose | ChassisPose2D | 当前 2D 位姿 |
msg_type | MassageType | 消息类型 |
msg | string | 应答消息描述,通常用于请求未能处理时的原因描述。 |
ChassisTaskResponse::TaskState
Section titled “ChassisTaskResponse::TaskState”| 枚举量 | 值 | 说明 |
|---|---|---|
kSuccess | 0 | 完成 |
kRunning | 1 | 执行中 |
kFailed | 2 | 失败 |
ChassisTaskResponse::MassageType
Section titled “ChassisTaskResponse::MassageType”| 枚举量 | 值 | 说明 |
|---|---|---|
kNormal | 0 | 正常 |
kWarn | 1 | 警告 |
kFault | 2 | 故障 |
头部和躯干相关的数据结构
Section titled “头部和躯干相关的数据结构”ABC_TORSO_DOF
Section titled “ABC_TORSO_DOF”#define ABC_TORSO_DOF 4ABC_HEAD_DOF
Section titled “ABC_HEAD_DOF”#define ABC_HEAD_DOF 2HeadFactoryParam
Section titled “HeadFactoryParam”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
head_type | string | 头部厂商,例如 "ti5"(钛虎头部)。 |
head_name | string | 头部名称。 |
head_joint_num | uint8_t | 头部关节数。 |
comm_params | CommParamsUnion | 通信参数。 |
motor_params | vector<MotorParam> | 电机参数。 |
CommParamsUnion
Section titled “CommParamsUnion”| 联合体成员 | 数据类型 | 说明 |
|---|---|---|
can | CommParamsCAN | CAN 参数。 |
eth | CommParamsETH | ETH 参数(预留)。 |
CommParamsCAN
Section titled “CommParamsCAN”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
device | string | 设备名称,例如 "can0"。 |
baud_rate | int | 波特率,例如 500000。 |
can_id | uint8_t | CAN 节点 ID(0x00~0xFF)。 |
CommParamsETH
Section titled “CommParamsETH”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
ip | string | IP 地址。 |
port | uint16_t | 端口号。 |
MotorParam
Section titled “MotorParam”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
motor_id | uint16_t | 电机 ID。 |
reduction_ratio | uint16_t | 减速比。 |
position_max | AbcType | 转动的最大角度。 |
position_min | AbcType | 转动的最小角度。 |
speed_max | AbcType | 转动的最大速度。 |
speed_min | AbcType | 转动的最小速度。 |
acc_max | AbcType | 转动的最大加速度。 |
acc_min | AbcType | 转动的最小加速度。 |
TorsoFactoryParam
Section titled “TorsoFactoryParam”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
torso_type | string | 躯干厂商,例如 ti5(钛虎躯干)。 |
torso_name | string | 躯干名称。 |
torso_joint_num | uint8_t | 躯干关节数。 |
comm_params | CommParamsUnion | 通信参数。 |
motor_params | vector<MotorParam> | 电机参数。 |
AbcTorsoStateCallback
Section titled “AbcTorsoStateCallback”using AbcTorsoStateCallback = std::function< void(std::shared_ptr<const AbcTorsoState>)>;AbcTorsoState
Section titled “AbcTorsoState”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
timestamp | std::chrono::system_clock::time_point | 时间戳 |
err_code | std::array<uint32_t, ABC_TORSO_DOF> | 各关节错误码 |
joints_positions | std::array<AbcType, ABC_TORSO_DOF> | 各关节角度 |
joints_speed | std::array<AbcType, ABC_TORSO_DOF | 各关节速度 |
joints_current | std::array<AbcType, ABC_TORSO_DOF> | 各关节电流 |
传感器相关的数据结构
Section titled “传感器相关的数据结构”DepthSensorParam
Section titled “DepthSensorParam”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
sensor_type | string | 传感器厂商,例如 "realsense"。 |
sensor_name | string | 传感器名称,例如 "head_camera"。 |
serial_number | string | 序列号。 |
color_width | int | 彩色图的宽。 |
color_height | int | 彩色图的高。 |
depth_width | int | 深度图的宽。 |
depth_height | int | 深度图的高。 |
frame_rate | int | 帧率。 |
align_to_color | bool | 是否将深度图对齐到彩色图。 |
enable_depth | bool | 是否启用深度流。默认为 true;设置为 false 时,深度流及所有依赖深度数据的相关逻辑将被关闭。 |
active_pull | bool | 是否采用主动拉流模式。默认为 false(后台自动拉流);设置为 true 时,仅在调用 get_data() 时拉取一帧,且不支持回调机制。 |
SensorCallback
Section titled “SensorCallback”using SensorCallback = std::function< void(std::shared_ptr<const SensorData>)>;SensorType
Section titled “SensorType”| 枚举量 | 说明 |
|---|---|
CAMERA | 相机类传感器 |
DEPTH_CAMERA | 深度相机 |
LIDAR | 激光雷达 |
IMU | 惯性测量单元 |
FORCE_TORQUE | 力矩传感器 |
PROXIMITY | 接近传感器 |
OTHER | 其他类型传感器 |
SensorStatus
Section titled “SensorStatus”| 枚举量 | 说明 |
|---|---|
DISCONNECTED | 未连接 |
CONNECTED | 已连接 |
STREAMING | 数据流传输中 |
SENSOR_ERROR | 错误状态 |
AbcIntrinsic
Section titled “AbcIntrinsic”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
width | int | 图像宽度,单位为像素。 |
height | int | 图像高度,单位为像素。 |
ppx | float | 图像主点的水平坐标,以距左边缘的像素偏移量表示。 |
ppy | float | 图像主点的垂直坐标,以距上边缘的像素偏移量表示。 |
fx | float | 水平焦距,以像素宽度倍数表示。 |
fy | float | 垂直焦距,以像素高度倍数表示。 |
coeffs | float[5] | 畸变系数。各模型的参数顺序如下。 - Brown-Conrady 模型: [k1, k2, p1, p2, k3]。- F-Theta 鱼眼镜头模型: [k1, k2, k3, k4, 0]。- 其他模型:参见其具体解释规则。 |
轨迹规划器相关的数据结构
Section titled “轨迹规划器相关的数据结构”TrajectoryPoint
Section titled “TrajectoryPoint”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
positions | vector<AbcType> | 位置 |
velocities | vector<AbcType> | 速度 |
accelerations | vector<AbcType> | 加速度 |
timestamp | AbcType | 时间戳 |
TrajectoryEvaluation
Section titled “TrajectoryEvaluation”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
is_valid | bool | 轨迹是否有效 |
issues | vector<string> | 存在的问题 |
score | double | 轨迹得分(分值越高越好) |
has_collision | bool | 是否存在碰撞 |
collision_indices | vector<size_t> | 碰撞点索引 |
TrajectoryStatusCallback
Section titled “TrajectoryStatusCallback”using TrajectoryStatusCallback = std::function< void(bool finished, AbcErrorCode error_code)>;传感器同步器相关的数据结构
Section titled “传感器同步器相关的数据结构”SyncDataCallback
Section titled “SyncDataCallback”using SyncDataCallback = std::function< void(std::shared_ptr<SyncDataPackage>)>;SyncPolicy
Section titled “SyncPolicy”| 枚举量 | 说明 |
|---|---|
NEAREST | 最近时间戳匹配 |
INTERPOLATE | 插值匹配 |
EXTRAPOLATE | 外推匹配 |
SyncMode
Section titled “SyncMode”| 枚举量 | 说明 |
|---|---|
LATEST_TIMESTAMP | 基于最新时间戳同步(默认模式) |
REFERENCE_SENSOR | 基于参考传感器同步 |
急停检测相关的数据结构
Section titled “急停检测相关的数据结构”EStopMConfig
Section titled “EStopMConfig”结构体成员 | 数据类型 | 说明 |
|---|---|---|
pressed_level_ | int | 急停按钮按下时的 GPIO 电平极性。 - 0:低电平有效(Active-Low),按下时引脚电平为低。- 1:高电平有效(Active-High),按下时引脚电平为高。 |
allow_multicb_ | bool | 是否允许多个回调函数。 - true:允许设置多个回调函数。- false:仅允许设置一个回调函数。 |
name_ | string | 名称。 |
EStopMConfig | 构造函数 | 使用成员初始化列表的方式初始化所有数据成员。 |
ApacheOrin | 静态函数 | 返回配置完成的 EStopMConfig 实例(gpiochip0 + 引脚 2 + 低电平有效),与 EStopMConfig() 配置相同,适用于搭载 ApacheOrin 芯片的机器人。 |
NvidiaOrin | 静态函数 | 返回配置完成的 EStopMConfig 实例(gpiochip1 + 引脚 9 + 高电平有效),适用于搭载 NvidiaOrin 芯片的机器人。 |
ESState
Section titled “ESState”| 枚举量 | 值 | 说明 |
|---|---|---|
None | -1 | 无法获取状态 |
Pressed | 1 | 急停按钮处于被按下的状态 |
Released | 0 | 急停按钮处于被释放的状态 |
夹爪相关的数据结构
Section titled “夹爪相关的数据结构”AbcGripperState
Section titled “AbcGripperState”| 结构体成员 | 数据类型 | 说明 |
|---|---|---|
status | int | 夹爪状态。 - 0:离线。- 1:在线。- -1:在线,且处于下使能状态。 |
error | int | 夹爪错误信息。 - 低 8 位:夹爪内部的错误信息。 - bit 5~7:预留。 - bit 4:内部通信。 - bit 3:驱动。 - bit 2:过流。 - bit 1:过温。 - bit 0:堵转。 |
mode | int | 当前工作状态。 - 1:夹爪张开到最大且空闲。- 2:夹爪闭合到最小且空闲。- 3:夹爪停止且空闲。- 4:夹爪正在闭合。- 5:夹爪正在张开。- 6:夹爪闭合过程中遇到力控停止。 |
current_force | int | 夹爪当前压力,单位为 g。 |
temperature | int | 当前温度,单位为 °C。 |
actpos | int | 夹爪开口度,取值范围为 0~1000。 - 0:夹爪闭合到最小。- 1000:夹爪张开到最大。 |