十四、数据结构定义
Result(返回状态码)
cpp
enum Result {
TIMEOUT = -6,
EXCEPTION = -5,
OPERATION_NOT_ALLOWED = -4,
PARAM_ERR = -3,
DISCONNECT = -2,
RECEIVE_FAILED = -1,
SUCCESS = 0
};| 值 | 含义 |
|---|---|
| 0 | SUCCESS:成功 |
| -1 | RECEIVE_FAILED:接收失败 |
| -2 | DISCONNECT:未连接机器人 |
| -3 | PARAM_ERR:参数错误 |
| -4 | OPERATION_NOT_ALLOWED:操作不允许 |
| -5 | EXCEPTION:异常 |
| -6 | TIMEOUT:超时 |
MoveCmd(移动指令参数)
cpp
struct MoveCmd {
PosType targetPosType{PosType::data};
std::vector<double> targetPosValue; // 前7位本体,后7位外部轴
std::string targetPosName{""};
int coord{0};
double velocity{50};
double velocitySync{0};
double acc{50};
double dec{50};
int pl{0};
int time{0};
int toolNum{0};
int userNum{0};
int configuration{0};
int spin{0};
bool parasync{false};
};ToolParam(工具手参数)
包含 X/Y/Z 偏移量(double),A/B/C 旋转量(double),负载质量、惯性、质心等参数。
RobotDHParam(DH 参数)
包含 L1-L20 共 20 个 DH 参数,耦合系数、动态限制、螺距、转换比等。
ServoMovePara(伺服运动参数)
cpp
struct ServoMovePara {
bool clearBuffer;
int targetMode; // 0=独立点,1=连续轨迹
int sendMode; // 0=一次传输全部,1=部分传输
int runMode; // 0=接收完再运动,1=边接收边运动
int sum; // 总传输次数
int count; // 当前第几次
int coord; // 0=关节,1=直角
int size; // 本次传输点位数
std::vector<std::vector<double>> pos;
std::vector<std::vector<double>> axisvel;
std::vector<std::vector<double>> axisacc;
std::vector<double> timeStamp; // 单位 ms
};WeldState(焊接状态)
| 字段 | 类型 | 说明 |
|---|---|---|
| pistolSwitch | int | 焊枪开关 |
| arcingSuccess | int | 引弧成功 |
| handWireFeed | int | 手动送丝 |
| weldCurrent | double | 焊接电流 |
| weldVoltage | double | 焊接电压 |
| weldTime | double | 焊接时间 |
| weldPWM | double | 焊接占空比 |
ArcParam(焊接参数)
包含焊接电压、焊接电流、起弧/收弧电压电流、时间、渐变等参数。
WaveParam(摆焊参数)
包含摆法方式、频率、幅度、半径、停留时间、偏转等参数。
CollisionPara(碰撞检测参数)
| 字段 | 类型 | 说明 |
|---|---|---|
| collisionDetection_run | vector<double> | 碰撞检测阈值(指令),[1,10000] |
| collisionDetection_teach | vector<double> | 碰撞检测阈值(点动),[1,10000] |
| position_delay_time_ms_value | double | 指令位置响应时间,(0,99]ms |
| error_enable_time_ms_value | double | 误差允许时间,[0,99]ms |
| axisum | unsigned int | 轴数,默认6 |
SafeIO(安全 IO 参数)
包含急停端口、安全光幕端口、使能控制等参数。
ModbusMasterParameter(Modbus 主站参数)
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| type | string | "TCP" | 主站类型 "TCP" 或 "RTU" |
| startAddress | bool | false | false=起始地址1,true=起始地址0 |
| TCP.IP | string | "192.168.1.13" | TCP IP地址 |
| TCP.port | int | 503 | TCP 端口 |
本文档由 aladin-doc-forge 工具基于 Inexbot API v2.0.4-24.03 头文件自动生成。