xCore-SDK  0.4.1
xCore SDK C# API
rokae::clr::PCB4Robot类 参考

PCB4轴机型 更多...

#include <robot_cli.hpp>

类 rokae::clr::PCB4Robot 继承关系图:
rokae::clr::BaseRobot

Public 成员函数

 PCB4Robot ()
 默认构造,需调用connectToRobot(remoteIP)初始化
 
 PCB4Robot (String^ remoteIP)
 创建机器人实例并建立连接 更多...
 
 ~PCB4Robot ()
 deconstructor
 
void connectToRobot ([Out] ErrorCode^% ec)
 连接到机器人。机器人地址为创建PCB3Robot实例时传入的 更多...
 
void connectToRobot (String^ remoteIP)
 初始化PCB4Robot,建立与机器人的连接。 更多...
 
array< double > jointPos ([Out] ErrorCode^% ec)
 机器人当前轴角度 [rad] 更多...
 
array< double > jointVel ([Out] ErrorCode^% ec)
 机器人当前关节速度 [rad/s] 更多...
 
array< double > jointTorque ([Out] ErrorCode^% ec)
 关节力传感器数值 [Nm] 更多...
 
array< double > calcIk (CartesianPosition^ posture, [Out] ErrorCode^% ec)
 根据位姿计算逆解 更多...
 
CartesianPosition calcFk (array< double >^ joints, [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)
 设置软限位。软限位设定要求:

  • 打开软限位时,机械臂应下电且处于手动模式
  • 软限位不能超过机械硬限位
  • 机械臂当前各轴角度应在设定的限位范围内
更多...
 
- Public 成员函数 继承自 rokae::clr::BaseRobot
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 > 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 setDefaultSpeed (int speed, [Out] ErrorCode^% ec)
 设定默认运动速度,初始值为100。该数值表示末端最大线速度(单位mm/s), 自动计算对应关节速度。 关节速度百分比划分为5个的范围:

  • < 100 10%
  • 100 ~ 200 30%
  • 200 ~ 500 50%
  • 500 ~ 800 80%
  • > 800 100%

空间旋转速度为200°/s 更多...

 
void setDefaultZone (int zone, [Out] ErrorCode^% ec)
 设定默认转弯区。初始值为为0 (fine, 无转弯区)。该数值表示运动最大转弯区半径(单位:mm), 自动计算转弯百分比 转弯百分比划分4个范围:

  • < 1 0 (fine)
  • 1 ~ 20 10 %
  • 20 ~ 60 30 %
  • > 60 100 %
更多...
 
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)
 设置输入仿真模式 更多...
 
template<typename T >
void readRegister (System::String^ name, List< T >^% value, [Out] ErrorCode^% ec)
 读取寄存器数组。 更多...
 
template<typename T >
void readRegister (System::String^ name, unsigned index, T% value, [Out] ErrorCode^% ec)
 读取寄存器值。可读取单个寄存器,或按索引读取寄存器数组 更多...
 
template<typename T >
void writeRegister (System::String^ name, unsigned index, T value, [Out] ErrorCode^% ec)
 写寄存器值。可写入单个寄存器,或按索引写入寄存器数组中某一元素。 更多...
 
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 recoverState (int item, [Out] ErrorCode^% ec)
 根据选项恢复机器人状态 更多...
 

额外继承的成员函数

- Protected 成员函数 继承自 rokae::clr::BaseRobot
void _moveEventCallback (const std::unordered_map< std::string, std::any > &info)
 
void _safetyEventCallback (const std::unordered_map< std::string, std::any > &info)
 
- Protected 属性 继承自 rokae::clr::BaseRobot
rokae::BaseRobot * robot
 
EventCallbackNativeDelegate _moveNativeDelegate
 
EventCallbackNativeDelegate _safetyNativeDelegate
 
- 静态 Protected 属性 继承自 rokae::clr::BaseRobot
static EventCallbackDelegate _moveManagedDelegate
 
static EventCallbackDelegate _safetyManagedDelegate
 

详细描述

PCB4轴机型

在文件 robot_cli.hpp1213 行定义.

构造及析构函数说明

◆ PCB4Robot()

rokae::clr::PCB4Robot::PCB4Robot ( String^  remoteIP)

创建机器人实例并建立连接

