![]() |
xCore-SDK
0.5.0
xCore SDK C# API
|
xMate六轴机器人6轴协作机器人, 包括 xMateCR7/12, xMateSR3/4, xMateER3/7 更多...
#include <robot_cli.hpp>
Public 成员函数 | |
xMateRobot () | |
默认构造,需调用connectToRobot(remoteIP)初始化 | |
xMateRobot (String^ remoteIP) | |
创建机器人实例并建立连接 更多... | |
xMateRobot (String^ remoteIP, String^ localIP) | |
创建机器人实例并建立连接 更多... | |
~xMateRobot () | |
decosntructor 更多... | |
void | setAvoidSingularity (AvoidSingularityMethod method, bool enable, double limit, [Out] ErrorCode^% ec) |
打开/关闭奇异点规避功能。只适用于部分机型:
| |
bool | getAvoidSingularity (AvoidSingularityMethod method, [Out] ErrorCode^% ec) |
查询是否处于规避奇异点的状态 更多... | |
![]() | |
void | enableDrag (DragOpt::Space space, DragOpt::Type type, [Out] ErrorCode^% ec) |
打开拖动 更多... | |
void | enableDrag (DragOpt::Space space, DragOpt::Type type, bool enable_drag_button, [Out] ErrorCode^% ec) |
打开拖动 更多... | |
void | disableDrag ([Out] ErrorCode^% ec) |
关闭拖动 更多... | |
void | enableCollisionDetection (array< double >^ sensitivity, StopLevel behaviour, double fallback_compliance, [Out] ErrorCode^% ec) |
设置碰撞检测相关参数, 打开碰撞检测功能。 更多... | |
void | disableCollisionDetection ([Out] ErrorCode^% ec) |
关闭碰撞检测功能 更多... | |
void | calibrateForceSensor (bool all_axes, int axis_index, [Out] ErrorCode^% ec) |
力传感器标定。标定过程需要约100ms, 该函数不会阻塞等待标定完成。 标定前需要通过setToolset()设置正确的负载(Toolset.load), 否则会影响标定结果准确性。 更多... | |
void | startRecordPath ([Out] ErrorCode^% ec) |
开始录制路径。录制的时长需要限制在30分钟以内, 此接口不会阻塞等待,录制完毕调用stopRecordPath()来停止录制 更多... | |
void | stopRecordPath ([Out] ErrorCode^% ec) |
停止录制路径, 若录制成功(无错误码)则路径数据保存在缓存中 更多... | |
void | cancelRecordPath ([Out] ErrorCode^% ec) |
取消录制, 缓存的路径数据将被删除 更多... | |
void | saveRecordPath (String^ name, String^ saveAs, [Out] ErrorCode^% ec) |
保存录制好的路径 更多... | |
void | replayPath (String^ name, double rate, [Out] ErrorCode^% ec) |
运动指令-路径回放。 和其它运动指令类似,调用replayPath之后,需调用moveStart才会开始运动。 更多... | |
void | removePath (String^ name, bool removeAll, [Out] ErrorCode^% ec) |
删除已保存的路径 更多... | |
List< String^> | queryPathLists ([Out] ErrorCode^% ec) |
查询已保存的所有路径名称 更多... | |
void | setxPanelVout (xPanelOpt::Vout opt, [Out] ErrorCode^% ec) |
设置xPanel对外供电模式。注:仅部分机型支持xPanel功能,不支持的机型会返回错误码 更多... | |
void | setxPanelRS485 (xPanelOpt::Vout opt, bool if_rs485, [Out] ErrorCode^% ec) |
使用CR和SR末端的485通信功能,需要修改末端的参数配置,可通过此接口进行参数配置 更多... | |
void | XPRWModbusRTUReg (int slave_addr, int fun_cmd, int reg_addr, String^ data_type, int num, array< int >^% data_array, bool if_crc_reverse, [Out] ErrorCode^% ec) |
通过xPanel末端读写modbus寄存器 更多... | |
void | XPRWModbusRTUCoil (int slave_addr, int fun_cmd, int coil_addr, int num, array< bool >^% data_array, bool if_crc_reverse, [Out] ErrorCode^% ec) |
通过xPanel末端读写modbus线圈或离散输入 更多... | |
void | XPRS485SendData (int send_byte, int rev_byte, array< Byte >^ send_data, array< Byte >^% recv_data, [Out] ErrorCode^% ec) |
通过xPanel末端直接传输RTU协议裸数据 更多... | |
array< bool > | getKeypadState ([Out] ErrorCode^% ec) |
获取末端按键状态,不支持的机型会返回错误码。 更多... | |
ForceControl | forceControl () |
力控指令类 更多... | |
![]() | |
virtual | ~BaseRobot () |
Deconstructor | |
void | connectToRobot ([Out] ErrorCode^% ec) |
连接到机器人。机器人地址为创建StandardRobot实例时传入的 更多... | |
void | connectToRobot (String^ remoteIP) |
建立与机器人的连接。 更多... | |
void | connectToRobot (String^ remoteIP, String^ localIP) |
建立与机器人的连接。 更多... | |
void | disconnectFromRobot ([Out] ErrorCode^% ec) |
断开与机器人连接。断开前会停止机器人运动, 请注意安全。 更多... | |
Info | robotInfo ([Out] ErrorCode^% ec) |
查询机器人基本信息 更多... | |
String | sdkVersion () |
查询xCoreSDK版本 更多... | |
PowerState | powerState ([Out] ErrorCode^% ec) |
查询机器人上下电以及急停状态 更多... | |
void | setPowerState (Boolean on, [Out] ErrorCode^% ec) |
机器人上下电。注: 只有无外接使能开关或示教器的机器人才能手动模式上电。 更多... | |
OperateMode | operateMode ([Out] ErrorCode^% ec) |
查询机器人当前操作模式 更多... | |
void | setOperateMode (OperateMode mode, [Out] ErrorCode^% ec) |
切换手自动模式 更多... | |
OperationState | operationState ([Out] ErrorCode^% ec) |
查询机器人当前运行状态 (空闲, 运动中, 拖动开启等) 更多... | |
array< double > | jointPos ([Out] ErrorCode^% ec) |
机器人当前轴角度 [rad], 机器人本体以及外部轴(若有)。 导轨[m] 更多... | |
array< double > | jointVel ([Out] ErrorCode^% ec) |
机器人当前关节速度 [rad/s], 机器人本体以及外部轴(若有)。 导轨[m/s] 更多... | |
array< double > | jointTorque ([Out] ErrorCode^% ec) |
关节力传感器数值 [Nm] 更多... | |
array< double > | posture (CoordinateType ct, [Out] ErrorCode^% ec) |
获取机器人法兰或末端的当前位姿 更多... | |
CartesianPosition | cartPosture (CoordinateType ct, [Out] ErrorCode^% ec) |
获取机器人法兰或末端的当前位姿 更多... | |
array< double > | baseFrame ([Out] ErrorCode^% ec) |
读取基坐标系, 相对于世界坐标系 更多... | |
Toolset | toolset ([Out] ErrorCode^% ec) |
查询当前工具工件组信息. 更多... | |
void | setToolset (Toolset^ toolset, [Out] ErrorCode^% ec) |
设置工具工件组信息。 更多... | |
void | setToolset (System::String^ toolName, System::String^ wobjName, [Out] ErrorCode^% ec) |
使用已创建的工具和工件,设置工具工件组信息 更多... | |
void | setBaseFrame (Frame^ frame, [Out] ErrorCode^% ec) |
设置基坐标系, 设置后仅保存数值,重启控制器后生效 更多... | |
void | setMotionControlMode (MotionControlMode mode, [Out] ErrorCode^% ec) |
设置运动控制模式. 更多... | |
void | moveReset ([Out] ErrorCode^% ec) |
运动重置, 清空已发送的运动指令, 清除执行信息。 Robot类在初始化时会调用一次运动重置。RL程序和SDK运动指令切换控制,需要先运动重置。 更多... | |
void | stop ([Out] ErrorCode^% ec) |
暂停机器人运动; 暂停后可调用moveStart()继续运动。若需要完全停止,不再执行已添加的指令,可调用moveReset() 更多... | |
void | executeCommand (MoveCommand::Type type, List< MoveCommand^>^ cmd, [Out] ErrorCode^% ec) |
执行单条或多条运动指令,调用后机器人立刻开始运动 更多... | |
void | moveAppend (MoveCommand::Type type, List< MoveCommand^>^ cmd, System::String^% cmdId, [Out] ErrorCode^% ec) |
添加单条或多条运动指令, 添加后调用moveStart()开始运动 更多... | |
void | moveAppend (MoveCommand::Type type, MoveCommand^ cmd, System::String^% cmdId, [Out] ErrorCode^% ec) |
下发单条运动指令 更多... | |
void | setDefaultSpeed (int speed, [Out] ErrorCode^% ec) |
设定默认运动速度,初始值为100。该数值表示末端最大线速度(单位mm/s), 自动计算对应关节速度。 关节速度百分比划分为5个的范围:
空间旋转速度为200°/s 更多... | |
void | setDefaultZone (int zone, [Out] ErrorCode^% ec) |
设定默认转弯区。初始值为为0 (fine, 无转弯区)。该数值表示运动最大转弯区半径(单位:mm), 自动计算转弯百分比 转弯百分比划分4个范围:
| |
void | setDefaultConfOpt (bool forced, [Out] ErrorCode^% ec) |
设置是否使用轴配置数据(confData)计算逆解。初始值为false 更多... | |
void | moveStart ([Out] ErrorCode^% ec) |
开始/继续运动 更多... | |
void | setMaxCacheSize (int number, [Out] ErrorCode^% ec) |
设置最大缓存指令个数,指发送到控制器待规划的路径点个数,允许的范围[1,300],初始值为30。 更多... | |
void | adjustSpeedOnline (double scale, [Out] ErrorCode^% ec) |
动态调整机器人运动速率,非实时模式时生效。 更多... | |
void | getAcceleration (double% acc, double% jerk, [Out] ErrorCode^% ec) |
读取当前加/减速度和加加速度 更多... | |
void | adjustAcceleration (double acc, double jerk, [Out] ErrorCode^% ec) |
调节运动加/减速度和加加速度。如果在机器人运动中调用,当前正在执行的指令不生效,下一条指令生效 更多... | |
EventInfo | queryEventInfo (Event eventType, [Out] ErrorCode^% ec) |
查询事件信息。 更多... | |
void | setEventWatcher (Event eventType, EventCallbackDelegate^ callback, [Out] ErrorCode^% ec) |
设置接收事件的回调函数。 更多... | |
void | startJog (JogSpace space, double rate, double step, unsigned index, bool direction, [Out] ErrorCode^% ec) |
开始jog机器人,需要切换到手动操作模式。调用此接口并且机器人开始运动后,无论机器人是否已经自行停止,都必须调用stop()来结束jog操作,否则机器人会一直处于jog的运行状态。 更多... | |
void | clearServoAlarm ([Out] ErrorCode^% ec) |
清除伺服报警 更多... | |
List< LogInfo^> | queryControllerLog (unsigned count, LogInfo::Level level, [Out] ErrorCode^% ec) |
查询控制器最新的日志 更多... | |
void | setDI (unsigned int board, unsigned int port, bool state, [Out] ErrorCode^% ec) |
设置数字量输入信号,仅当输入仿真模式打开时可以设置(见setSimulationMode()) 更多... | |
bool | getDI (unsigned int board, unsigned int port, [Out] ErrorCode^% ec) |
查询数字量输入信号值 更多... | |
void | setDO (unsigned int board, unsigned int port, bool state, [Out] ErrorCode^% ec) |
设置数字量输出信号值 更多... | |
bool | getDO (unsigned int board, unsigned int port, [Out] ErrorCode^% ec) |
查询数字输出量信号值 更多... | |
double | getAI (unsigned board, unsigned port, [Out] ErrorCode^% ec) |
读取模拟量输入信号值 更多... | |
void | setAO (unsigned board, unsigned port, double value, [Out] ErrorCode^% ec) |
设置模拟量输出信号 更多... | |
void | setSimulationMode (bool state, [Out] ErrorCode^% ec) |
设置输入仿真模式 更多... | |
void | readRegister (System::String^ name, List< bool >^% value, [Out] ErrorCode^% ec) |
读取bit/bool类型寄存器数组。 更多... | |
void | readRegister (System::String^ name, List< int >^% value, [Out] ErrorCode^% ec) |
读取int16/int32类型寄存器数组。 更多... | |
void | readRegister (System::String^ name, List< float >^% value, [Out] ErrorCode^% ec) |
读取float类型寄存器数组。 更多... | |
void | readRegister (System::String^ name, unsigned index, bool% value, [Out] ErrorCode^% ec) |
读取bit/bool类型寄存器值。可读取单个寄存器,或按索引读取寄存器数组 更多... | |
void | readRegister (System::String^ name, unsigned index, int% value, [Out] ErrorCode^% ec) |
读取int16/int32类型寄存器值。可读取单个寄存器,或按索引读取寄存器数组 更多... | |
void | readRegister (System::String^ name, unsigned index, float% value, [Out] ErrorCode^% ec) |
读取float类型寄存器值。可读取单个寄存器,或按索引读取寄存器数组 更多... | |
void | writeRegister (System::String^ name, unsigned index, bool value, [Out] ErrorCode^% ec) |
写bool/bit类型寄存器值。可写入单个寄存器,或按索引写入寄存器数组中某一元素。 更多... | |
void | writeRegister (System::String^ name, unsigned index, Int32 value, [Out] ErrorCode^% ec) |
写byte/int16/int32寄存器值。可写入单个寄存器,或按索引写入寄存器数组中某一元素。 更多... | |
void | writeRegister (System::String^ name, unsigned index, float value, [Out] ErrorCode^% ec) |
写float类型寄存器值。可写入单个寄存器,或按索引写入寄存器数组中某一元素。 更多... | |
void | writeRegister (System::String^ name, unsigned index, array< bool >^ value, [Out] ErrorCode^% ec) |
写bool/bit类型寄存器数组 更多... | |
void | writeRegister (System::String^ name, unsigned index, array< int >^ value, [Out] ErrorCode^% ec) |
写int16/int32类型寄存器数组。 更多... | |
void | writeRegister (System::String^ name, unsigned index, array< float >^ value, [Out] ErrorCode^% ec) |
写float类型寄存器数组。 更多... | |
List< RLProjectInfo^> | projectsInfo ([Out] ErrorCode^% ec) |
查询工控机中RL工程名称及任务 更多... | |
void | loadProject (String^ name, System::Collections::Generic::List< System::String^>^ tasks, [Out] ErrorCode^% ec) |
加载工程 更多... | |
void | ppToMain ([Out] ErrorCode^% ec) |
程序指针跳转到main。调用后,等待控制器解析完工程后返回,阻塞时间视工程大小而定,超时时间设定为10秒。 更多... | |
void | runProject ([Out] ErrorCode^% ec) |
开始运行当前加载的工程 更多... | |
void | pauseProject ([Out] ErrorCode^% ec) |
暂停运行工程 更多... | |
void | setProjectRunningOpt (double rate, bool loop, [Out] ErrorCode^% ec) |
更改工程的运行速度和循环模式 更多... | |
List< WorkToolInfo^> | toolsInfo ([Out] ErrorCode^% ec) |
查询当前加载工程的工具信息 更多... | |
List< WorkToolInfo^> | wobjsInfo ([Out] ErrorCode^% ec) |
查询当前加载工程的工件信息 更多... | |
void | setRailParameter (System::String^ name, Frame^ value, [Out] ErrorCode^% ec) |
设置导轨基坐标系 更多... | |
void | setRailParameter (System::String^ name, System::String^ value, [Out] ErrorCode^% ec) |
设置导轨名称 更多... | |
void | setRailParameter (System::String^ name, double value, [Out] ErrorCode^% ec) |
设置导轨参数 更多... | |
void | setRailParameter (System::String^ name, bool value, [Out] ErrorCode^% ec) |
打开关闭导轨 更多... | |
void | setRailParameter (System::String^ name, array< double >^ value, [Out] ErrorCode^% ec) |
设置导轨软限位和运动范围 更多... | |
void | setRailParameter (System::String^ name, int value, [Out] ErrorCode^% ec) |
设置导轨参数 更多... | |
void | getRailParameter (System::String^ name, bool% value, [Out] ErrorCode^% ec) |
读取导轨是否打开 更多... | |
void | getRailParameter (System::String^ name, String^% value, [Out] ErrorCode^% ec) |
读取导轨名称 更多... | |
void | getRailParameter (System::String^ name, Frame^% value, [Out] ErrorCode^% ec) |
读取导轨基座标系 更多... | |
void | getRailParameter (System::String^ name, int% value, [Out] ErrorCode^% ec) |
读取导轨参数 更多... | |
void | getRailParameter (System::String^ name, double% value, [Out] ErrorCode^% ec) |
读取导轨参数 更多... | |
void | getRailParameter (System::String^ name, array< double >^% value, [Out] ErrorCode^% ec) |
读取导轨软限位和运动范围 更多... | |
int | getStateData (String^ name, array< double >^% data) |
读取机器人状态数据,注意传入的data类型要和数据类型一致。 支持的数据名称及数组长度 关节角度[rad]"q_m" | DoF 关节速度[rad/s]"dq_m" | DoF 关节力矩[Nm]"tau_m" | DoF 电机位置"theta_m" | DoF 电机位置微分"theta_vel_m" | DoF 电机转矩"motor_tau" | DoF 末端位姿, 相对于外部坐标系 [X,Y,Z,Rx,Ry,Rz]"pos_abc_m" | 6 末端位姿, 相对于外部坐标系, 行优先齐次变换矩阵"pos_m" | 16 外部轴角度[rad] 导轨[m]"ex_q_m" | 6 外部轴速度[rad/s] 导轨[m/s]"ex_dq_m" | 6 外部轴电机位置"ex_motor_m" | 6 更多... | |
int | getStateData (String^ name, UInt64% data) |
读取机器人状态数据 支持的数据名称 时间戳,精确到微秒"ts" 更多... | |
int | getStateData (String^ name, double% data) |
读取机器人状态数据 支持的数据名称 臂角[rad]"psi_m" 更多... | |
void | stopReceiveRobotState () |
停止接收实时状态数据,同时控制器停止发送。可用于重新设置要接收的状态数据。 | |
unsigned | updateRobotState (int timeout_ms) |
接收一次机器人状态数据,在每周期读取数据前,需调用此函数。阻塞等待收到新数据,或超时返回。 建议按照设定的发送频率来调用,以获取最新的数据 更多... | |
void | configNtp (System::String^ server_ip, [Out] ErrorCode^% ec) |
配置NTP 更多... | |
void | syncTimeWithServer ([Out] ErrorCode^% ec) |
手动同步一次时间,远端IP是通过configNtp配置的。耗时几秒钟,阻塞等待同步完成,接口预设的超时时间是12秒 更多... | |
array< double > | checkPath (CartesianPosition^ start, array< double >^ start_joint, CartesianPosition^ target, [Out] ErrorCode^% ec) |
检验直线轨迹是否可达。支持导轨,返回的目标轴角为轴数+外部轴数 更多... | |
int | checkPath (array< double >^ start_joint, array< CartesianPosition^>^ targets, array< double >^% target_joint_calculated, [Out] ErrorCode^% ec) |
校验多个直线轨迹 更多... | |
array< double > | checkPath (CartesianPosition^ start, array< double >^ start_joint, CartesianPosition^ aux, CartesianPosition^ target, [Out] ErrorCode^% ec) |
检验圆弧轨迹是否可达 更多... | |
array< double > | checkPath (CartesianPosition^ start, array< double >^ start_joint, CartesianPosition^ aux1, CartesianPosition^ aux2, double angle, double rot_type, [Out] ErrorCode^% ec) |
检验全圆轨迹是否可达 更多... | |
void | recoverState (int item, [Out] ErrorCode^% ec) |
根据选项恢复机器人状态 更多... | |
array< double > | calcIk (CartesianPosition^ posture, [Out] ErrorCode^% ec) |
根据位姿计算逆解 更多... | |
array< double > | calcIk (CartesianPosition^ posture, Toolset^ toolset, [Out] ErrorCode^% ec) |
根据位姿计算给定工具工件坐标系下逆解 更多... | |
CartesianPosition | calcFk (array< double >^ joints, [Out] ErrorCode^% ec) |
根据轴角度计算正解 更多... | |
CartesianPosition | calcFk (array< double >^ joints, Toolset^ toolset, [Out] ErrorCode^% ec) |
根据轴角度计算给定工具工件坐标系下正解 更多... | |
FrameCalibrationResult | calibrateFrame (FrameType type, List< array< double >^>^ points, bool is_held, array< double >^ base_aux, [Out] ErrorCode^% ec) |
坐标系标定 (N点标定). 更多... | |
bool | getSoftLimit (array< double, 2 >^% limits, [Out] ErrorCode^% ec) |
获取当前软限位数值 更多... | |
void | setSoftLimit (bool enable, array< double, 2 >^ limits, [Out] ErrorCode^% ec) |
设置软限位。软限位设定要求:
| |
void | startReceiveRobotState (int interval, array< System::String^>^ fields) |
让机器人控制器开始发送实时状态数据。阻塞等待收到第一帧消息,超时时间为3秒 更多... | |
额外继承的成员函数 | |
![]() | |
void | _moveEventCallback (const std::unordered_map< std::string, std::any > &info) |
void | _safetyEventCallback (const std::unordered_map< std::string, std::any > &info) |
void | _rlExecutionEventCallback (const std::unordered_map< std::string, std::any > &info) |
![]() | |
rokae::BaseCobot * | robot |
![]() | |
rokae::BaseRobot * | robot |
rokae::StandardRobot * | ir6 |
rokae::PCB3Robot * | ir3 |
rokae::PCB4Robot * | ir4 |
rokae::xMateCr5Robot * | cobot5 |
rokae::xMateRobot * | cobot6 |
rokae::xMateErProRobot * | cobot7 |
rokae::Model_T< 3 > * | model3 |
rokae::Model_T< 4 > * | model4 |
rokae::Model_T< 5 > * | model5 |
rokae::Model_T< 6 > * | model6 |
rokae::Model_T< 7 > * | model7 |
EventCallbackNativeDelegate | _moveNativeDelegate |
EventCallbackNativeDelegate | _safetyNativeDelegate |
EventCallbackNativeDelegate | _rlExecutionNativeDelegate |
![]() | |
static EventCallbackDelegate | _moveManagedDelegate |
static EventCallbackDelegate | _safetyManagedDelegate |
static EventCallbackDelegate | _rlExecutionManagedDelegate |
xMate六轴机器人6轴协作机器人, 包括 xMateCR7/12, xMateSR3/4, xMateER3/7
在文件 robot_cli.hpp 第 1264 行定义.
rokae::clr::xMateRobot::xMateRobot | ( | String^ | remoteIP | ) |
rokae::clr::xMateRobot::xMateRobot | ( | String^ | remoteIP, |
String^ | localIP | ||
) |
|
inline |
decosntructor
在文件 robot_cli.hpp 第 1289 行定义.
bool rokae::clr::xMateRobot::getAvoidSingularity | ( | AvoidSingularityMethod | method, |
[Out] ErrorCode^% | ec | ||
) |
查询是否处于规避奇异点的状态
method | 奇异规避的方式 |
ec | 错误码 |
void rokae::clr::xMateRobot::setAvoidSingularity | ( | AvoidSingularityMethod | method, |
bool | enable, | ||
double | limit, | ||
[Out] ErrorCode^% | ec | ||
) |
打开/关闭奇异点规避功能。只适用于部分机型:
method | 奇异规避方式 |
enable | true - 打开功能 | false - 关闭。对于四轴锁定方式, 打开之前要确保4轴处于零位。 |
limit | 不同的规避方式,该参数含义分别为:
|
ec | 错误码 |