参数
remoteIP机器人IP地址
异常
rokae::clr::ApiException网络连接异常;控制器版本不兼容;机型不匹配等

成员函数说明

◆ calcFk()

CartesianPosition rokae::clr::PCB4Robot::calcFk ( array< double >^  joints,
[Out] ErrorCode^%  ec 
)

根据轴角度计算正解

参数
joints轴角度, 单位: 弧度
ec错误码
返回
机器人末端位姿,相对于外部参考坐标系

◆ calcIk()

array< double > rokae::clr::PCB4Robot::calcIk ( CartesianPosition posture,
[Out] ErrorCode^%  ec 
)

根据位姿计算逆解

参数
posture机器人末端位姿,相对于外部参考坐标系
ec错误码
返回
关节角度, 单位:弧度

◆ calibrateFrame()

FrameCalibrationResult rokae::clr::PCB4Robot::calibrateFrame ( FrameType  type,
List< array< double >^>^  points,
bool  is_held,
array< double >^  base_aux,
[Out] ErrorCode^%  ec 
)

坐标系标定 (N点标定).

各坐标系类型支持的标定方法及注意事项x 工具坐标系三点 / 四点 / 六点标定法 工件坐标系三点标定。标定结果不会相对用户坐标系做变换,即,若为外部工件,返回的结果是相对于基坐标系的。 基坐标系六点标定。标定前请确保动力学约束和前馈已关闭。

若标定成功(无错误码),控制器会自动保存标定结果,重启控制器后生效。

参数
type坐标系类型,支持工具(FrameType::tool), 工件(FrameType::wobj), 基坐标系(FrameType::base)
points轴角度列表,列表长度为N。例如,使用三点法标定工具坐标系,应传入3组轴角度。轴角度的单位是弧度。
is_heldtrue - 机器人手持 | false - 外部。仅影响工具/工件的标定
base_aux基坐标系标定时用到的辅助点, 单位[米]
ec错误码
返回
标定结果,当错误码没有被置位时,标定结果有效。

◆ connectToRobot() [1/2]

void rokae::clr::PCB4Robot::connectToRobot ( [Out] ErrorCode^%  ec)

连接到机器人。机器人地址为创建PCB3Robot实例时传入的

参数
ec错误码

◆ connectToRobot() [2/2]

void rokae::clr::PCB4Robot::connectToRobot ( String^  remoteIP)

初始化PCB4Robot,建立与机器人的连接。

参数
remoteIP机器人IP地址
异常
rokae::clr::ApiException网络连接异常;控制器版本不兼容;机型不匹配等

◆ getSoftLimit()

bool rokae::clr::PCB4Robot::getSoftLimit ( array< double, 2 >^%  limits,
[Out] ErrorCode^%  ec 
)

获取当前软限位数值

参数
limits各轴软限位 [下限, 上限],单位: 弧度
ec错误码
返回
true - 已打开 | false - 已关闭

◆ jointPos()

array< double > rokae::clr::PCB4Robot::jointPos ( [Out] ErrorCode^%  ec)

机器人当前轴角度 [rad]

参数
ec错误码
返回
关节弧度

◆ jointTorque()

array< double > rokae::clr::PCB4Robot::jointTorque ( [Out] ErrorCode^%  ec)

关节力传感器数值 [Nm]

参数
ec错误码
返回
关节力矩

◆ jointVel()

array< double > rokae::clr::PCB4Robot::jointVel ( [Out] ErrorCode^%  ec)

机器人当前关节速度 [rad/s]

参数
ec错误码
返回
关节速度

◆ setSoftLimit()

void rokae::clr::PCB4Robot::setSoftLimit ( bool  enable,
array< double, 2 >^  limits,
[Out] ErrorCode^%  ec 
)

设置软限位。软限位设定要求:

  • 打开软限位时,机械臂应下电且处于手动模式
  • 软限位不能超过机械硬限位
  • 机械臂当前各轴角度应在设定的限位范围内

参数
enabletrue - 打开 | false - 关闭
limits各轴[下限, 上限],单位:弧度。
  • 当limits为默认值时,视为仅打开软限位不修改数值; 不为默认值时,先修改软限位再打开
  • 关闭软限位时不会修改限位数值
ec错误码

该类的文档由以下文件生成: